~amsn-daily/amsn/amsn-packaging

2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1
::Version::setSubversionId {$Id$}
6888 by lephilousophe
As version system is now working, I commit it to trunk...
2
3
package require BWidget
6382 by tjikkun
please check for regressions now that we use upstream bwidget, when we find stuff we don't like or we want extra stuff we can submit it to the bwidget project, that is what i did with the font dialog, and that is now fixed. This way we don't have to maintain bwidget ourselves too
4
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
5
#TODO:
4110 by airadier
Working in preferences window
6
#Put items frame and listbox in scrollbars!!
7
8
6397 by kakaroto
ok, a few changes here... I make sure to load the shipped version of snack for windows and mac + it removed the 'version compatibility' error you get because of providing 2.2.10 in one place (snack.tcl) and providing 2.2 in another place (inside the .dll/.dylib). I also changed that for every 'package require snack' inside of amsn's code. I also fixed the 2.2 vs. 2.2.10 package require/provide..
9
namespace eval Preferences {
4110 by airadier
Working in preferences window
10
11
	proc Show {} {
12
13
		if [winfo exists .prefs] {
14
			raise .prefs
15
			catch {focus -force .prefs}
16
			return
17
		}
18
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
19
		#Set pixmaps
4110 by airadier
Working in preferences window
20
		::skin::setPixmap prefpers prefpers.gif
21
		::skin::setPixmap prefprofile prefprofile.gif
22
		::skin::setPixmap preffont preffont.gif
23
		::skin::setPixmap prefphone prefphone.gif
24
4114 by airadier
Working in new preferences
25
		::skin::setPixmap preflook preflook.gif
26
		::skin::setPixmap prefemotic prefemotic.gif
27
		::skin::setPixmap prefalerts prefalerts.gif
28
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
29
30
		if { [LoginList exists 0 [::config::getKey login]] == 1 } {
4110 by airadier
Working in preferences window
31
			PreferencesWindow .prefs -title "[trans preferences] - [trans profiledconfig] - [::config::getKey login]" -savecommand ::Preferences::Save
32
		} else {
33
			PreferencesWindow .prefs -title "[trans preferences] - [trans defaultconfig] - [::config::getKey login]" -savecommand ::Preferences::Save
34
		}
35
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
36
		#####################################################
4110 by airadier
Working in preferences window
37
		# Section "Personal"
38
		#####################################################
39
		set section [PreferencesSection .prefs.personal -text [trans personal]]
40
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
41
		set frame [ItemsFrame .prefs.personal.nicks -text [trans prefname] -icon prefpers]
4110 by airadier
Working in preferences window
42
		$frame addItem [TextEntry .prefs.personal.nicks.nick -width 40 -text "[trans enternick] :" \
4114 by airadier
Working in new preferences
43
			-storecommand ::Preferences::StoreNick -retrievecommand [list ::abook::getPersonal MFN]]
4857 by tjikkun
own nick is displayed on MSNP11
44
		$frame addItem [TextEntry .prefs.personal.nicks.chat -width 40 -text "[trans friendlyname] :" \
4114 by airadier
Working in new preferences
45
			-variable [::config::getVar p4c_name]]
4110 by airadier
Working in preferences window
46
		$section addItem $frame
47
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
48
		set frame [ItemsFrame .prefs.personal.preffont -text [trans preffont] -icon preffont]
4110 by airadier
Working in preferences window
49
		$frame addItem [Label .prefs.personal.preffont.lab -text [trans preffont2] -align center]
4114 by airadier
Working in new preferences
50
		$frame addItem [CommandButton .prefs.personal.preffont.changefont -text [trans changefont] \
4110 by airadier
Working in preferences window
51
			-variable [::config::getVar mychatfont] -buttoncommand ::Preferences::ChangeFont]
52
		$frame addItem [CommandButton .prefs.personal.preffont.changeincomingfont -text [trans changefont] \
5624 by bluetit
Can now change incoming message font. New lang key preffont4
53
			-variable [::config::getVar theirchatfont] -buttoncommand ::Preferences::ChangeFont]
54
		$section addItem $frame
4110 by airadier
Working in preferences window
55
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
56
		set frame [ItemsFrame .prefs.personal.prefphone -text [trans prefphone] -icon prefphone]
4110 by airadier
Working in preferences window
57
		#$frame addItem [Label create .prefs.personal.prefphone.lab -text [trans prefphone2]]
58
		$frame addItem [TextEntry .prefs.personal.prefphone.home -text "[trans myhomephone]:" -width 20 \
4114 by airadier
Working in new preferences
59
			-retrievecommand [list ::abook::getPersonal PHH]]
4110 by airadier
Working in preferences window
60
		$frame addItem [TextEntry .prefs.personal.prefphone.work -text "[trans myworkphone]:" -width 20 \
4114 by airadier
Working in new preferences
61
			-retrievecommand [list ::abook::getPersonal PHW]]
4110 by airadier
Working in preferences window
62
		$frame addItem [TextEntry .prefs.personal.prefphone.mobile -text "[trans mymobilephone]:" -width 20 \
4114 by airadier
Working in new preferences
63
			-retrievecommand [list ::abook::getPersonal PHM]]
4110 by airadier
Working in preferences window
64
		$frame addItem [CheckBox .prefs.personal.prefphone.allowsms -text [trans allow_sms] \
65
			-onvalue "Y" -offvalue "N" -storecommand [list ::abook::setPhone pager] -retrievecommand [list ::abook::getPersonal MOB]]
66
		$section addItem $frame
67
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
68
4110 by airadier
Working in preferences window
69
		.prefs addSection $section
70
4114 by airadier
Working in new preferences
71
		####################################################
72
		# Section Interface
73
		#####################################################
74
		set section [PreferencesSection interface -text [trans appearance]]
75
		.prefs addSection $section
76
77
		set frame [ItemsFrame look -text [trans preflook] -icon preflook]
78
		$frame addItem [Label preflook.labenc -text "[trans encoding2]:" -align left]
79
		$frame addItem [CommandButton preflook.encoding -text [trans encoding] -align left\
80
			-variable [::config::getVar encoding] -buttoncommand ::Preferences::ChangeEncoding]
81
82
		$frame addItem [Label preflook.labfont -text "[trans preffont3]:" -align left]
83
		$frame addItem [CommandButton preflook.font -text [trans changefont] -align left\
84
			-variable [::config::getGlobalVar basefont] -buttoncommand ::Preferences::ChangeBaseFont]
85
86
		$frame addItem [Label preflook.labdate -text "[trans dateformat]:" -align left]
87
		$frame addItem [RadioGroup preflook.date \
88
			-texts [list "[trans month]/[trans day]/[trans year]" "[trans day]/[trans month]/[trans year]" "[trans year]/[trans month]/[trans day]"] \
89
			-values [list MDY DMY YMD] -variable [::config::getVar dateformat]]
90
91
		$section addItem $frame
92
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
93
		####################################################
4110 by airadier
Working in preferences window
94
		# Section ...
95
		#####################################################
96
		set section [PreferencesSection .prefs.caca -text "Test"]
97
		$section addSection [PreferencesSection .prefs.caca2 -text "Test2"]
98
		$section addSection [PreferencesSection .prefs.caca3 -text "Test3"]
99
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
100
		.prefs addSection $section
4110 by airadier
Working in preferences window
101
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
102
		.prefs show .prefs_window
4110 by airadier
Working in preferences window
103
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
104
		Configure 1
4110 by airadier
Working in preferences window
105
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
106
	}
4110 by airadier
Working in preferences window
107
108
	proc Configure { {fullinit 0} } {
109
110
		if {![winfo exists .prefs]} {
111
			return
112
		}
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
113
4110 by airadier
Working in preferences window
114
		if { $fullinit } {
115
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
116
			.prefs.personal.nicks.chat setValue [::config::getKey p4c_name]
4110 by airadier
Working in preferences window
117
			if { [::MSN::myStatusIs] == "FLN" } {
118
				.prefs.personal.nicks.nick configure -enabled 0
119
				.prefs.personal.prefphone.home configure -enabled 0
120
				.prefs.personal.prefphone.work configure -enabled 0
121
				.prefs.personal.prefphone.mobile configure -enabled 0
122
				.prefs.personal.prefphone.allowsms configure -enabled 0
123
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
124
			} else {
4110 by airadier
Working in preferences window
125
				.prefs.personal.nicks.nick configure -enabled 1
126
				.prefs.personal.prefphone.home configure -enabled 1
127
				.prefs.personal.prefphone.work configure -enabled 1
128
				.prefs.personal.prefphone.mobile configure -enabled 1
129
			}
130
			if { [::abook::getPersonal MBE] == "N" } {
131
				.prefs.personal.prefphone.allowsms -enabled 0
132
			}
133
		}
134
135
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
136
	}
4110 by airadier
Working in preferences window
137
138
	proc Save {} {
139
140
		set must_restart 0
4114 by airadier
Working in new preferences
141
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
142
		# Check and save phone numbers
143
		if { [::MSN::myStatusIs] != "FLN" } {
4110 by airadier
Working in preferences window
144
			#set lfname [Rnotebook:frame $nb $Preftabs(personal)]
145
			set home [urlencode [.prefs.personal.prefphone.home getValue]]
146
			set work [urlencode [.prefs.personal.prefphone.work getValue]]
147
			set mobile [urlencode [.prefs.personal.prefphone.mobile getValue]]
148
			if { $home != [::abook::getPersonal PHH] } {
149
				::abook::setPhone home $home
150
			}
151
			if { $work != [::abook::getPersonal PHW] } {
152
				::abook::setPhone work $work
153
			}
154
			if { $mobile != [::abook::getPersonal PHM] } {
155
				::abook::setPhone mobile $mobile
156
			}
157
		}
158
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
159
		if { [preflook.font getValue] != [::config::getGlobalKey basefont]} {
4114 by airadier
Working in new preferences
160
			set must_restart 1
161
		}
162
163
		if { $must_restart } {
164
			msg_box [trans mustrestart]
165
		}
166
167
		::Event::fireEvent changedPreferences gui
6520 by lephilousophe
Implemented smiley setting for newCL
168
4114 by airadier
Working in new preferences
169
	}
4110 by airadier
Working in preferences window
170
171
172
	proc ChangeFont { currentfont } {
173
174
		#Get current font configuration
175
		set fontname [lindex $currentfont 0]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
176
		set fontstyle [lindex $currentfont 1]
4110 by airadier
Working in preferences window
177
		set fontcolor [lindex $currentfont 2]
178
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
179
		if { [catch {
4110 by airadier
Working in preferences window
180
				set selfont_and_color [SelectFont .fontsel -parent .prefs_window -title [trans choosebasefont] -font [list $fontname 12 $fontstyle] -initialcolor "#$fontcolor"]
4114 by airadier
Working in new preferences
181
			}]} {
4110 by airadier
Working in preferences window
182
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
183
			set selfont_and_color [SelectFont .fontsel -parent .prefs_window -title [trans choosebasefont] -font [list "helvetica" 12 [list]] -initialcolor "#000000"]
4114 by airadier
Working in new preferences
184
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
185
		}
4110 by airadier
Working in preferences window
186
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
187
		set selfont [lindex $selfont_and_color 0]
4110 by airadier
Working in preferences window
188
		set selcolor [lindex $selfont_and_color 1]
189
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
190
		if { $selfont == ""} {
4110 by airadier
Working in preferences window
191
			return $currentfont
192
		}
193
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
194
		set sel_fontfamily [lindex $selfont 0]
4110 by airadier
Working in preferences window
195
		set sel_fontstyle [lrange $selfont 2 end]
196
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
197
198
		if { $selcolor == "" } {
4110 by airadier
Working in preferences window
199
			set selcolor $fontcolor
200
		} else {
201
			set selcolor [string range $selcolor 1 end]
202
		}
203
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
204
		return [list $sel_fontfamily $sel_fontstyle $selcolor]
4110 by airadier
Working in preferences window
205
	}
206
207
	proc ChangeBaseFont {currentfont} {
4114 by airadier
Working in new preferences
208
		if { [winfo exists .basefontsel] } {
209
			raise .basefontsel
210
			return
211
		}
212
213
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
214
		if { [catch {
4114 by airadier
Working in new preferences
215
			set font [SelectFont .basefontsel -parent .prefs_window -title [trans choosebasefont] -font $currentfont -styles [list]]
216
			}]} {
217
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
218
			set font [SelectFont .basefontsel -parent .prefs_window -title [trans choosebasefont] -font [list "helvetica" 12 [list]] -styles [list]]
4114 by airadier
Working in new preferences
219
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
220
		}
4114 by airadier
Working in new preferences
221
222
		set family [lindex $font 0]
223
		set size [lindex $font 1]
224
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
225
		if { $family == "" || $size == ""} {
4114 by airadier
Working in new preferences
226
			return $currentfont
227
		}
228
229
		return [list $family $size normal]
230
	}
231
232
	proc ChangeEncoding { currentenc } {
233
		::amsn::messageBox "TODO" yesno question "[trans confirm]" .prefs_window
234
	}
235
236
	proc StoreNick { nick } {
4110 by airadier
Working in preferences window
237
		if {$nick != "" && $nick != [::abook::getPersonal MFN] && [::MSN::myStatusIs] != "FLN" && [::config::getKey emailVerified 1] == 1} {
9090 by baaazen
store information about unverified email adresses and use information to lock the fields for changing nicks and for showing a notice in the contact
238
			::MSN::changeName $nick
8288 by kakaroto
Add support for content roaming (nickname+psm.. not dp.. for now)
239
		}
4110 by airadier
Working in preferences window
240
	}
241
	proc StorePSM { psm } {
8599 by billiob
add menu entries to change psm + an entry in prefs
242
		if {$psm != "" && $psm != [::abook::getPersonal PSM] && [::MSN::myStatusIs] != "FLN"} {
243
			::MSN::changePSM $psm
244
		}
245
	}
246
4110 by airadier
Working in preferences window
247
}
3859 by airadier
Working in new preferences
248
249
#This object type is a generic and abstract preference item.
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
250
# OPTIONS
4110 by airadier
Working in preferences window
251
# -variable	The variable where the value will be stored/retrieved
252
# -retrievecommand
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
253
#		A command that needs to be called to retrieve the initial value of the text entry
4110 by airadier
Working in preferences window
254
# -storecommand
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
255
#		A command that needs to be called to store the value of the text entry when the "store"
4110 by airadier
Working in preferences window
256
#		method is called. The command will be appended one argument, the text entry value
257
# -enabled	Enables or disabled the item
258
# METHODS
259
# getValue()	Return the current value of the item
260
# setValue(val) Sets the value of the item
261
# draw(path)	Draws the item inside the specified container
262
# store()	Store the item value in the related variable
263
::snit::type PreferenceItem {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
264
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
265
	#The variable where the items stores its data
3859 by airadier
Working in new preferences
266
	option -variable -readonly no -default ""
4110 by airadier
Working in preferences window
267
	#The command that must be executed to retrieve the value. This command should return the variable value
268
	option -retrievecommand -readonly no -default ""
269
	#The command that must be executed to store the command. The value in the widget will be appended as parameter to the command
270
	option -storecommand -readonly no -default ""
271
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
272
	#Enable or disable the item
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
273
	option -enabled -default true
274
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
275
	##########################################
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
276
	#Common methods for all preference items
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
277
	##########################################
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
278
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
279
	constructor {args} {
4110 by airadier
Working in preferences window
280
		$self configurelist $args
281
	}
282
283
	onconfigure -variable { val } {
284
		upvar $val var
285
		$self setValue $var
286
		set options(-variable) $val
287
	}
288
	onconfigure -retrievecommand { val } {
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
289
		$self setValue [eval $val]
4110 by airadier
Working in preferences window
290
		set options(-retrievecommand) $val
291
	}
292
293
	variable value ""
294
295
	#Return the item value
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
296
	method getValue {} {
297
		return $value
4110 by airadier
Working in preferences window
298
	}
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
299
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
300
	#Set the item value
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
301
	method setValue {new_val} {
302
		set value $new_val
4110 by airadier
Working in preferences window
303
	}
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
304
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
305
	#Draw the element in the given widget path (path must be a container)
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
306
	method draw {path} {
307
		label $path.l -text "Preference item"
4110 by airadier
Working in preferences window
308
		pack $path.l
309
	}
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
310
311
	#Store the object values
4110 by airadier
Working in preferences window
312
	method store {} {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
313
		if {!$options(-enabled)} {
4110 by airadier
Working in preferences window
314
			status_log "$self disabled, not storing\n" blue
315
			return
316
		}
317
		status_log "Storing $self, value [$self getValue]\n" blue
318
		if { $options(-variable) != "" } {
319
			status_log "   in variable $options(-variable)\n" blue
320
			upvar $options(-variable) var
321
			set var [$self getValue]
322
		}
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
323
		if { $options(-storecommand) != "" } {
4110 by airadier
Working in preferences window
324
			status_log "   with command $options(-storecommand)\n" blue
325
			eval [concat $options(-storecommand) [list [$self getValue]]]
326
		}
327
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
328
	}
4110 by airadier
Working in preferences window
329
330
	method valueVar {} {
331
		return [myvar value]
332
	}
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
333
}
334
335
#This type is child of PreferenceItem. It groups some options under a
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
336
#frame with a label and an icon.
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
337
#Usage:
4110 by airadier
Working in preferences window
338
# OPTIONS
339
# -text 	The text to be shown in the frame header
340
# -icon 	A picture to be shown at the left, inside the frame
341
# -expand 	The frame should expand in the container. Defaults to YES
342
# -fill		The frame should fill all available space in X, Y or BOTH. Defaults to X
343
# -enabled	The frame and contained items is enabled/disabled
344
# METHODS
345
# addItem(item)		Add a PreferenceItem inside this frame
346
::snit::type ItemsFrame {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
347
3859 by airadier
Working in new preferences
348
	#Delegate to PreferenceItem by default
349
	delegate method * to preferenceitem
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
350
	delegate option * to preferenceitem
351
352
	#The widget path to this item
3859 by airadier
Working in new preferences
353
	variable itemPath ""
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
354
	#The items contained inside the frame
3859 by airadier
Working in new preferences
355
	variable items [list]
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
356
357
	constructor {args} {
358
		install preferenceitem using PreferenceItem %AUTO%
359
		$self configurelist $args
360
	}
361
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
362
	destructor {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
363
		#Destroy the PreferenceItem object
3859 by airadier
Working in new preferences
364
		$preferenceitem destroy
365
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
366
		#Destroy child items
4110 by airadier
Working in preferences window
367
		foreach item $items {
368
			$item destroy
369
		}
370
371
		#Destroy the container frame
3859 by airadier
Working in new preferences
372
		if [winfo exists $itemPath.f] {
373
			destroy $itemPath.f
374
		}
375
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
376
	}
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
377
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
378
	#########################
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
379
	#Static options (creation time)
380
	#########################
381
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
382
	#Text for the item label
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
383
	option -text -readonly yes -default ""
384
	#Icon for the frame
385
	option -icon -readonly yes -default ""
386
	#Options for packing the frame
387
	option -expand -readonly yes -default true
388
	option -fill -readonly yes -default x
389
390
	#########################
391
	#Dinamic options
392
	#########################
393
	option -enabled -default true
3859 by airadier
Working in new preferences
394
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
395
	#Add a new PreferenceItem to the group
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
396
	method addItem {item} {
397
		lappend items $item
398
	}
399
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
400
	#Triggered when the -enabled option is changed
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
401
	onconfigure -enabled { val } {
402
		set options(-enabled) $val
403
		$preferenceitem configure -enabled $val
4110 by airadier
Working in preferences window
404
		#Now tell all the children to enable themshelves
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
405
		set num 0
406
		foreach item $items {
407
			$item configure -enabled $val
408
		}
409
	}
410
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
411
412
	#Create the label frame and icon, and tell all children items to draw themshelves
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
413
	method draw { path } {
414
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
415
		#Store the path for later usage
3859 by airadier
Working in new preferences
416
		set itemPath $path
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
417
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
418
		#Create and pack the labelframe
3859 by airadier
Working in new preferences
419
		set f [labelframe $path.f -text $options(-text) -font splainf]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
420
		pack $path.f -side top -fill x
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
421
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
422
		#If there is an icon, draw it
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
423
		if { $options(-icon) != "" } {
424
			frame $f.f
425
			label $f.icon -image [::skin::loadPixmap $options(-icon)]
426
			pack $f.icon -side left -padx 5 -pady 5
4114 by airadier
Working in new preferences
427
			pack $f.f -side left -fill x -expand true
3859 by airadier
Working in new preferences
428
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
429
			set f $f.f
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
430
		}
431
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
432
		#Now tell all the children to draw themshelves, and pack them
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
433
		set num 0
434
		foreach item $items {
435
			set f2 $f.f$num
436
			frame $f2
437
			$item draw $f2
438
			pack $f2 -side top -expand $options(-expand) -fill $options(-fill)
439
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
440
			incr num
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
441
		}
442
	}
443
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
444
	#Tell all children to store themselves
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
445
	method store {} {
446
		foreach item $items {
447
			$item store
448
		}
449
	}
450
451
}
452
453
#A text entry item. Child of PreferenceItem
454
#Usage:
4110 by airadier
Working in preferences window
455
# OPTIONS
456
# -text 	The text to be shown next to the text entry
457
# -width	The width of the text entry
458
# -onchange	A command that is called everytime the text entry changes to validate the input
459
# -enabled	Enables or disabled the text entry
460
# METHODS
461
::snit::type TextEntry {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
462
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
463
	#Delegate to PrferenceItem!!
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
464
	delegate method * to preferenceitem
465
	delegate option * to preferenceitem
466
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
467
	#Enable or disable the item
3859 by airadier
Working in new preferences
468
	option -enabled -default true
469
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
470
	#The widget path
3859 by airadier
Working in new preferences
471
	variable itemPath ""
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
472
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
473
	constructor {args} {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
474
		install preferenceitem using PreferenceItem %AUTO%
475
		$self configurelist $args
476
	}
477
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
478
	destructor {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
479
		#Destroy the PreferenceItem instance
3859 by airadier
Working in new preferences
480
		$preferenceitem destroy
481
		#Destroy widgets
482
		destroy $itemPath.l
483
		destroy $itemPath.t
484
	}
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
485
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
486
	#########################
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
487
	#Static options (creation time)
488
	#########################
489
	#Command to be triggered when the item changes
4110 by airadier
Working in preferences window
490
	option -onchange -readonly yes -default ""
491
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
492
	#Text for the item label
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
493
	option -text -readonly yes -default ""
494
	#With of the textfield
495
	option -width -readonly yes -default ""
496
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
497
	#########################
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
498
	#Dinamic options
499
	#########################
500
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
501
	#Triggered when the -enabled option is changed
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
502
	onconfigure -enabled { val } {
503
		set options(-enabled) $val
504
		$preferenceitem configure -enabled $val
4110 by airadier
Working in preferences window
505
		if {[winfo exists $itemPath.t]} {
506
			if { $val } {
507
				$itemPath.t configure -state normal
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
508
			} else {
4110 by airadier
Working in preferences window
509
				$itemPath.t configure -state disabled
510
			}
511
		}
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
512
	}
513
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
514
	#Draw the text box in the given path
3859 by airadier
Working in new preferences
515
	method draw { path } {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
516
3859 by airadier
Working in new preferences
517
		set itemPath $path
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
518
		#Draw an input box
519
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
520
		#Composed by a label... and...
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
521
		label $path.l -text $options(-text) -font sboldf
522
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
523
		if { $options(-enabled) } {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
524
			set state normal
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
525
		} else {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
526
			set state disabled
527
		}
528
3859 by airadier
Working in new preferences
529
		if { $options(-onchange) != "" } {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
530
			set validatecommand [list $options(-onchange) $self %s %S]
531
		} else {
532
			set validatecommand ""
533
		}
534
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
535
		#...a text entry (can have defined width or not)
3859 by airadier
Working in new preferences
536
		if { [string is integer -strict $options(-width)] } {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
537
			entry $path.t -width $options(-width) -state $state -textvariable [$self valueVar] \
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
538
				-validate all -validatecommand $validatecommand
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
539
			pack $path.t -side right -expand false -padx 5 -pady 3
540
			pack $path.l -side right -expand false -padx 5 -pady 3
541
		} else {
542
			entry $path.t -state $state -textvariable [$self valueVar] \
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
543
				-validate all -validatecommand $validatecommand
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
544
			pack $path.t -side right -expand true -fill x -padx 5 -pady 3
545
			pack $path.l -side right -expand false -padx 5 -pady 3
546
		}
547
	}
548
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
549
}
4110 by airadier
Working in preferences window
550
551
#A check box item. Child of PreferenceItem
552
#Usage:
553
# OPTIONS
554
# -text 	The text to be shown next to the check button
555
# -onchange	A command that is called everytime the check button value changes
556
# -enabled	Enables or disabled the checkbutton
557
# -onvalue	The value that the item will take when the checkbutton is checked. Defaults to 1
558
# -offvalue	The value that the item will take when the checkbutton is not checked. Defaults to 0
559
# METHODS
560
::snit::type CheckBox {
561
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
562
	#Delegate to PrferenceItem!!
4110 by airadier
Working in preferences window
563
	delegate method * to preferenceitem
564
	delegate option * to preferenceitem
565
566
	#Enable or disable the item
567
	option -enabled -default true
568
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
569
	#The widget path
4110 by airadier
Working in preferences window
570
	variable itemPath ""
571
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
572
	constructor {args} {
4110 by airadier
Working in preferences window
573
		install preferenceitem using PreferenceItem %AUTO%
574
		$self configurelist $args
575
	}
576
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
577
	destructor {
4110 by airadier
Working in preferences window
578
		#Destroy the PreferenceItem instance
579
		$preferenceitem destroy
580
		#Destroy widgets
581
		destroy $itemPath.c
582
	}
583
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
584
	#########################
4110 by airadier
Working in preferences window
585
	#Static options (creation time)
586
	#########################
587
	#Command to be triggered when the item changes
588
	option -onchange -readonly yes -default ""
589
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
590
	#Text for the item label
4110 by airadier
Working in preferences window
591
	option -text -readonly yes -default ""
592
	#ON/OFF values
593
	option -onvalue -readonly yes -default 1
594
	option -offvalue -readonly yes -default 0
595
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
596
	#########################
4110 by airadier
Working in preferences window
597
	#Dynamic options
598
	#########################
599
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
600
	#Triggered when the -enabled option is changed
4110 by airadier
Working in preferences window
601
	onconfigure -enabled { val } {
602
		set options(-enabled) $val
603
		$preferenceitem configure -enabled $val
604
		if {[winfo exists $itemPath.c]} {
605
			if { $val } {
606
				$itemPath.c configure -state normal
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
607
			} else {
4110 by airadier
Working in preferences window
608
				$itemPath.c configure -state disabled
609
			}
610
		}
611
	}
612
613
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
614
	#Draw the text box in the given path
4110 by airadier
Working in preferences window
615
	method draw { path } {
616
617
		set itemPath $path
618
		#Draw an input box
619
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
620
		if { $options(-enabled) } {
4110 by airadier
Working in preferences window
621
			set state normal
622
		} else {
623
			set state disabled
624
		}
625
626
		if { $options(-onchange) != "" } {
627
			set changecommand [list $options(-onchange) $self %s %S]
628
		} else {
629
			set changecommand ""
630
		}
631
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
632
		#...a checkbutton entry
4110 by airadier
Working in preferences window
633
		checkbutton $path.c -text $options(-text) -font sboldf -state $state -variable [$self valueVar] \
634
			-command $changecommand -onvalue $options(-onvalue) -offvalue $options(-offvalue)
635
636
		pack $path.c -side right -expand false -padx 5 -pady 3
637
	}
638
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
639
}
4110 by airadier
Working in preferences window
640
641
#A group of radio buttons. Child of PreferenceItem
4114 by airadier
Working in new preferences
642
#Usage:
643
# OPTIONS
644
# -texts	A list with one text for every checkbutton
645
# -values	A list of values corresponding to every selection. Defaults to 0, 1, 2...
646
# -onchange	A command that is called everytime the radio button value changes
647
# -enabled	Enables or disabled the radio buttons
648
# METHODS
649
::snit::type RadioGroup {
650
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
651
	#Delegate to PrferenceItem!!
4114 by airadier
Working in new preferences
652
	delegate method * to preferenceitem
653
	delegate option * to preferenceitem
654
655
	#Enable or disable the item
656
	option -enabled -default true
657
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
658
	#The widget path
4114 by airadier
Working in new preferences
659
	variable itemPath ""
660
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
661
	constructor {args} {
4114 by airadier
Working in new preferences
662
		install preferenceitem using PreferenceItem %AUTO%
663
		$self configurelist $args
664
	}
665
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
666
	destructor {
4114 by airadier
Working in new preferences
667
		#Destroy the PreferenceItem instance
668
		$preferenceitem destroy
669
		#Destroy widgets
670
		destroy $itemPath.f
671
	}
672
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
673
	#########################
4114 by airadier
Working in new preferences
674
	#Static options (creation time)
675
	#########################
676
	#Command to be triggered when the item changes
677
	option -onchange -readonly yes -default ""
678
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
679
	#Text for the item label
4114 by airadier
Working in new preferences
680
	option -texts -readonly yes -default [list]
681
	option -values -readonly yes -default [list]
682
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
683
	#########################
4114 by airadier
Working in new preferences
684
	#Dynamic options
685
	#########################
686
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
687
	#Triggered when the -enabled option is changed
4114 by airadier
Working in new preferences
688
	onconfigure -enabled { val } {
689
		set options(-enabled) $val
690
		$preferenceitem configure -enabled $val
691
		if {[winfo exists $itemPath.f]} {
692
			foreach child [winfo children $itemPath.f] {
693
				if { $val } {
694
					$child configure -state normal
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
695
				} else {
4114 by airadier
Working in new preferences
696
					$child configure -state disabled
697
				}
698
			}
699
		}
700
	}
701
702
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
703
	#Draw the text box in the given path
4114 by airadier
Working in new preferences
704
	method draw { path } {
705
706
		set itemPath $path
707
		#Draw an input box
708
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
709
		if { $options(-enabled) } {
4114 by airadier
Working in new preferences
710
			set state normal
711
		} else {
712
			set state disabled
713
		}
714
715
		if { $options(-onchange) != "" } {
716
			set changecommand [list $options(-onchange) $self %s %S]
717
		} else {
718
			set changecommand ""
719
		}
720
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
721
		frame $path.f
4114 by airadier
Working in new preferences
722
723
		set i 0
724
		foreach text $options(-texts) {
725
			radiobutton $path.f.rb$i -text $text -font sboldf -state $state -variable [$self valueVar] \
726
				-command $changecommand -value [lindex $options(-values) $i]
727
			pack $path.f.rb$i -side top -anchor nw
728
			incr i
729
		}
730
731
		pack $path.f -side left -expand false -padx 5 -pady 3
732
	}
733
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
734
}
4114 by airadier
Working in new preferences
735
736
737
#A command button. Child of PreferenceItem
4110 by airadier
Working in preferences window
738
#Usage:
739
# OPTIONS
740
# -text 	The text to be shown in the button
741
# -buttoncommand
742
#		The command that will be launched when the button is pressed. When this happens, the current item value will be appended as
743
#		a parameter to this command. The return value of the command is then stored as new item value
744
# -enabled	Enables or disabled the checkbutton
745
# METHODS
746
::snit::type CommandButton {
747
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
748
	#Delegate to PrferenceItem!!
4110 by airadier
Working in preferences window
749
	delegate method * to preferenceitem
750
	delegate option * to preferenceitem
751
752
	#The variable where the items stores its data
753
	option -buttoncommand -readonly yes -default ""
754
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
755
	#Enable or disable the item
4110 by airadier
Working in preferences window
756
	option -enabled -default true
757
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
758
	#The widget path
4110 by airadier
Working in preferences window
759
	variable itemPath ""
760
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
761
	constructor {args} {
4110 by airadier
Working in preferences window
762
		install preferenceitem using PreferenceItem %AUTO%
763
		$self configurelist $args
764
	}
765
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
766
	destructor {
4110 by airadier
Working in preferences window
767
		#Destroy the PreferenceItem instance
768
		$preferenceitem destroy
769
		#Destroy widgets
770
		destroy $itemPath.b
771
	}
772
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
773
	#########################
4110 by airadier
Working in preferences window
774
	#Static options (creation time)
775
	#########################
776
	#Text for the item label
777
	option -text -readonly yes -default ""
778
	option -align -readonly yes -default center
4114 by airadier
Working in new preferences
779
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
780
	#########################
4110 by airadier
Working in preferences window
781
	#Dynamic options
782
	#########################
783
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
784
	#Triggered when the -enabled option is changed
4110 by airadier
Working in preferences window
785
	onconfigure -enabled { val } {
786
		set options(-enabled) $val
787
		$preferenceitem configure -enabled $val
788
		if {[winfo exists $itemPath.b]} {
789
			if { $val } {
790
				$itemPath.b configure -state normal
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
791
			} else {
4110 by airadier
Working in preferences window
792
				$itemPath.b configure -state disabled
793
			}
794
		}
795
	}
796
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
797
	#Draw the button in the given path
4110 by airadier
Working in preferences window
798
	method draw { path } {
799
800
		set itemPath $path
801
		#Draw an input box
802
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
803
		if { $options(-enabled) } {
4110 by airadier
Working in preferences window
804
			set state normal
805
		} else {
806
			set state disabled
807
		}
808
809
		switch $options(-align) {
4114 by airadier
Working in new preferences
810
			left {
811
				set anchor w
812
			}
813
			right {
814
				set anchor e
815
			}
816
			default {
817
				set anchor center
818
			}
819
820
		}
821
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
822
		button $path.b -text $options(-text) -font sboldf -state $state -command [mymethod buttonPressed]
4110 by airadier
Working in preferences window
823
		pack $path.b -expand false -padx 5 -pady 3 -anchor $anchor
4114 by airadier
Working in new preferences
824
	}
4110 by airadier
Working in preferences window
825
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
826
4110 by airadier
Working in preferences window
827
	method buttonPressed {} {
828
		if { $options(-buttoncommand) != "" } {
829
			set the_command [concat $options(-buttoncommand) [list [$self getValue]]]
830
			set value [eval $the_command]
831
			$self setValue $value
832
		}
833
834
	}
835
}
836
837
3859 by airadier
Working in new preferences
838
839
#A text entry item. Child of PreferenceItem
840
#Usage:
4114 by airadier
Working in new preferences
841
# OPTIONS
842
# -text		The text that is shown in the label
843
# -align	right | left | center
844
::snit::type Label {
3859 by airadier
Working in new preferences
845
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
846
	#Delegate to PrferenceItem!!
3859 by airadier
Working in new preferences
847
	delegate method * to preferenceitem
848
	delegate option * to preferenceitem
849
850
	#The widget path
851
	variable itemPath ""
852
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
853
	constructor {args} {
3859 by airadier
Working in new preferences
854
		install preferenceitem using PreferenceItem %AUTO%
855
		$self configurelist $args
856
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
857
	}
3859 by airadier
Working in new preferences
858
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
859
	destructor {
3859 by airadier
Working in new preferences
860
		#Destroy the PreferenceItem instance
861
		$preferenceitem destroy
862
		#Destroy widgets
863
		destroy $itemPath.l
864
	}
865
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
866
	#########################
3859 by airadier
Working in new preferences
867
	#Static options (creation time)
868
	#########################
869
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
870
	#Text for the item label
3859 by airadier
Working in new preferences
871
	option -text -readonly yes -default ""
872
	option -align -readonly yes -default center
4114 by airadier
Working in new preferences
873
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
874
	#########################
3859 by airadier
Working in new preferences
875
	#Dinamic options
876
	#########################
877
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
878
	#Draw the text box in the given path
3859 by airadier
Working in new preferences
879
	method draw { path } {
880
881
		switch $options(-align) {
4114 by airadier
Working in new preferences
882
			left {
883
				set anchor w
884
			}
885
			right {
886
				set anchor e
887
			}
888
			default {
889
				set anchor center
890
			}
891
892
		}
893
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
894
4114 by airadier
Working in new preferences
895
		set itemPath $path
3859 by airadier
Working in new preferences
896
		label $path.l -text $options(-text) -font splainf
897
		pack $path.l -anchor $anchor
4114 by airadier
Working in new preferences
898
	}
3859 by airadier
Working in new preferences
899
}
900
901
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
902
::snit::widget PreferencesWindow {
903
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
904
	#Object is a children of PreferencesSection
3859 by airadier
Working in new preferences
905
	delegate method * to preferencessection
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
906
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
907
	#Window title
3859 by airadier
Working in new preferences
908
	option -title ""
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
909
	option -savecommand ""
4110 by airadier
Working in preferences window
910
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
911
	constructor {args} {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
912
		install preferencessection using PreferencesSection %AUTO%
913
		$self configurelist $args
914
	}
915
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
916
	destructor {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
917
		#Destroy the instance of the parent.
3859 by airadier
Working in new preferences
918
		#This will destroy subsections too
919
		$preferencessection destroy
920
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
921
		#Destroy the window
3859 by airadier
Working in new preferences
922
		if { [winfo exists $wname] } {
923
			destroy $wname
924
		}
925
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
926
	}
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
927
928
	#A list with section objects, one per listbox element
929
	variable sectionNames [list]
3859 by airadier
Working in new preferences
930
	variable wname ""
931
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
932
	#Show the preferences window
3859 by airadier
Working in new preferences
933
	method show { path } {
4110 by airadier
Working in preferences window
934
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
935
		#Create a window name and remember it
3859 by airadier
Working in new preferences
936
		set wname $path
4110 by airadier
Working in preferences window
937
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
938
		#Create the toplevel window
3859 by airadier
Working in new preferences
939
		toplevel $wname
4110 by airadier
Working in preferences window
940
		wm title $wname $options(-title)
941
    		bind $wname <Destroy> [list $self destroyWindow %W]
942
		bind $wname <<Escape>> [list destroy $wname]
943
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
944
		#Create the buttons
4110 by airadier
Working in preferences window
945
		set w [frame $wname.buttons]
946
		button $w.save -text [trans save] -default active -command [list $self savePressed]
947
		button $w.cancel -text [trans close] -command [list destroy $wname]
948
		pack $w.save $w.cancel -side right -padx 10 -pady 5
949
		pack $w -side bottom -fill x -expand false
950
951
		#Create the sections listbox and items area
952
		set w [frame $wname.top]
953
954
		#Create the sections listbox
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
955
		listbox $w.sections -width 15
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
956
		#Create the items frame
3859 by airadier
Working in new preferences
957
		frame $w.items
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
958
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
959
		#Do the packing
3859 by airadier
Working in new preferences
960
		pack $w.sections -side left -fill y
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
961
		pack $w.items -side right -fill both -expand true
962
		bind $w.sections <<ListboxSelect>> [list $self sectionSelected]
4110 by airadier
Working in preferences window
963
		pack $w -side top -fill both -expand true
964
965
		#Add sections to the listbox
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
966
		foreach section [$self getSectionsList] {
967
			set sectionNames [concat $sectionNames [$section insertIntoList $w.sections 0]]
968
		}
969
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
970
		wm geometry $wname 625x450
4114 by airadier
Working in new preferences
971
	}
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
972
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
973
	#Invoked when a section is selected in the listbox
3859 by airadier
Working in new preferences
974
	method sectionSelected { } {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
975
3859 by airadier
Working in new preferences
976
		#Get the section object name from the sectionNames list
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
977
		set idx [$wname.top.sections curselection]
4110 by airadier
Working in preferences window
978
		set section [lindex $sectionNames $idx]
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
979
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
980
		#Create a new frames item, destroying previous one
3859 by airadier
Working in new preferences
981
		set items "$wname.top.items.f"
4110 by airadier
Working in preferences window
982
		if {[winfo exists $items]} {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
983
			destroy $items
984
		}
985
		frame $items
986
		pack $items -anchor nw -fill both
4114 by airadier
Working in new preferences
987
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
988
		#Show the selected section
3859 by airadier
Working in new preferences
989
		$section show $items
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
990
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
991
	}
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
992
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
993
	method destroyWindow { w } {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
994
		if { $w == $wname } {
995
			destroy $self
996
		}
3859 by airadier
Working in new preferences
997
	}
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
998
4110 by airadier
Working in preferences window
999
	method savePressed { } {
1000
		if { $options(-savecommand) != "" } {
1001
			$options(-savecommand)
1002
		}
1003
1004
		$self storeItems
1005
1006
		destroy $wname
1007
	}
1008
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1009
}
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1010
1011
#A section that contains zero, one or more preference items
3859 by airadier
Working in new preferences
1012
::snit::type PreferencesSection {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1013
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1014
	#List of items in this section
3859 by airadier
Working in new preferences
1015
	variable items_list [list]
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1016
	#List of subsections
3859 by airadier
Working in new preferences
1017
	variable sections_list [list]
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1018
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1019
	option -text -readonly yes -default ""
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1020
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1021
	destructor {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1022
		#Destroy child items
3859 by airadier
Working in new preferences
1023
		foreach item $items_list {
1024
			$item destroy
1025
		}
1026
		#Destroy child sections
1027
		foreach section $sections_list {
1028
			$section destroy
1029
		}
1030
	}
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1031
1032
	method getSectionsList { } {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1033
		return $sections_list
1034
	}
1035
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1036
	method addItem { item } {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1037
		lappend items_list $item
1038
	}
1039
1040
	method addSection {section} {
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
1041
		lappend sections_list $section
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1042
	}
1043
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1044
	#Insert this section and all subsections in the given listbox.
3859 by airadier
Working in new preferences
1045
	#Retuns a list of this section and all subsections names (recursive calls)
1046
	method insertIntoList { lb level } {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1047
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1048
		#Append instance to sections list
3859 by airadier
Working in new preferences
1049
		set sectionNames $self
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1050
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1051
		#Set identation
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1052
		set ident ""
1053
		for { set idx 0 } { $idx < $level } {incr idx } {
1054
			set ident "$ident   "
1055
		}
1056
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1057
		#Add current section to the listbox
3859 by airadier
Working in new preferences
1058
		$lb insert end "$ident$options(-text)"
1059
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1060
		#Add all subsections and append the result of the function call to the sections list
3859 by airadier
Working in new preferences
1061
		foreach subsection $sections_list {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1062
			set sectionNames [concat $sectionNames [$subsection insertIntoList $lb [expr {$level + 1}]]]
1063
		}
1064
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1065
		#Return the sections list for this section and all subsections
3859 by airadier
Working in new preferences
1066
		return $sectionNames
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1067
	}
1068
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1069
	#Show the items in this section in the given path
3859 by airadier
Working in new preferences
1070
	method show { path } {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1071
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1072
		set idx 0
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1073
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1074
		foreach item $items_list {
3857 by airadier
Working on the new preferences window. Try the "test" command. Just a test, as the name says :)
1075
			set f [frame $path.f$idx]
1076
			$item draw $f
1077
			pack $f -side top -fill x
1078
			incr idx
1079
1080
		}
1081
	}
1082
1083
	method storeItems { } {
4110 by airadier
Working in preferences window
1084
		#Add all subsections and append the result of the function call to the sections list
1085
		foreach subsection $sections_list {
1086
			$subsection storeItems
1087
		}
1088
		foreach item $items_list {
1089
			$item store
1090
		}
1091
	}
1092
1093
}
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
1094
1095
1096
proc test2 {item oldval newval} {
1097
	status_log "$item: old=$oldval new=$newval\n" blue
1098
	return [string is integer $newval]
1099
}
1100
1101
proc new_preferences {} {
1102
	PreferencesWindow create .prefs
1103
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1104
	PreferencesSection create .prefs.personal
6029 by kakaroto
Fixed 2 webcam bugs, refer to bugids on SF tracker : 1493296 and 1493223
1105
	PreferencesSection create .prefs.personal.nick
1106
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1107
	.prefs.personal addItem
1108
1109
	.pref_win
1110
}
3429 by airadier
Commiting my work on new preferences... just started, but shouldn't break anything, so I'm commiting it.
1111
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1112
4110 by airadier
Working in preferences window
1113
1114
if { $initialize_amsn == 1 } {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1115
	global myconfig proxy_server proxy_port proxy_user proxy_pass rbsel rbcon pgc
2707 by airadier
Group management tab by Marc Pina Artigas.
1116
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1117
	###################### Preferences Window ###########################
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1118
	array set myconfig {}   ; # configuration backup
1119
	set proxy_server ""
1120
	set proxy_port ""
1121
	set proxy_pass ""
1122
	set proxy_user ""
1123
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1124
	set pgc 1
2707 by airadier
Group management tab by Marc Pina Artigas.
1125
}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1126
1127
proc PreferencesCopyConfig {} {
1128
	global myconfig proxy_server proxy_port
2805 by airadier
Removed an unsued "global gconfig"
1129
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1130
	array set myconfig [::config::getAll]
2805 by airadier
Removed an unsued "global gconfig"
1131
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1132
	set proxy_server ""
3119 by airadier
Fixed a problem when loading strange proxy configuration from amsn 0.92
1133
	set proxy_port ""
1134
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1135
	# Now process certain exceptions. Should be reverted
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1136
	# in the RestorePreferences procedure
1137
	catch {
3119 by airadier
Fixed a problem when loading strange proxy configuration from amsn 0.92
1138
		set proxy_data $myconfig(proxy)
1139
		set proxy_server [lindex $proxy_data 0]
1140
		set proxy_port [lindex $proxy_data 1]
1141
	}
1142
}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1143
1144
## Function that makes the group list in the preferences ##
2707 by airadier
Group management tab by Marc Pina Artigas.
1145
proc MakeGroupList { lfgroup lfcontact } {
1146
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1147
	array set groups [::abook::getContactData contactlist groups]
2707 by airadier
Group management tab by Marc Pina Artigas.
1148
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1149
	frame $lfgroup.lbgroup.fix
2879 by airadier
Fixes in preferences group management.
1150
	pack $lfgroup.lbgroup.fix -side left -anchor n -expand 1 -fill x -padx 5 -pady 5
1151
	label $lfgroup.lbgroup.fix.l -text \"[trans groups]\" -font sboldf
1152
	pack $lfgroup.lbgroup.fix.l -side top -anchor w -pady 5
1153
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1154
	frame $lfgroup.lbgroup.fix.list
2879 by airadier
Fixes in preferences group management.
1155
	## create the listbox ##
2874 by airadier
Applied Marc patch for listbox in group management (preferences window)
1156
	listbox $lfgroup.lbgroup.fix.list.lb -yscrollcommand "$lfgroup.lbgroup.fix.list.sb set"
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1157
	scrollbar $lfgroup.lbgroup.fix.list.sb -command "$lfgroup.lbgroup.fix.list.lb yview" -highlightthickness 0 \
2879 by airadier
Fixes in preferences group management.
1158
		-borderwidth 1 -elementborderwidth 2
1159
1160
	pack $lfgroup.lbgroup.fix.list.lb -side left -anchor w -pady 0 -padx 0 -expand true -fill both
1161
	pack $lfgroup.lbgroup.fix.list.sb -side left -anchor w -pady 0 -padx 0 -fill y
1162
	pack $lfgroup.lbgroup.fix.list -side top -expand true -fill both
1163
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1164
2879 by airadier
Fixes in preferences group management.
1165
	## entries ##
2874 by airadier
Applied Marc patch for listbox in group management (preferences window)
1166
	$lfgroup.lbgroup.fix.list.lb insert end "[trans nogroup]"
2879 by airadier
Fixes in preferences group management.
1167
	foreach gr [lsort [array names groups]] {
1168
		if { $groups($gr) != "Individuals" } {
2874 by airadier
Applied Marc patch for listbox in group management (preferences window)
1169
			$lfgroup.lbgroup.fix.list.lb insert end $groups($gr)
2879 by airadier
Fixes in preferences group management.
1170
		}
2707 by airadier
Group management tab by Marc Pina Artigas.
1171
	}
1172
	## make binding ##
2874 by airadier
Applied Marc patch for listbox in group management (preferences window)
1173
	bind $lfgroup.lbgroup.fix.list.lb <<ListboxSelect>> "GroupSelectedIs $lfgroup $lfcontact"
2879 by airadier
Fixes in preferences group management.
1174
}
2874 by airadier
Applied Marc patch for listbox in group management (preferences window)
1175
1176
## Function to be called when <<ListboxSelect>> event occurs to change rbsel value ##
1177
proc GroupSelectedIs { lfgroup lfcontact } {
1178
	global rbsel
1179
	if {[$lfgroup.lbgroup.fix.list.lb curselection] != "" } {
2879 by airadier
Fixes in preferences group management.
1180
		set rbsel [$lfgroup.lbgroup.fix.list.lb curselection]
1181
		#Get the rbsel-th group. Note that groups must be inserted same order
1182
		array set groups [::abook::getContactData contactlist groups]
1183
		set rbsel [lindex [lsort [array names groups]] $rbsel]
1184
		MakeContactList $lfcontact
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1185
	}
2879 by airadier
Fixes in preferences group management.
1186
}
2707 by airadier
Group management tab by Marc Pina Artigas.
1187
1188
## Function to be called after pressing delete/rename/add group button ##
1189
proc RefreshGroupList { lfgroup lfcontact } {
1190
	global pgc pgcd
1191
	if { $pgc == 1 } {
1192
		vwait pgc
1193
	}
1194
	set pgc 1
1195
	destroy $lfgroup.lbgroup.fix
1196
	MakeGroupList $lfgroup $lfcontact
1197
}
1198
1199
## Function to be called when a group is selected ##
1200
proc MakeContactList { lfcontact } {
1201
	global rbsel rbcon
1202
	catch {DeleteContactList $lfcontact}
2879 by airadier
Fixes in preferences group management.
1203
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1204
	if {![info exists rbsel]} { return; }
2899 by airadier
A bug fix by Marc in group management.
1205
	if { ![::groups::Exists [::groups::GetName $rbsel]] || $rbsel == 0 } {
2874 by airadier
Applied Marc patch for listbox in group management (preferences window)
1206
		if { $rbsel == 0 } {
1207
			## fix the name of the group ##
1208
			label $lfcontact.lbcontact.fix.l -text "[trans nogroup]" -font sboldf
1209
			pack $lfcontact.lbcontact.fix.l -side top -pady 5 -padx 5  -anchor w
2879 by airadier
Fixes in preferences group management.
1210
			frame $lfcontact.lbcontact.fix.list
1211
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1212
			## create the listbox ##
2874 by airadier
Applied Marc patch for listbox in group management (preferences window)
1213
			listbox $lfcontact.lbcontact.fix.list.lb -yscrollcommand "$lfcontact.lbcontact.fix.list.sb set"
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1214
			scrollbar $lfcontact.lbcontact.fix.list.sb -command "$lfcontact.lbcontact.fix.list.lb yview" -highlightthickness 0 \
2886 by airadier
Fixed bug with scrollbar in preferences window, group management.
1215
				-borderwidth 1 -elementborderwidth 2
2879 by airadier
Fixes in preferences group management.
1216
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1217
			pack $lfcontact.lbcontact.fix.list.lb -side left -anchor w -expand true -fill both
2879 by airadier
Fixes in preferences group management.
1218
			pack $lfcontact.lbcontact.fix.list.sb -side left -anchor w -fill y
1219
			pack $lfcontact.lbcontact.fix.list -side top -anchor w -pady 5 -padx 5 -expand true -fill both
1220
			## list contacts that don't have a group ##
2707 by airadier
Group management tab by Marc Pina Artigas.
1221
			set contacts [::MSN::getList FL]
1222
			set contacts [concat $contacts [::MSN::getList EL]]
8256 by kakaroto
ok.. huge commit.. hopefully I broke nothing : non-IM contacts (hotmail addressbook) are now supported! have fun with those :p
1223
			set i 0
2707 by airadier
Group management tab by Marc Pina Artigas.
1224
			while { $i < [llength $contacts] } {
1225
				set contact [lindex $contacts $i]
2874 by airadier
Applied Marc patch for listbox in group management (preferences window)
1226
				set g [::abook::getGroups $contact]
1227
				if { [lindex $g 0] == 0 } {
2707 by airadier
Group management tab by Marc Pina Artigas.
1228
					$lfcontact.lbcontact.fix.list.lb insert end $contact
2879 by airadier
Fixes in preferences group management.
1229
				}
2707 by airadier
Group management tab by Marc Pina Artigas.
1230
				incr i
1231
			}
1232
		## make the binding ##
2874 by airadier
Applied Marc patch for listbox in group management (preferences window)
1233
		bind $lfcontact.lbcontact.fix.list.lb <<ListboxSelect>> "ContactSelectedIs $lfcontact"
2879 by airadier
Fixes in preferences group management.
1234
		}
2885 by airadier
Bug fixes and improvements by Marc to the group management
1235
	} else {
2879 by airadier
Fixes in preferences group management.
1236
		label $lfcontact.lbcontact.fix.l -text "[::groups::GetName $rbsel]" -font sboldf
1237
		pack $lfcontact.lbcontact.fix.l -side top -pady 5 -padx 5 -anchor w
1238
		frame $lfcontact.lbcontact.fix.list
1239
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1240
		## create the listbox ##
2879 by airadier
Fixes in preferences group management.
1241
		listbox $lfcontact.lbcontact.fix.list.lb -yscrollcommand "$lfcontact.lbcontact.fix.list.sb set"
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1242
		scrollbar $lfcontact.lbcontact.fix.list.sb -command "$lfcontact.lbcontact.fix.list.lb yview" -highlightthickness 0 \
2886 by airadier
Fixed bug with scrollbar in preferences window, group management.
1243
			-borderwidth 1 -elementborderwidth 2
2879 by airadier
Fixes in preferences group management.
1244
1245
		pack $lfcontact.lbcontact.fix.list.lb -side left -anchor w -expand true -fill both
1246
		pack $lfcontact.lbcontact.fix.list.sb -side left -anchor w -fill y
1247
		pack $lfcontact.lbcontact.fix.list -side top -anchor w -pady 5 -padx 5 -expand true -fill both
1248
1249
		set groups [::abook::getContactData contactlist groups]
1250
		set contacts [::MSN::getList FL]
1251
		set contacts [concat $contacts [::MSN::getList EL]]
8256 by kakaroto
ok.. huge commit.. hopefully I broke nothing : non-IM contacts (hotmail addressbook) are now supported! have fun with those :p
1252
		set i 0
2879 by airadier
Fixes in preferences group management.
1253
		while { $i < [llength $contacts] } {
1254
			set contact [lindex $contacts $i]
1255
			set group [::abook::getGroups $contact]
1256
			set j 0
1257
			while { $j < [llength $group] } {
1258
				set g [lindex $group $j]
1259
				if { $g == $rbsel } {
1260
					$lfcontact.lbcontact.fix.list.lb insert end $contact
1261
				}
1262
				incr j
1263
			}
2707 by airadier
Group management tab by Marc Pina Artigas.
1264
			incr i
2879 by airadier
Fixes in preferences group management.
1265
		}
2707 by airadier
Group management tab by Marc Pina Artigas.
1266
		## make the binding ##
2879 by airadier
Fixes in preferences group management.
1267
		bind $lfcontact.lbcontact.fix.list.lb <<ListboxSelect>> "ContactSelectedIs $lfcontact"
1268
	}
2707 by airadier
Group management tab by Marc Pina Artigas.
1269
}
2874 by airadier
Applied Marc patch for listbox in group management (preferences window)
1270
1271
## Function to be called when <<ListboxSelect>> event occurs to change rbsel value ##
1272
proc ContactSelectedIs { lfcontact } {
1273
	global rbcon
1274
	if {[$lfcontact.lbcontact.fix.list.lb curselection] != "" } {
2879 by airadier
Fixes in preferences group management.
1275
		set rbcon [$lfcontact.lbcontact.fix.list.lb get [$lfcontact.lbcontact.fix.list.lb curselection]]
1276
	} else {
1277
		set rbcon ""
1278
	}
1279
}
2707 by airadier
Group management tab by Marc Pina Artigas.
1280
1281
## Function to be called when the selected group becomes unvalid ##
1282
proc DeleteContactList { lfcontact } {
1283
	destroy $lfcontact.lbcontact.fix
1284
	frame $lfcontact.lbcontact.fix
1285
	pack $lfcontact.lbcontact.fix -side left -anchor n -expand 1 -fill x
1286
}
1287
1288
## Function to be called when the selected group is deleted/renamed or a contact deleted/moved/copied/added ##
1289
proc RefreshContactList { lfcontact } {
1290
	global pcc
1291
	if { $pcc == 1 } {
1292
		vwait pcc
1293
	}
1294
	set pcc 1
1295
	DeleteContactList $lfcontact
1296
	MakeContactList $lfcontact
1297
}
1298
1299
proc dlgMoveUser {} {
1300
	global rbcon rbsel gsel pcc
1301
	if {![info exists rbcon]} {return;}
2885 by airadier
Bug fixes and improvements by Marc to the group management
1302
	if {![info exists rbsel]} {return;}
1303
	## check if window exists ##
2707 by airadier
Group management tab by Marc Pina Artigas.
1304
	if { [winfo exists .dlgmu] } {
1305
		set pcc 0
1306
		return 0
1307
	}
1308
	## if no contact is selected -- return ##
1309
	if { $rbcon == "" } {
1310
		set pcc 0
1311
		return 0
1312
	}
1313
	## calculate oldgid - now we get the first group int the group list - we have to improve it ##
1314
	set oldgid [::abook::getGroups $rbcon]
1315
	set oldgid [lindex $oldgid 0]
1316
	## variable for the selected group -- we set to oldgid to avoid bugs ##
1317
	set gsel $oldgid
1318
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1319
	set bgcol2 #ABC8D2
2707 by airadier
Group management tab by Marc Pina Artigas.
1320
	toplevel .dlgmu -highlightcolor $bgcol2
1321
	wm title .dlgmu "[trans moveuser]"
1322
	## radiobuttons for newgid ##
1323
	frame .dlgmu.d
1324
	array set groups [::abook::getContactData contactlist groups]
1325
	foreach gr [array names groups] {
1326
		if { $groups($gr) != "Individuals" } {
1327
			radiobutton .dlgmu.d.$gr -text "$groups($gr)" -value $gr -variable gsel
1328
			pack .dlgmu.d.$gr -side left
1329
		}
1330
	}
1331
	pack .dlgmu.d -side top -pady 3 -padx 5
1332
	## button options ##
1333
	frame .dlgmu.b
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1334
	button .dlgmu.b.ok -text "[trans ok]"  -font sboldf \
2707 by airadier
Group management tab by Marc Pina Artigas.
1335
		-command " if {![info exists gsel]} {return;}; \
2885 by airadier
Bug fixes and improvements by Marc to the group management
1336
			::MSN::moveUser \$rbcon $oldgid \$gsel; \
1337
			unset gsel; \
1338
			destroy .dlgmu; "
2707 by airadier
Group management tab by Marc Pina Artigas.
1339
	button .dlgmu.b.cancel -text "[trans cancel]"  -font sboldf \
1340
		-command "destroy .dlgmu; set pcc 0;"
1341
	pack .dlgmu.b.ok .dlgmu.b.cancel -side right -padx 5
1342
	pack .dlgmu.b  -side top -anchor e -pady 3
1343
}
1344
1345
proc dlgCopyUser {} {
1346
	global rbcon rbsel gsel pcc
1347
	if {![info exists rbcon]} {return;}
2885 by airadier
Bug fixes and improvements by Marc to the group management
1348
	if {![info exists rbsel]} {return;}
1349
	if { [winfo exists .dlgcu] } {
2707 by airadier
Group management tab by Marc Pina Artigas.
1350
		set pcc 0
1351
		return 0
1352
	}
1353
	## if no contact is selected -- return ##
1354
	if { $rbcon == "" } {
1355
		set pcc 0
1356
		return 0
1357
	}
1358
	## calculate oldgid - now we get the first group int the group list - we have to improve it ##
1359
	set oldgid [::abook::getGroups $rbcon]
1360
	set oldgid [lindex $oldgid 0]
1361
	## protection --> the contacts who are in 'nogroup' will be moved, not copied ##
1362
	set move 0
1363
	if { $oldgid == 0 } {
1364
		set move 1
1365
	}
1366
	## variable for the selected group -- we set to oldgid to avoid bugs ##
1367
	set gsel $oldgid
1368
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1369
	set bgcol2 #ABC8D2
2707 by airadier
Group management tab by Marc Pina Artigas.
1370
	toplevel .dlgcu -highlightcolor $bgcol2
1371
	wm title .dlgcu "[trans moveuser]"
1372
	## radiobuttons for newgid ##
1373
	frame .dlgcu.d
1374
	array set groups [::abook::getContactData contactlist groups]
1375
	foreach gr [array names groups] {
1376
		if { $groups($gr) != "Individuals" } {
1377
			radiobutton .dlgcu.d.$gr -text "$groups($gr)" -value $gr -variable gsel
1378
			pack .dlgcu.d.$gr -side left
1379
		}
1380
	}
1381
	pack .dlgcu.d -side top -pady 3 -padx 5
1382
	## button options ##
1383
	frame .dlgcu.b
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1384
	if { $move == 0 } {
2707 by airadier
Group management tab by Marc Pina Artigas.
1385
		button .dlgcu.b.ok -text "[trans ok]"  -font sboldf \
1386
			-command " if {![info exists gsel]} {return;}; \
2885 by airadier
Bug fixes and improvements by Marc to the group management
1387
				::MSN::copyUser \$rbcon \$gsel; \
1388
				unset gsel; \
1389
				destroy .dlgcu; "
2707 by airadier
Group management tab by Marc Pina Artigas.
1390
	}
1391
	if { $move == 1 } {
1392
		button .dlgcu.b.ok -text "[trans ok]" -font sboldf \
1393
			-command " if {![info exists gsel]} {return;}; \
2885 by airadier
Bug fixes and improvements by Marc to the group management
1394
				::MSN::moveUser \$rbcon $oldgid \$gsel; \
1395
				unset gsel; \
1396
				destroy .dlgcu; "
2707 by airadier
Group management tab by Marc Pina Artigas.
1397
	}
1398
	button .dlgcu.b.cancel -text "[trans cancel]"  -font sboldf \
1399
		-command "destroy .dlgcu; set pcc 0;"
1400
	pack .dlgcu.b.ok .dlgcu.b.cancel -side right -padx 5
1401
	pack .dlgcu.b  -side top -anchor e -pady 3
1402
}
1403
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1404
proc connection_check { lfname } {
6423 by lephilousophe
THe conn test will be less buggy...
1405
	$lfname.1.ftport.bttest configure -state disabled
8104 by tjikkun
firewall checker can be moved to it's own ip-address now, if we go that road we can make sure it does not interfere with the website viewers, we could also build or own server component, or use lighttpd or whatever. It also doesn't look at the http reply body, it looks at the connection that is being established by the server
1406
	$lfname.1.ftport.test configure -text [trans connecting]
6423 by lephilousophe
THe conn test will be less buggy...
1407
	::abook::getIPConfig
6438 by lephilousophe
Retest the connection when saving prefs
1408
	if {[winfo exists $lfname]} {
7499 by lephilousophe
Avoid a bug when closing prefs with connection check running...
1409
		if { [::abook::getDemographicField conntype] == "" } {
1410
			$lfname.1.listening configure -text "[trans connectfirst]" -fg [::skin::getKey extrastderrcolor]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1411
			$lfname.1.ftport.test configure -text "[trans connectfirst]" -fg [::skin::getKey extrastderrcolor]
1412
		} else {
7059 by kakaroto
Removed bug with the connectivity checked when we click 'test port' before connecting to msn..
1413
			if { [::abook::getDemographicField listening] == "false"} {
7499 by lephilousophe
Avoid a bug when closing prefs with connection check running...
1414
				$lfname.1.listening configure -text "[trans firewalled]" -fg [::skin::getKey extrastderrcolor]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1415
				$lfname.1.ftport.test configure -text "[trans firewalled]" -fg [::skin::getKey extrastderrcolor]
1416
			} else {
7499 by lephilousophe
Avoid a bug when closing prefs with connection check running...
1417
				$lfname.1.listening configure -text "[trans portswellconfigured]" -fg [::skin::getKey extrastdokcolor]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1418
				$lfname.1.ftport.test configure -text "[trans ok]" -fg [::skin::getKey extrastdokcolor]
1419
			}
7499 by lephilousophe
Avoid a bug when closing prefs with connection check running...
1420
		}
7059 by kakaroto
Removed bug with the connectivity checked when we click 'test port' before connecting to msn..
1421
		$lfname.1.ftport.bttest configure -state normal
8104 by tjikkun
firewall checker can be moved to it's own ip-address now, if we go that road we can make sure it does not interfere with the website viewers, we could also build or own server component, or use lighttpd or whatever. It also doesn't look at the http reply body, it looks at the connection that is being established by the server
1422
	}
6423 by lephilousophe
THe conn test will be less buggy...
1423
7059 by kakaroto
Removed bug with the connectivity checked when we click 'test port' before connecting to msn..
1424
}
6423 by lephilousophe
THe conn test will be less buggy...
1425
1426
# hide an option from the advanced preferences pane
8027 by dpcris85
Advanced preferences search box
1427
proc hide_option { w {w_exp ""} } {
1428
	if {!([catch {pack info $w}])} {
1429
		pack forget $w
1430
	}
1431
	if {$w_exp != "" && !([catch {pack info $w_exp}])} {
1432
		pack forget $w_exp
1433
	}
1434
}
1435
1436
# show an option from the advanced preferences pane
1437
proc show_option { w name oldw {w_exp ""}} {
1438
	if {$w_exp != "" && [catch {pack info $w_exp}]} {
1439
		if {$oldw != ""} {
1440
			pack $w_exp -anchor w -padx 15 -before $oldw
1441
		} else {
1442
			pack $w_exp -anchor w -padx 15
1443
		}
1444
		set oldw $w_exp
1445
	}
1446
	if {[catch {pack info $w}]} {
1447
		set command [list pack $w]
1448
		# pack options courtesy of advanced_options_reload procedure
8236 by kakaroto
rename reload_advanced_options to advanced_options_reload.. makes it easier for autocompleting reload_files while debugging
1449
		switch -glob $name {
8027 by dpcris85
Advanced preferences search box
1450
			[0-9]* {
1451
				lappend command -side top -padx 0 -fill x
1452
			}
1453
			cb* {
1454
				lappend command -anchor w
1455
			}
1456
			le* -
1457
			fr* {
1458
				lappend command -anchor w -expand true -fill x
1459
			}
1460
			sp* {
1461
				lappend command -anchor w -side top -anchor w -pady 4
1462
			}
1463
			l* {
1464
				lappend command -anchor w -side top -anchor w -pady 4
1465
			}
1466
			default {
1467
				return
1468
			}
1469
		}
1470
		# oldw is the option *below* the current one
1471
		if {$oldw != ""} {
1472
			lappend command -before $oldw
1473
		}
1474
		eval $command
1475
	}
1476
}
1477
1478
proc filter_prefs { frm str action } {
1479
	# action = -1 -> search box focused (do nothing)
1480
	if {$action == -1} { return 1 }
1481
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1482
	set optionlist [winfo children $frm]
8027 by dpcris85
Advanced preferences search box
1483
	set oldoption ""
1484
	# isempty means "there are no options visible below the current one"
1485
	# as we go through the options from bottom to top, it's initialized to 1
1486
	set isempty 1
1487
	# isglobalempty means "the frame is completely empty"
1488
	set isglobalempty 1
1489
	# cycles through the list in reverse order
1490
	set l [llength $optionlist]
1491
	for {set i $l} {$i >= 0} {incr i -1} {
1492
		set option [lindex $optionlist $i]
1493
		set option_exp ""
1494
		set text ""
1495
		set name [regexp -inline -- (?:cb|exp|le|fr|l|sp)?\[0-9\]+$ $option]
1496
		switch -glob $name {
1497
			[0-9]* {
1498
				# workaround for the date delimitators option
1499
				catch {set text [$option.delimiters cget -text]}
1500
			}
1501
			cb* {
1502
				catch {set text [$option cget -text]}
1503
			}
1504
			exp* {
1505
				continue
1506
			}
1507
			le* {
1508
				catch {set text [$option.lbl cget -text]}
1509
			}
1510
			fr* {
1511
				catch {set text [$option.le.lbl cget -text]}
1512
			}
1513
			l* {
1514
				if {$isempty} {
1515
					# hide the title if there are no options below it
1516
					hide_option $option
1517
				} else {
1518
					show_option $option $name $oldoption
1519
					set oldoption $option
1520
				}
1521
				continue
1522
			}
1523
			sp* {
1524
				if {$isempty} {
1525
					hide_option $option
1526
				} else {
1527
					show_option $option $name $oldoption
1528
					set oldoption $option
1529
					# here begins a new section, so isempty is initialized
1530
					set isempty 1
1531
				}
1532
				continue
1533
			}
1534
			default {
1535
				set oldoption $option
1536
				continue
1537
			}
1538
		}
1539
		set j [regsub -all \[^0-9\] $name ""]
1540
		set option_exp [regsub $name\$ $option exp$j]
1541
		if {[winfo exists $option_exp]} {
1542
			set text [join [list $text " " [$option_exp cget -text]]]
1543
		} else {
1544
			set option_exp ""
1545
		}
1546
		if {$text != ""} {
1547
			if {$str == "" || [string first [string tolower $str] [string tolower $text]] != -1} {
1548
				show_option $option $name $oldoption $option_exp
1549
				set oldoption $option
1550
				if {$isglobalempty} {
1551
					set isglobalempty 0
1552
				}
1553
				if {$isempty} {
1554
					set isempty 0
1555
				}
1556
			} else {
1557
				hide_option $option $option_exp
1558
			}
1559
		}
1560
	}
1561
	# hide leading space
1562
	if {[regexp -- sp\[0-9\]+$ $oldoption]} {
1563
		hide_option $oldoption
1564
	}
1565
	# if the frame is empty, add a spacer to avoid the scrollbar bug
1566
	# the name of the spacer MUST NOT begin with "sp" or it will be handled
1567
	# as a normal spacer
1568
	if {$isglobalempty} {
1569
		catch {label $frm.bugfix_spacer -font bboldf}
1570
		pack $frm.bugfix_spacer -side top -anchor w -pady 4
1571
	} else {
1572
		destroy $frm.bugfix_spacer
1573
	}
1574
	return 1
1575
}
1576
1577
proc Preferences { { settings "personal"} } {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1578
	global myconfig proxy_server proxy_port temp_BLP list_BLP Preftabs libtls proxy_user proxy_pass rbsel rbcon pager
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1579
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1580
	set temp_BLP $list_BLP
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1581
	::config::setKey libtls_temp $libtls
1582
	set pager "N"
1583
	if {[ winfo exists .cfg ]} {
1584
		raise .cfg
1585
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1586
		# This should raise the settings tab depending on the arg..
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1587
		catch {.cfg.notebook.nn raise $settings}
1588
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1589
		return
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1590
	}
1591
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1592
	PreferencesCopyConfig	;# Load current configuration
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1593
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1594
	toplevel .cfg
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1595
	wm state .cfg withdraw
1596
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1597
	if { [LoginList exists 0 [::config::getKey login]] == 1 } {
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1598
		wm title .cfg "[trans preferences] - [trans profiledconfig] - [::config::getKey login]"
1599
	} else {
1600
		wm title .cfg "[trans preferences] - [trans defaultconfig] - [::config::getKey login]"
1601
	}
1602
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1603
	wm iconname .cfg [trans preferences]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1604
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1605
	# Frame to hold the preferences tabs/notebook
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1606
	frame .cfg.notebook
1607
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1608
	#set nb .cfg.notebook.nn
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1609
	set nb .cfg.notebook
1610
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1611
	# Preferences Notebook
1612
	# Modified Rnotebook to translate automaticly those keys in -tabs {}
1613
	#Rnotebook:create $nb -tabs {personal appearance session privacy loging connection others advanced} -borderwidth 2
2228 by airadier
Moved preferences to use BWidget NoteBook.
1614
	    #set Preftabs(personal) 1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1615
        #set Preftabs(appearance) 2
2228 by airadier
Moved preferences to use BWidget NoteBook.
1616
        #set Preftabs(session) 3
1617
        #set Preftabs(privacy) 4
1618
        #set Preftabs(loging) 5
1619
        ##BLOCKING
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1620
	#set Preftabs(blocking) 6
1621
        #set Preftabs(connection) 6
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1622
        #set Preftabs(others) 7
1623
        #set Preftabs(advanced) 8
1624
	NoteBook $nb.nn
2228 by airadier
Moved preferences to use BWidget NoteBook.
1625
	$nb.nn insert end personal -text [trans personal]
1626
	$nb.nn insert end appearance -text [trans appearance]
1627
	$nb.nn insert end session -text [trans session]
1628
	$nb.nn insert end groups -text [trans groups]
2707 by airadier
Group management tab by Marc Pina Artigas.
1629
	$nb.nn insert end privacy -text [trans privacy]
2228 by airadier
Moved preferences to use BWidget NoteBook.
1630
	$nb.nn insert end loging -text [trans loging]
1631
	$nb.nn insert end connection -text [trans connection]
1632
	$nb.nn insert end others -text [trans others]
1633
	$nb.nn insert end advanced -text [trans advanced]
1634
2237 by airadier
Some fixes in preferences window (but not yet finished)
1635
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1636
	#  .----------.
1637
	# _| Personal |________________________________________________
1638
	::skin::setPixmap prefpers prefpers.gif
2611 by germinator2000
Now use ::skins::setPixmap instead of image create photo, to change skin fast
1639
	::skin::setPixmap prefprofile prefprofile.gif
1640
	::skin::setPixmap preflocale globe.png
8416 by baaazen
improved locale-selector and locale-autodetection
1641
	::skin::setPixmap preffont preffont.gif
2611 by germinator2000
Now use ::skins::setPixmap instead of image create photo, to change skin fast
1642
	::skin::setPixmap prefphone prefphone.gif
1643
	#set frm [Rnotebook:frame $nb $Preftabs(personal)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
1644
	set frm [$nb.nn getframe personal]
1645
	#Scrollable frame that will contain options
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1646
	ScrolledWindow $frm.sw
2238 by airadier
Damn! forgot to remove some testing things...
1647
	ScrollableFrame $frm.sw.sf -constrainedwidth 1
2278 by airadier
Fixed preferences and user properties window size.
1648
	$frm.sw setwidget $frm.sw.sf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1649
	pack $frm.sw -anchor n -side top -expand true -fill both
1650
	set frm [$frm.sw.sf getframe]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1651
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1652
	## Nickname Selection Entry Frame ##
1653
	set lfname [labelframe $frm.lfname -text [trans prefname] -font splainf]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
1654
	pack $frm.lfname -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1655
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1656
	label $lfname.pname -image [::skin::loadPixmap prefpers]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
1657
	pack $lfname.pname -anchor nw -side left
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1658
1659
	frame $lfname.1
1660
	frame $lfname.1.name
1661
1662
	label $lfname.1.name.label -text "[trans enternick] :" -font sboldf -padx 10
2315 by kakaroto
added P4C support
1663
	entry $lfname.1.name.entry -font splainf -width 45
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1664
	frame $lfname.1.psm
8599 by billiob
add menu entries to change psm + an entry in prefs
1665
	label $lfname.1.psm.label -text "[trans psm] :" -font sboldf -padx 10
1666
	entry $lfname.1.psm.entry -font splainf -width 45
1667
	frame $lfname.1.p4c
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1668
	label $lfname.1.p4c.label -text "[trans friendlyname] :" -font sboldf -padx 10
2315 by kakaroto
added P4C support
1669
	entry $lfname.1.p4c.entry -font splainf -width 45
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1670
	frame $lfname.1.ep
8211 by kakaroto
Adding UI for the mpop.. you can now see in the top CL where you are connected and you can change the location name from the preferences, and you can sign out from each individual one or all of them...
1671
	label $lfname.1.ep.label -text "[trans renamelocation] :" -font sboldf -padx 10
1672
	entry $lfname.1.ep.entry -font splainf -width 45
1673
	pack $lfname.1 -side top -padx 0 -pady 3 -expand 1 -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1674
	pack $lfname.1.name.label $lfname.1.name.entry -side left
2315 by kakaroto
added P4C support
1675
	pack $lfname.1.psm.label $lfname.1.psm.entry -side left
8599 by billiob
add menu entries to change psm + an entry in prefs
1676
	pack $lfname.1.p4c.label $lfname.1.p4c.entry -side left
2315 by kakaroto
added P4C support
1677
	pack $lfname.1.ep.label $lfname.1.ep.entry -side left
8211 by kakaroto
Adding UI for the mpop.. you can now see in the top CL where you are connected and you can change the location name from the preferences, and you can sign out from each individual one or all of them...
1678
	if {[::config::getKey protocol] >= 11} {
8599 by billiob
add menu entries to change psm + an entry in prefs
1679
		if {[::config::getKey protocol] >= 18} {
8960 by kakaroto
change protocol 16 to 18, use MSNP18, fix differences between P16 and P18.. autojoin all our endpoints to a convo and add the ClientType in the UUX data
1680
			pack $lfname.1.name $lfname.1.psm $lfname.1.p4c $lfname.1.ep -side top -anchor nw
8599 by billiob
add menu entries to change psm + an entry in prefs
1681
		} else {
1682
			pack $lfname.1.name $lfname.1.psm $lfname.1.p4c -side top -anchor nw
1683
		}
1684
	} else {
8211 by kakaroto
Adding UI for the mpop.. you can now see in the top CL where you are connected and you can change the location name from the preferences, and you can sign out from each individual one or all of them...
1685
		pack $lfname.1.name $lfname.1.p4c -side top -anchor nw
1686
	}
1687
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1688
	## Public Profile Frame ##
1689
	set lfname [labelframe $frm.lfname2 -text [trans prefprofile] -font splainf]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1690
	pack $frm.lfname2 -anchor n -side top -expand 1 -fill x
5315 by germinator2000
Almost 2 years ago (YES!!!) I added # to hide some code in preferences.tcl, it was a button for "Edit my profile" but at that time it was disabled because nobody knew how to link to this page and everybody was too lazy. 2 years later, a gird named Vivia decided to add the feature "edit my profile" in aMSN! WOW! So now I can remove the #comments in preferences and we can use that button...FINALLY!
1691
	label $lfname.pprofile -image [::skin::loadPixmap prefprofile]
1692
	label $lfname.lprofile -text [trans prefprofile2] -padx 10
1693
	button $lfname.bprofile -text [trans editprofile] -command "::hotmail::hotmail_profile"
5328 by kakaroto
All urls are now retreived using the URL command to the NS
1694
	pack $lfname.pprofile $lfname.lprofile -side left
5315 by germinator2000
Almost 2 years ago (YES!!!) I added # to hide some code in preferences.tcl, it was a button for "Edit my profile" but at that time it was disabled because nobody knew how to link to this page and everybody was too lazy. 2 years later, a gird named Vivia decided to add the feature "edit my profile" in aMSN! WOW! So now I can remove the #comments in preferences and we can use that button...FINALLY!
1695
	pack $lfname.bprofile -side right -padx 15
1696
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1697
5328 by kakaroto
All urls are now retreived using the URL command to the NS
1698
	## Internationalization Frame ##
8416 by baaazen
improved locale-selector and locale-autodetection
1699
	set lfname [labelframe $frm.lfname2a -text [trans preflocale] -font splainf]
1700
	pack $frm.lfname2a -anchor n -side top -expand 1 -fill x
1701
	label $lfname.plocale -image [::skin::loadPixmap preflocale]
1702
	label $lfname.llocale -text [trans preflocale2] -padx 10
1703
	combobox::combobox $lfname.clocale -editable true -width 20
1704
	pack $lfname.plocale $lfname.llocale -side left
1705
	pack $lfname.clocale -side right -padx 15
1706
1707
1708
	## Chat Font Frame ##
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1709
	set lfname [labelframe $frm.lfname3 -text [trans preffont] -font splainf]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1710
	pack $frm.lfname3 -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1711
	label $lfname.pfont -image [::skin::loadPixmap preffont]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
1712
	label $lfname.lfontout -text [trans preffont2]
5624 by bluetit
Can now change incoming message font. New lang key preffont4
1713
	button $lfname.bfontout -text [trans changefont] -command "change_font cfg mychatfont"
7368 by lephilousophe
Better organization for contact font managment
1714
	checkbutton $lfname.disableuserfonts -text "[trans disableuserfonts]" \
1715
		-onvalue 1 -offvalue 0 -variable [::config::getVar disableuserfonts] -command UpdatePreferences
1716
	label $lfname.lfontin -text [trans preffont4]
5624 by bluetit
Can now change incoming message font. New lang key preffont4
1717
	button $lfname.bfontin -text [trans changefont] -command "change_font cfg theirchatfont; UpdatePreferences"
7368 by lephilousophe
Better organization for contact font managment
1718
	button $lfname.bfontinreset -text [trans resetincomingfont] \
1719
		-command "::config::setKey theirchatfont {}; UpdatePreferences"
1720
1721
	pack $lfname.pfont -side left
5624 by bluetit
Can now change incoming message font. New lang key preffont4
1722
	pack $lfname.lfontout $lfname.bfontout $lfname.disableuserfonts \
7368 by lephilousophe
Better organization for contact font managment
1723
		$lfname.lfontin $lfname.bfontin $lfname.bfontinreset -anchor w -pady 3 -padx 15 -side top
1724
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1725
	## Phone Numbers Frame ##
1726
	set lfname [labelframe $frm.lfname4 -text [trans prefphone] -font splainf]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1727
	pack $frm.lfname4 -anchor n -side top -expand 1 -fill x
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1728
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1729
	frame $lfname.2
1730
	label $lfname.1.pphone -image [::skin::loadPixmap prefphone]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
1731
	pack $lfname.1.pphone -side left -anchor nw
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1732
	label $lfname.1.lphone -text [trans prefphone2] -padx 10
1733
	pack $lfname.1.lphone -fill both -side left
1734
	label $lfname.2.lphone1 -text "[trans countrycode] :" -padx 10 -font sboldf
1735
	entry $lfname.2.ephone1 -font splainf  -width 5
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1736
	label $lfname.2.lphone21 -text "[trans areacode]" -pady 3
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1737
	label $lfname.2.lphone22 -text "[trans phone]" -pady 3
1738
	label $lfname.2.lphone3 -text "[trans myhomephone] :" -padx 10 -font sboldf
1739
	entry $lfname.2.ephone31 -font splainf  -width 5
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1740
	entry $lfname.2.ephone32 -font splainf  -width 20
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1741
	label $lfname.2.lphone4 -text "[trans myworkphone] :" -padx 10 -font sboldf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1742
	entry $lfname.2.ephone41 -font splainf  -width 5
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1743
	entry $lfname.2.ephone42 -font splainf  -width 20
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1744
	label $lfname.2.lphone5 -text "[trans mymobilephone] :" -padx 10 -font sboldf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1745
	entry $lfname.2.ephone51 -font splainf  -width 5
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1746
	entry $lfname.2.ephone52 -font splainf  -width 20
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1747
	checkbutton $lfname.2.mobphone -text "[trans allow_sms]" -onvalue "Y" -offvalue "N" -variable pager
5328 by kakaroto
All urls are now retreived using the URL command to the NS
1748
	button $lfname.2.person -text "[trans change_account_info]" -command "::hotmail::hotmail_changeAccountInfo"
1749
    button $lfname.2.chgmob -text "[trans change_mobile]" -command "::hotmail::hotmail_changeMobile"
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1750
5328 by kakaroto
All urls are now retreived using the URL command to the NS
1751
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1752
	pack $lfname.1 -expand 1 -fill both -side top
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1753
	pack $lfname.2 -expand 1 -fill both -side top
1754
	grid $lfname.2.lphone1 -row 1 -column 1 -sticky w -columnspan 2
1755
	grid $lfname.2.ephone1 -row 1 -column 3 -sticky w
1756
	grid $lfname.2.lphone21 -row 2 -column 2 -sticky e
1757
	grid $lfname.2.lphone22 -row 2 -column 3 -sticky e
1758
	grid $lfname.2.lphone3 -row 3 -column 1 -sticky w
1759
	grid $lfname.2.ephone31 -row 3 -column 2 -sticky w
1760
	grid $lfname.2.ephone32 -row 3 -column 3 -sticky w
1761
	grid $lfname.2.lphone4 -row 4 -column 1 -sticky w
1762
	grid $lfname.2.ephone41 -row 4 -column 2 -sticky w
1763
	grid $lfname.2.ephone42 -row 4 -column 3 -sticky w
1764
	grid $lfname.2.lphone5 -row 5 -column 1 -sticky w
1765
	grid $lfname.2.ephone51 -row 5 -column 2 -sticky w
1766
	grid $lfname.2.ephone52 -row 5 -column 3 -sticky w
1767
    grid $lfname.2.mobphone	-row 6 -column 1 -sticky w
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1768
	grid $lfname.2.chgmob -row 7 -column 1 -sticky w
5328 by kakaroto
All urls are now retreived using the URL command to the NS
1769
	grid $lfname.2.person -row 8 -column 1 -sticky w
1770
1771
	$nb.nn compute_size
2278 by airadier
Fixed preferences and user properties window size.
1772
	[$nb.nn getframe personal].sw.sf compute_size
1773
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1774
	#  .------------.
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1775
	# _| Appearance |________________________________________________
1776
	::skin::setPixmap preflook preflook.gif
2611 by germinator2000
Now use ::skins::setPixmap instead of image create photo, to change skin fast
1777
	::skin::setPixmap prefemotic prefemotic.gif
1778
	::skin::setPixmap prefalerts prefalerts.gif
1779
	#set frm [Rnotebook:frame $nb $Preftabs(appearance)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
1780
	set frm [$nb.nn getframe appearance]
1781
	#Scrollable frame that will contain options
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1782
	ScrolledWindow $frm.sw
2238 by airadier
Damn! forgot to remove some testing things...
1783
	ScrollableFrame $frm.sw.sf -constrainedwidth 1
2278 by airadier
Fixed preferences and user properties window size.
1784
	$frm.sw setwidget $frm.sw.sf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1785
	pack $frm.sw -anchor n -side top -expand true -fill both
1786
	set frm [$frm.sw.sf getframe]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1787
1788
	## General aMSN Look Options (Encoding, BGcolor, General Font, Clock Format)
2762 by gadget_boy
-Displays "Connected" instead of lastseen in the properties windows of the contacts when they are online
1789
	set lfname [labelframe $frm.lfname -text [trans preflook]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
1790
	pack $frm.lfname -anchor n -side top -expand 0 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1791
	label $lfname.plook -image [::skin::loadPixmap preflook]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
1792
	frame $lfname.0
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1793
	frame $lfname.1
1794
#	frame $lfname.2
1795
	frame $lfname.3
1796
	frame $lfname.4
1797
	frame $lfname.5
1798
	frame $lfname.6
1799
	frame $lfname.7
8874 by vivia
Cam_in_cw compatible with singleDP. A few resizing issues remaining, will be fixed together with voip gui. Added option in preferences
1800
5470 by lephilousophe
Added an option to say where place the PSM
1801
#	button $lfname.0.skinbutton -text [trans skinselector]  -command ::skinsGUI::SelectSkin
6213 by thaven
And there it goes on trunk too.
1802
#	pack $lfname.0.skinbutton -side left
1803
5955 by scapor
quick and dirty re-adding skinnselector functionality
1804
	label $lfname.1.llook -text "[trans encoding2]" -padx 10
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1805
	button $lfname.1.bencoding -text [trans encoding] -command "show_encodingchoose"
6202 by thaven
- Merging one patch from 0.96 (removing -font options)
1806
	pack $lfname.plook -anchor nw -side left
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1807
	pack $lfname.0 $lfname.1 -side top -padx 0 -pady 0 -expand 1 -fill both
5955 by scapor
quick and dirty re-adding skinnselector functionality
1808
	pack $lfname.1.llook -side left
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1809
	pack $lfname.1.bencoding -side right -padx 15
1810
#	label $lfname.2.llook -text "[trans bgcolor]" -padx 10
2894 by airadier
Removed background option, as it's not working
1811
#	button $lfname.2.bbgcolor -text [trans choosebgcolor] -font sboldf -command "choose_theme"
1812
#	pack $lfname.2 -side top -padx 0 -pady 0 -expand 1 -fill both
1813
#	pack $lfname.2.llook -side left
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1814
#	pack $lfname.2.bbgcolor -side right -padx 15
2894 by airadier
Removed background option, as it's not working
1815
	label $lfname.3.llook -text "[trans preffont3]" -padx 10
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1816
	button $lfname.3.bfont -text [trans changefont] -command "choose_basefont"
6202 by thaven
- Merging one patch from 0.96 (removing -font options)
1817
	pack $lfname.3 -side top -padx 0 -pady 0 -expand 1 -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1818
	pack $lfname.3.llook -side left
1819
	pack $lfname.3.bfont -side right -padx 15
1820
	label $lfname.4.llook -text "[trans dateformat]" -padx 10
2762 by gadget_boy
-Displays "Connected" instead of lastseen in the properties windows of the contacts when they are online
1821
	pack $lfname.4 -side top -padx 0 -pady 0 -expand 1 -fill both
1822
	pack $lfname.4.llook -anchor w -side top -padx 10
1823
	radiobutton $lfname.4.mdy -text "[trans month]/[trans day]/[trans year]" -value MDY -variable [::config::getVar dateformat]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
1824
	radiobutton $lfname.4.dmy -text "[trans day]/[trans month]/[trans year]" -value DMY -variable [::config::getVar dateformat]
1825
	radiobutton $lfname.4.ymd -text "[trans year]/[trans month]/[trans day]" -value YMD -variable [::config::getVar dateformat]
1826
	pack $lfname.4.mdy $lfname.4.dmy $lfname.4.ymd -side left -padx 10
2762 by gadget_boy
-Displays "Connected" instead of lastseen in the properties windows of the contacts when they are online
1827
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1828
	checkbutton $lfname.5.dock -text "[trans trayicon]" -onvalue 1 -offvalue 0 -variable [::config::getVar use_tray]
9589 by kakaroto
Enable the use_tray option in preferences for mac users too
1829
	pack $lfname.5.dock -anchor w -side top -padx 10 -pady 0
1830
7310 by thaven
Systray doesn't exist on Mac, so do not show the option to activate it either. Also moved the option for DPs in CL from Emoticon area to Appearance area.
1831
	checkbutton $lfname.5.show_contactdps_in_cl -text "[trans show_contactdps_in_cl]" -onvalue 1 -offvalue 0 -variable [::config::getVar show_contactdps_in_cl]
1832
	#checkbutton $lfname.5.show_spaces -text "[trans enablespaces]" -onvalue 1 -offvalue 0 -variable [::config::getVar showspaces]
9213 by vivia
Disabled spaces support - disabled by M$
1833
	pack $lfname.5.show_contactdps_in_cl -anchor w -side top -padx 10 -pady 0
9222 by kakaroto
oups, vivia also removed dp_in_cl option
1834
7310 by thaven
Systray doesn't exist on Mac, so do not show the option to activate it either. Also moved the option for DPs in CL from Emoticon area to Appearance area.
1835
	pack $lfname.5 -side top -padx 0 -pady 10 -expand 1 -fill both
1836
4729 by scapor
Remove the tray submene, making it 1 option .. needs testing on windows
1837
	label $lfname.6.llook -text "[trans psmplace]" -padx 10
5470 by lephilousophe
Added an option to say where place the PSM
1838
	pack $lfname.6 -side top -padx 0 -pady 0 -expand 1 -fill both
1839
	pack $lfname.6.llook -anchor w -side top -padx 10
1840
	radiobutton $lfname.6.dontshow -text "[trans psmdontshow]" -value 0 -variable [::config::getVar psmplace]
1841
	radiobutton $lfname.6.atend -text "[trans psmatend]" -value 1 -variable [::config::getVar psmplace]
1842
	radiobutton $lfname.6.newline -text "[trans psmnewline]" -value 2 -variable [::config::getVar psmplace]
1843
	pack $lfname.6.dontshow $lfname.6.atend $lfname.6.newline -anchor w -side top -padx 10
1844
	checkbutton $lfname.7.cam_in_cw -text "[trans cam_in_cw]" -onvalue 1 -offvalue 0 -variable [::config::getVar cam_in_cw]
8874 by vivia
Cam_in_cw compatible with singleDP. A few resizing issues remaining, will be fixed together with voip gui. Added option in preferences
1845
	pack $lfname.7 -side top -padx 0 -pady 0 -expand 1 -fill both
1846
	pack $lfname.7.cam_in_cw -anchor w -side top -padx 10
1847
4729 by scapor
Remove the tray submene, making it 1 option .. needs testing on windows
1848
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1849
	## Emoticons Frame ##
1850
	set lfname [labelframe $frm.lfname2 -text [trans prefemotic]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
1851
	pack $frm.lfname2 -anchor n -side top -expand 0 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1852
	label $lfname.pemotic -image [::skin::loadPixmap prefemotic]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
1853
	pack $lfname.pemotic -side left -anchor nw
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1854
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1855
	pack $lfname.1 -side left -padx 0 -pady 0 -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1856
	checkbutton $lfname.1.chat -text "[trans chatsmileys2]" -onvalue 1 -offvalue 0 -variable [::config::getVar chatsmileys]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
1857
	checkbutton $lfname.1.list -text "[trans listsmileys2]" -onvalue 1 -offvalue 0 -variable [::config::getVar listsmileys]
1858
        checkbutton $lfname.1.sound -text "[trans emotisounds]" -onvalue 1 -offvalue 0 -variable [::config::getVar emotisounds]
1859
        checkbutton $lfname.1.animated -text "[trans animatedsmileys]" -onvalue 1 -offvalue 0 -variable [::config::getVar animatedsmileys] -command [list destroy .smile_selector]
2980 by airadier
Destroy smileys menu when we enable/disable animation in preferences.
1860
	checkbutton $lfname.1.customsmileys -text "[trans customsmileys]" -onvalue 1 -offvalue 0 -variable [::config::getVar customsmileys]
5833 by vivia
missing close brace :$
1861
	#checkbutton $lfname.1.log -text "[trans logsmileys]" -onvalue 1 -offvalue 0 -variable [::config::getVar logsmileys] -state disabled
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
1862
	#pack $lfname.1.chat $lfname.1.list $lfname.1.sound  $lfname.1.animated $lfname.1.log -anchor w -side top -padx 10
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1863
	pack $lfname.1.chat $lfname.1.list $lfname.1.sound  $lfname.1.animated $lfname.1.customsmileys -anchor w -side top -padx 10 -pady 0
7310 by thaven
Systray doesn't exist on Mac, so do not show the option to activate it either. Also moved the option for DPs in CL from Emoticon area to Appearance area.
1864
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1865
	## Alerts and Sounds Frame ##
1866
	set lfname [labelframe $frm.lfname3 -text [trans prefalerts]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
1867
	pack $frm.lfname3 -anchor n -side top -expand 0 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1868
	label $lfname.palerts -image [::skin::loadPixmap prefalerts]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
1869
	pack $lfname.palerts -side left -anchor nw
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1870
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1871
	checkbutton $lfname.1.alert1 -text "[trans shownotify]" -onvalue 1 -offvalue 0 -variable [::config::getVar shownotify]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
1872
	checkbutton $lfname.1.sound -text "[trans sound2]" -onvalue 1 -offvalue 0 -variable [::config::getVar sound]
1873
	pack $lfname.1 -anchor w -side top -padx 0 -pady 5 -expand 1 -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1874
	pack $lfname.1.alert1 $lfname.1.sound -anchor w -side top -padx 10 -pady 0
1875
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1876
	#Bounce icon in the dock preference for Mac OS X
2519 by germinator2000
Add preferences for bouncing icon in the dock in Mac OS Xk
1877
	if { [OnMac] } {
6174 by thaven
This one is a messy diff.... but I did it a few days ago and didn't catch any bugs yet, so I think it's quite safe to commit.
1878
		label $lfname.1.bouncedock -text "[trans bouncedock]" -padx 10
2519 by germinator2000
Add preferences for bouncing icon in the dock in Mac OS Xk
1879
		pack $lfname.1.bouncedock -anchor w -side top -padx 10
1880
		radiobutton $lfname.1.unlimited -text "[trans continuously]" -value unlimited -variable [::config::getVar dockbounce]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
1881
		radiobutton $lfname.1.once -text "[trans justonce]" -value once -variable [::config::getVar dockbounce]
1882
		radiobutton $lfname.1.never -text "[trans never]" -value never -variable [::config::getVar dockbounce]
1883
		pack $lfname.1.unlimited $lfname.1.once $lfname.1.never -side left -padx 10
2519 by germinator2000
Add preferences for bouncing icon in the dock in Mac OS Xk
1884
	}
1885
	$nb.nn compute_size
2278 by airadier
Fixed preferences and user properties window size.
1886
	[$nb.nn getframe appearance].sw.sf compute_size
1887
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1888
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1889
	#  .---------.
1890
	# _| Session |________________________________________________
1891
	::skin::setPixmap prefstatus prefstatus.gif
2611 by germinator2000
Now use ::skins::setPixmap instead of image create photo, to change skin fast
1892
	::skin::setPixmap prefaway prefaway.gif
1893
	::skin::setPixmap prefmsg prefmsg.gif
1894
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1895
	#set frm [Rnotebook:frame $nb $Preftabs(session)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
1896
	set frm [$nb.nn getframe session]
1897
	#Scrollable frame that will contain options
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1898
	ScrolledWindow $frm.sw
2238 by airadier
Damn! forgot to remove some testing things...
1899
	ScrollableFrame $frm.sw.sf -constrainedwidth 1
2278 by airadier
Fixed preferences and user properties window size.
1900
	$frm.sw setwidget $frm.sw.sf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1901
	pack $frm.sw -anchor n -side top -expand true -fill both
1902
	set frm [$frm.sw.sf getframe]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1903
1904
	## Sign In and AutoStatus Options Frame ##
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1905
	set lfname [labelframe $frm.lfname -text [trans prefsession]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
1906
	pack $frm.lfname -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1907
	label $lfname.psession -image [::skin::loadPixmap prefstatus]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
1908
	pack $lfname.psession -anchor nw -side left
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1909
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1910
	frame $lfname.2
1911
	frame $lfname.3
1912
	checkbutton $lfname.1.lautonoact -text "[trans autonoact]" -onvalue 1 -offvalue 0 -variable [::config::getVar autoidle] -command UpdatePreferences
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
1913
	entry $lfname.1.eautonoact -font splainf -width 3 -textvariable [::config::getVar idletime]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1914
	label $lfname.1.lmins -text "[trans mins]" -padx 5
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1915
	pack $lfname.1 -side top -padx 0 -expand 1 -fill both
1916
	pack $lfname.1.lautonoact $lfname.1.eautonoact $lfname.1.lmins -side left
1917
	checkbutton $lfname.2.lautoaway -text "[trans autoaway]" -onvalue 1 -offvalue 0 -variable [::config::getVar autoaway] -command UpdatePreferences
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
1918
	entry $lfname.2.eautoaway -font splainf -width 3 -textvariable [::config::getVar awaytime]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1919
	label $lfname.2.lmins -text "[trans mins]" -padx 5
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1920
	pack $lfname.2 -side top -padx 0 -expand 1 -fill both
1921
	pack $lfname.2.lautoaway $lfname.2.eautoaway $lfname.2.lmins -side left
1922
	checkbutton $lfname.3.lreconnect -text "[trans reconnect2]" -onvalue 1 -offvalue 0 -variable [::config::getVar reconnect]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
1923
	checkbutton $lfname.3.lonstart -text "[trans autoconnect2]" -onvalue 1 -offvalue 0 -variable [::config::getVar autoconnect]
1924
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1925
	if { [OnWin] } {
1926
		set ::start_on_windows_boot [WinDetectBoot]
8333 by kakaroto
Use the 'registry' extension on windows for getting, adding, setting, deleting the 'run amsn on boot' registry key.
1927
		checkbutton $lfname.3.startonboot -text "[trans startonboot]" -onvalue 1 -offvalue 0 -variable ::start_on_windows_boot
1928
	}
5127 by kakaroto
Added the auto-start option for windows users
1929
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1930
	pack $lfname.3 -side top -padx 0 -expand 1 -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1931
5127 by kakaroto
Added the auto-start option for windows users
1932
	if { [OnWin] } {
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1933
		pack $lfname.3.lreconnect $lfname.3.lonstart $lfname.3.startonboot  -anchor w -side top
6066 by tjikkun
if you remove an option you should remove its pack as well billiob
1934
	} else {
5127 by kakaroto
Added the auto-start option for windows users
1935
		pack $lfname.3.lreconnect $lfname.3.lonstart -anchor w -side top
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1936
	}
5127 by kakaroto
Added the auto-start option for windows users
1937
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1938
	## Away Messages Frame ##
1939
	set lfname [labelframe $frm.lfname2 -text [trans prefawaymsg]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
1940
	pack $frm.lfname2 -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1941
	label $lfname.psession -image [::skin::loadPixmap prefaway]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
1942
	pack $lfname.psession -anchor nw -side left
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1943
	frame $lfname.statelist -relief sunken -borderwidth 3
1944
	listbox $lfname.statelist.box -yscrollcommand "$lfname.statelist.ys set" \
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1945
		-font splainf -highlightthickness 0 -height 4
1946
	scrollbar $lfname.statelist.ys -command "$lfname.statelist.box yview" -highlightthickness 0 \
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1947
         -borderwidth 1 -elementborderwidth 2
1948
	pack $lfname.statelist.ys -side right -fill y
1949
	pack $lfname.statelist.box -side left -expand true -fill both
1950
	frame $lfname.buttons -borderwidth 0
1951
	button $lfname.buttons.add -text [trans addstate] -command "EditNewState 0" -width 20
6202 by thaven
- Merging one patch from 0.96 (removing -font options)
1952
	button $lfname.buttons.del -text [trans delete]  -command "DeleteStateListBox \[$lfname.statelist.box curselection\] $lfname.statelist.box" -width 20
1953
	button $lfname.buttons.edit -text [trans edit]  -command "EditNewState 2 \[$lfname.statelist.box curselection\]" -width 20
1954
	pack $lfname.buttons.add -side top
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1955
	pack $lfname.buttons.del -side top
1956
	pack $lfname.buttons.edit -side top
1957
	pack $lfname.statelist -anchor w -side left -padx 10 -pady 10 -expand 1 -fill both
1958
	pack $lfname.buttons -anchor w -side right -padx 10 -pady 10 -expand 1 -fill both
1959
1960
	## Messaging Interface Frame ##
1961
	set lfname [labelframe $frm.lfname3 -text [trans prefmsging]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
1962
	pack $frm.lfname3 -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1963
	label $lfname.pmsging -image [::skin::loadPixmap prefmsg]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
1964
	pack $lfname.pmsging -anchor nw -side left
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
1965
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
1966
	frame $lfname.2
1967
	frame $lfname.3
1968
	frame $lfname.4
1969
	frame $lfname.5
1970
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1971
	label $lfname.1.lchatmaxmin -text [trans chatmaxmin]
3716 by airadier
Jasper patch for preferences window layout
1972
	radiobutton $lfname.1.max -text [trans raised] -value 0 -variable [::config::getVar newchatwinstate] -padx 17
1973
	grid $lfname.1.lchatmaxmin -row 1 -column 1 -sticky w
1974
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1975
	#Don't show the minimised option on Mac OS X because that does'nt work in TkAqua
2458 by germinator2000
Disable some useless preferences (about window when we receive message) on Mac OS X
1976
	if { ![OnMac] } {
6174 by thaven
This one is a messy diff.... but I did it a few days ago and didn't catch any bugs yet, so I think it's quite safe to commit.
1977
		radiobutton $lfname.1.min -text [trans minimised] -value 1 -variable [::config::getVar newchatwinstate] -padx 17
3716 by airadier
Jasper patch for preferences window layout
1978
	}
2458 by germinator2000
Disable some useless preferences (about window when we receive message) on Mac OS X
1979
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1980
	radiobutton $lfname.1.no -text [trans dontshow] -value 2 -variable [::config::getVar newchatwinstate]  -padx 17
3716 by airadier
Jasper patch for preferences window layout
1981
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1982
	#Don't pack the minimised option on Mac OS X because that does'nt work in TkAqua
2458 by germinator2000
Disable some useless preferences (about window when we receive message) on Mac OS X
1983
	if { [OnMac] } {
6174 by thaven
This one is a messy diff.... but I did it a few days ago and didn't catch any bugs yet, so I think it's quite safe to commit.
1984
		grid $lfname.1.max -row 2 -column 1 -sticky w
3716 by airadier
Jasper patch for preferences window layout
1985
		grid $lfname.1.no -row 3 -column 1 -sticky w
3761 by germinator2000
fix preferences window on Mac OS X, fix open button feature in transfer window
1986
	} else {
2458 by germinator2000
Disable some useless preferences (about window when we receive message) on Mac OS X
1987
		grid $lfname.1.max -row 2 -column 1 -sticky w
3716 by airadier
Jasper patch for preferences window layout
1988
		grid $lfname.1.min -row 3 -column 1 -sticky w
1989
		grid $lfname.1.no -row 4 -column 1 -sticky w
1990
	}
2458 by germinator2000
Disable some useless preferences (about window when we receive message) on Mac OS X
1991
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1992
	#Don't enable this option on Mac OS X because we can't minimized window this way with TkAqua
2458 by germinator2000
Disable some useless preferences (about window when we receive message) on Mac OS X
1993
	if { ![OnMac] } {
6174 by thaven
This one is a messy diff.... but I did it a few days ago and didn't catch any bugs yet, so I think it's quite safe to commit.
1994
		label $lfname.2.lmsgmaxmin -text [trans msgmaxmin]
3716 by airadier
Jasper patch for preferences window layout
1995
		radiobutton $lfname.2.max -text [trans raised] -value 0 -variable [::config::getVar newmsgwinstate] -padx 17
1996
		radiobutton $lfname.2.min -text [trans minimised] -value 1 -variable [::config::getVar newmsgwinstate] -padx 17
1997
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
1998
		grid $lfname.2.lmsgmaxmin -row 1 -column 1 -sticky w
3716 by airadier
Jasper patch for preferences window layout
1999
		grid $lfname.2.max -row 2 -column 1 -sticky w
2000
		grid $lfname.2.min -row 3 -column 1 -sticky w
2001
	}
2458 by germinator2000
Disable some useless preferences (about window when we receive message) on Mac OS X
2002
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2003
	label $lfname.3.lmsgmode -text [trans msgmode]
2004
	radiobutton $lfname.3.nottabbed -text [trans nottabbed] -value 0 -variable [::config::getVar tabbedchat] -padx 17
3716 by airadier
Jasper patch for preferences window layout
2005
	radiobutton $lfname.3.tabbedglobal -text [trans tabbedglobal] -value 1 -variable [::config::getVar tabbedchat] -padx 17
2006
	radiobutton $lfname.3.tabbedgroups -text [trans tabbedgroups] -value 2 -variable [::config::getVar tabbedchat] -padx 17
2007
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2008
	label $lfname.4.containermode -text [trans closelabel]
4308 by germinator2000
Hostname problem: Get back to the old changes (to fix the problem a lot of people are having on CVS), fix it permanantly later
2009
	radiobutton $lfname.4.containerask -text [trans askeachtime] -value 0 -variable [::config::getVar closeChatWindowWithTabs] -padx 17
9305 by kakaroto
Fix variable name issue that made the choice of closing all tabs (or not) when the container is closed not work. Thanks to temerucar for reporting : http://www.amsn-project.net/forums/viewtopic.php?t=6779
2010
	radiobutton $lfname.4.containercloseall -text [trans closealltabs] -value 1 -variable [::config::getVar closeChatWindowWithTabs] -padx 17
2011
	radiobutton $lfname.4.containerclosetab -text [trans closeonly] -value 2 -variable [::config::getVar closeChatWindowWithTabs] -padx 17
2012
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2013
	label $lfname.5.logoutwinclosemode -text [trans logoutwincloselabel]
7557 by baaazen
asks user before logout whether to close all chatwindows or not
2014
	radiobutton $lfname.5.logoutwincloseask -text [trans askeachtime] -value 0 -variable [::config::getVar closeChatWindowsAfterLogout] -padx 17
2015
	radiobutton $lfname.5.logoutwinclosealways -text [trans always] -value 1 -variable [::config::getVar closeChatWindowsAfterLogout] -padx 17
2016
	radiobutton $lfname.5.logoutwinclosenever -text [trans never] -value 2 -variable [::config::getVar closeChatWindowsAfterLogout] -padx 17
2017
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2018
	grid $lfname.3.lmsgmode  -row 1 -column 1 -sticky w
3716 by airadier
Jasper patch for preferences window layout
2019
	grid $lfname.3.nottabbed -row 2 -column 1 -sticky w
2020
	grid $lfname.3.tabbedglobal -row 3 -column 1 -sticky w
2021
	grid $lfname.3.tabbedgroups -row 4 -column 1 -sticky w
2022
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2023
	grid $lfname.4.containermode  -row 1 -column 1 -sticky w
4308 by germinator2000
Hostname problem: Get back to the old changes (to fix the problem a lot of people are having on CVS), fix it permanantly later
2024
	grid $lfname.4.containerask -row 2 -column 1 -sticky w
2025
	grid $lfname.4.containercloseall -row 3 -column 1 -sticky w
4697 by gadget_boy
Put every radiobutton of session in the same column
2026
	grid $lfname.4.containerclosetab -row 4 -column 1 -sticky w
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2027
2028
	grid $lfname.5.logoutwinclosemode -row 1 -column 1 -sticky w
7557 by baaazen
asks user before logout whether to close all chatwindows or not
2029
	grid $lfname.5.logoutwincloseask -row 2 -column 1 -sticky w
2030
	grid $lfname.5.logoutwinclosealways -row 3 -column 1 -sticky w
2031
	grid $lfname.5.logoutwinclosenever -row 4 -column 1 -sticky w
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2032
2033
	checkbutton $lfname.winflicker -text "[trans msgflicker]" -onvalue 1 -offvalue 0 -variable [::config::getVar flicker]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2034
	checkbutton $lfname.showdisplaypic -text "[trans showdisplaypic2]" -onvalue 1 -offvalue 0 -variable [::config::getVar showdisplaypic]
2035
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2036
	pack $lfname.1 $lfname.2 $lfname.3 $lfname.4 $lfname.5 $lfname.winflicker $lfname.showdisplaypic -anchor w -side top
7557 by baaazen
asks user before logout whether to close all chatwindows or not
2037
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2038
	$nb.nn compute_size
2278 by airadier
Fixed preferences and user properties window size.
2039
	[$nb.nn getframe session].sw.sf compute_size
2040
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2041
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2042
	#  .------------------.
2707 by airadier
Group management tab by Marc Pina Artigas.
2043
	# _| Group Management |_______________________________________
2044
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2045
	::skin::setPixmap prefpersc prefpers.gif
2735 by germinator2000
Remove "image create photo" from group management and change it for ::set::pixmap to be able to change the picture when we switch skin , without restarting
2046
	::skin::setPixmap prefprofilec prefprofile.gif
2047
	::skin::setPixmap prefmobile prefmobile.gif
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2048
2049
	set frm [$nb.nn getframe groups]
2707 by airadier
Group management tab by Marc Pina Artigas.
2050
	ScrolledWindow $frm.sw
2051
	ScrollableFrame $frm.sw.sf -constrainedwidth 1
2052
	$frm.sw setwidget $frm.sw.sf
2053
	pack $frm.sw -anchor n -side top -expand true -fill both
2054
	set frm [$frm.sw.sf getframe]
2055
2056
	## Mobile group ##
3710 by netmask
Added new group "Mobile" where goes users that are offline and have
2057
	set lfmobile [labelframe $frm.lfmobile -text [trans mobilegrp1]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2058
	pack $frm.lfmobile -anchor n -side top -expand 1 -fill x
3710 by netmask
Added new group "Mobile" where goes users that are offline and have
2059
	label $lfmobile.lbmobile -image [::skin::loadPixmap prefmobile]
4802 by scapor
add 2 more pics for skinning
2060
	pack $lfmobile.lbmobile -side left -padx 5 -pady 5
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2061
	checkbutton $lfmobile.btmobile -text "[trans mobilegrp2]" -onvalue 1 -offvalue 0 \
3710 by netmask
Added new group "Mobile" where goes users that are offline and have
2062
		-variable [::config::getVar showMobileGroup]
2063
	pack $lfmobile.btmobile  -anchor w -side left -padx 0 -pady 5
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2064
3710 by netmask
Added new group "Mobile" where goes users that are offline and have
2065
	#compute_size
2707 by airadier
Group management tab by Marc Pina Artigas.
2066
	$nb.nn compute_size
2067
	[$nb.nn getframe groups].sw.sf compute_size
2068
2069
2070
	#  .--------.
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2071
	# _| Loging |________________________________________________
2072
	::skin::setPixmap prefhist prefhist.gif
2611 by germinator2000
Now use ::skins::setPixmap instead of image create photo, to change skin fast
2073
	::skin::setPixmap prefhist2 prefhist2.gif
2074
#	::skin::setPixmap prefhist3 prefhist3.gif
2075
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2076
	#set frm [Rnotebook:frame $nb $Preftabs(loging)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
2077
	set frm [$nb.nn getframe loging]
2078
	ScrolledWindow $frm.sw
6961 by kakaroto
FINALLY have the privacy tab work for all resolutions.. I just added a ScrolledWindow on top of it! no more complaints, yeay!!!!
2079
	ScrollableFrame $frm.sw.sf -constrainedwidth 1
2080
	$frm.sw setwidget $frm.sw.sf
2081
	pack $frm.sw -anchor n -side top -expand true -fill both
2082
	set frm [$frm.sw.sf getframe]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2083
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2084
	## Loging Options Frame ##
2085
	set lfname [labelframe $frm.lfname -text [trans preflog1]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2086
	pack $frm.lfname -anchor n -side top -expand 0 -fill x
2278 by airadier
Fixed preferences and user properties window size.
2087
	label $lfname.plog1 -image [::skin::loadPixmap prefhist]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2088
	pack $lfname.plog1 -anchor nw -side left
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2089
	checkbutton $lfname.log -text "[trans keeplog2]" -onvalue 1 -offvalue 0 -variable [::config::getVar keep_logs]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2090
	checkbutton $lfname.date -text "[trans logsbydate]" -onvalue 1 -offvalue 0 -variable [::config::getVar logsbydate]
2091
	checkbutton $lfname.camlog -text "[trans logwebcam]" -onvalue 1 -offvalue 0 -variable [::config::getVar webcamlogs]
4350 by kakaroto
Added webcam logs and fixed a bug in capture extension
2092
	pack $lfname.log -anchor w
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2093
	pack $lfname.camlog -anchor w
4350 by kakaroto
Added webcam logs and fixed a bug in capture extension
2094
	pack $lfname.date -anchor w
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2095
2096
#/////////TODO Add style log feature
2097
#	frame $lfname.2 -class Degt
2098
#	label $lfname.2.lstyle -text "[trans stylelog]" -padx 10
2099
#	radiobutton $lfname.2.hist -text [trans stylechat] -value 1 -variable [::config::getVar logstyle] -state disabled
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2100
#	radiobutton $lfname.2.chat -text [trans stylehist] -value 2 -variable [::config::getVar logstyle] -state disabled
2101
#	pack $lfname.2.lstyle -anchor w -side top -padx 10
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2102
#	pack $lfname.2.hist $lfname.2.chat -side left -padx 10
2103
#	pack $lfname.2 -anchor w -side top -expand 1 -fill x
2104
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2105
	## Clear All Logs Frame ##
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2106
	set lfname [labelframe $frm.lfname2 -text [trans clearlog]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2107
	pack $frm.lfname2 -anchor n -side top -expand 0 -fill x
2785 by gadget_boy
Create an event viewer and an event log
2108
	label $lfname.plog1 -image [::skin::loadPixmap prefhist2]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2109
	pack $lfname.plog1 -anchor nw -side left
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2110
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2111
	label $lfname.1.lclear -text "[trans clearlog2]" -padx 10
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2112
	button $lfname.1.bclear -text [trans clearlog3]  -command "::log::ClearAllLogs"
6202 by thaven
- Merging one patch from 0.96 (removing -font options)
2113
	button $lfname.1.camclear -text [trans clearwebcamlogs] -command "::log::ClearAllCamLogs"
2114
	pack $lfname.1.lclear -side left
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2115
	pack $lfname.1.bclear -side right -padx 15
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2116
	pack $lfname.1.camclear -side right -padx 15
4350 by kakaroto
Added webcam logs and fixed a bug in capture extension
2117
	pack $lfname.1 -anchor w -side top -expand 0 -fill x
2278 by airadier
Fixed preferences and user properties window size.
2118
#////////TODO: Add logs expiry feature
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2119
	## Logs Expiry Frame ##
2120
#	set lfname [labelframe $frm.lfname3 -text [trans logfandexp]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2121
#	pack $frm.lfname3 -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2122
#	label $lfname.plog1 -image [::skin::loadPixmap prefhist3]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2123
#	pack $lfname.plog1 -anchor nw -side left
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2124
#	frame $lfname.1 -class Degt
2125
#	checkbutton $lfname.1.lolder -text "[trans logolder]" -onvalue 1 -offvalue 0 -variable [::config::getVar logexpiry] -state disabled
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2126
#	entry $lfname.1.eolder -bg #FFFFFF -bd 1 -font splainf -highlightthickness 0  -width 3 -state disabled
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2127
#	label $lfname.1.ldays -text "[trans days]" -padx 5
2128
#	pack $lfname.1 -side top -padx 0 -expand 1 -fill both
2129
#	pack $lfname.1.lolder $lfname.1.eolder $lfname.1.ldays -side left
2130
#	frame $lfname.2 -class Degt
2131
#	checkbutton $lfname.2.lbigger -text "[trans logbigger]" -onvalue 1 -offvalue 0 -variable [::config::getVar logmaxsize] -state disabled
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2132
#	entry $lfname.2.ebigger -bg #FFFFFF -bd 1 -font splainf -highlightthickness 0  -width 3 -state disabled
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2133
#	label $lfname.2.lmbs -text "MBs" -padx 5
2134
#	pack $lfname.2 -side top -padx 0 -expand 1 -fill both
2135
#	pack $lfname.2.lbigger $lfname.2.ebigger $lfname.2.lmbs -side left
2136
2785 by gadget_boy
Create an event viewer and an event log
2137
2138
	## Eventlogging frame ## ***
2139
	set lfname [labelframe $frm.lfname3 -text [trans preflogevent]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2140
	pack $frm.lfname3 -anchor n -side top -expand 0 -fill x
2785 by gadget_boy
Create an event viewer and an event log
2141
	label $lfname.plog1
2142
	grid $lfname.plog1 -columnspan 2
2143
	checkbutton $lfname.displayconnect -text "[trans displayeventconnect]" -onvalue 1 -offvalue 0 -variable [::config::getVar display_event_connect]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2144
	checkbutton $lfname.displaydisconnect -text "[trans displayeventdisconnect]" -onvalue 1 -offvalue 0 -variable [::config::getVar display_event_disconnect]
2145
	checkbutton $lfname.displayemail -text "[trans displayeventemail]" -onvalue 1 -offvalue 0 -variable [::config::getVar display_event_email]
2146
	checkbutton $lfname.displaystate -text "[trans displayeventstate]" -onvalue 1 -offvalue 0 -variable [::config::getVar display_event_state]
2147
	checkbutton $lfname.displaynick -text "[trans displayeventnick]" -onvalue 1 -offvalue 0 -variable [::config::getVar display_event_nick]
7477 by kakaroto
implemented suggestion of unimatrix from : http://www.amsn-project.net/forums/viewtopic.php?t=3459
2148
	checkbutton $lfname.displaypsm -text "[trans displayeventpsm]" -onvalue 1 -offvalue 0 -variable [::config::getVar display_event_psm]
2149
	checkbutton $lfname.logconnect -text "[trans logeventconnect]" -onvalue 1 -offvalue 0 -variable [::config::getVar log_event_connect]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2150
	checkbutton $lfname.logdisconnect -text "[trans logeventdisconnect]" -onvalue 1 -offvalue 0 -variable [::config::getVar log_event_disconnect]
2151
	checkbutton $lfname.logemail -text "[trans logeventemail]" -onvalue 1 -offvalue 0 -variable [::config::getVar log_event_email]
2152
	checkbutton $lfname.logstate -text "[trans logeventstate]" -onvalue 1 -offvalue 0 -variable [::config::getVar log_event_state]
2153
	checkbutton $lfname.lognick -text "[trans logeventnick]" -onvalue 1 -offvalue 0 -variable [::config::getVar log_event_nick]
7477 by kakaroto
implemented suggestion of unimatrix from : http://www.amsn-project.net/forums/viewtopic.php?t=3459
2154
	checkbutton $lfname.logpsm -text "[trans logeventpsm]" -onvalue 1 -offvalue 0 -variable [::config::getVar log_event_psm]
2155
	grid $lfname.displayconnect -row 0 -column 0 -sticky w
2785 by gadget_boy
Create an event viewer and an event log
2156
	grid $lfname.displaydisconnect -row 1 -column 0 -sticky w
2157
	grid $lfname.displayemail -row 2 -column 0 -sticky w
2158
	grid $lfname.displaystate -row 3 -column 0 -sticky w
2159
	grid $lfname.displaynick -row 4 -column 0 -sticky w
7477 by kakaroto
implemented suggestion of unimatrix from : http://www.amsn-project.net/forums/viewtopic.php?t=3459
2160
	grid $lfname.displaypsm -row 5 -column 0 -sticky w
2161
	grid $lfname.logconnect -row 0 -column 1 -sticky w
2785 by gadget_boy
Create an event viewer and an event log
2162
	grid $lfname.logdisconnect -row 1 -column 1 -sticky w
2163
	grid $lfname.logemail -row 2 -column 1 -sticky w
2164
	grid $lfname.logstate -row 3 -column 1 -sticky w
2165
	grid $lfname.lognick -row 4 -column 1 -sticky w
7477 by kakaroto
implemented suggestion of unimatrix from : http://www.amsn-project.net/forums/viewtopic.php?t=3459
2166
	grid $lfname.logpsm -row 5 -column 1 -sticky w
2167
2785 by gadget_boy
Create an event viewer and an event log
2168
2169
	#  .------------.
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2170
	# _| Connection |________________________________________________
2171
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2172
	::skin::setPixmap prefnat prefnat.gif
2611 by germinator2000
Now use ::skins::setPixmap instead of image create photo, to change skin fast
2173
	::skin::setPixmap prefproxy prefproxy.gif
2174
	::skin::setPixmap prefremote prefpers.gif
2175
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2176
	#set frm [Rnotebook:frame $nb $Preftabs(connection)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
2177
	set frm [$nb.nn getframe connection]
2178
	#Scrollable frame that will contain options
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2179
	ScrolledWindow $frm.sw
2238 by airadier
Damn! forgot to remove some testing things...
2180
	ScrollableFrame $frm.sw.sf -constrainedwidth 1
2278 by airadier
Fixed preferences and user properties window size.
2181
	$frm.sw setwidget $frm.sw.sf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2182
	pack $frm.sw -anchor n -side top -expand true -fill both
2183
	set frm [$frm.sw.sf getframe]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2184
2185
	## Connection Frame ##
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2186
	set lfname [labelframe $frm.lfnameconnection -text [trans prefconnection]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2187
	pack $frm.lfnameconnection -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2188
	label $lfname.pshared -image [::skin::loadPixmap prefproxy]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2189
	pack $lfname.pshared -side left -anchor nw
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2190
2191
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2192
	frame $lfname.2
2193
	frame $lfname.3
2194
	frame $lfname.4
2195
	frame $lfname.5
2196
	radiobutton $lfname.1.direct -text "[trans directconnection]" -value direct -variable [::config::getVar connectiontype] -command UpdatePreferences
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2197
	pack $lfname.1.direct -anchor w -side top -padx 10
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2198
	radiobutton $lfname.2.http -text "[trans httpconnection]" -value http -variable [::config::getVar connectiontype] -command UpdatePreferences
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2199
	pack $lfname.2.http -anchor w -side top -padx 10
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2200
	radiobutton $lfname.3.proxy -text "[trans proxyconnection]" -value proxy -variable [::config::getVar connectiontype] -command UpdatePreferences
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2201
	pack $lfname.3.proxy -anchor w -side top -padx 10
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2202
2203
	#checkbutton $lfname.1.proxy -text "[trans proxy]" -onvalue 1 -offvalue 0 -variable [::config::getVar withproxy]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2204
	#pack $lfname.1.proxy -anchor w -side top -padx 10
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2205
2206
	#radiobutton $lfname.2.http -text "HTTP" -value http -variable [::config::getVar proxytype]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2207
	#radiobutton $lfname.2.socks5 -text "SOCKS5" -value socks -variable [::config::getVar proxytype] -state disabled
2208
	#pack $lfname.2.http $lfname.2.socks5 -anchor w -side left -padx 10
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2209
2210
	pack $lfname.1 $lfname.2 $lfname.3 $lfname.4 $lfname.5 -anchor w -side top -padx 0 -pady 0 -expand 1 -fill both
2211
2212
	radiobutton $lfname.4.post -text "HTTP (POST method)" -value http -variable [::config::getVar proxytype] -command UpdatePreferences
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2213
	radiobutton $lfname.4.ssl -text "SSL (CONNECT method)" -value ssl -variable [::config::getVar proxytype] -command UpdatePreferences
2214
	radiobutton $lfname.4.socks5 -text "SOCKS5" -value socks5 -variable [::config::getVar proxytype] -command UpdatePreferences
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2215
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2216
	grid $lfname.4.post -row 1 -column 1 -sticky w -pady 5 -padx 10
2217
	grid $lfname.4.ssl -row 1 -column 2 -sticky w -pady 5 -padx 10
2218
	grid $lfname.4.socks5 -row 1 -column 3 -sticky w -pady 5 -padx 10
2219
2220
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2221
	label $lfname.5.lserver -text "[trans server] :" -padx 5 -font sboldf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2222
	entry $lfname.5.server -font splainf  -width 20 -textvariable proxy_server
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2223
	label $lfname.5.lport -text "[trans port] :" -padx 5 -font sboldf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2224
	entry $lfname.5.port -font splainf  -width 5 -textvariable proxy_port
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2225
	label $lfname.5.luser -text "[trans user] :" -padx 5 -font sboldf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2226
	entry $lfname.5.user -font splainf  -width 20 -textvariable proxy_user
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2227
	label $lfname.5.lpass -text "[trans pass] :" -padx 5 -font sboldf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2228
	entry $lfname.5.pass -font splainf  -width 20 -show "*" -textvariable proxy_pass
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2229
	grid $lfname.5.lserver -row 2 -column 1 -sticky e
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2230
	grid $lfname.5.server -row 2 -column 2 -sticky w -pady 5
2231
	grid $lfname.5.lport -row 2 -column 3 -sticky e
2232
	grid $lfname.5.port -row 2 -column 4 -sticky w -pady 5
2233
	grid $lfname.5.luser -row 3 -column 1 -sticky e
2234
	grid $lfname.5.user -row 3 -column 2 -sticky w
2235
	grid $lfname.5.lpass -row 3 -column 3 -sticky e
2236
	grid $lfname.5.pass -row 3 -column 4 -sticky w
2237
2238
	## NAT (or similar) Frame ##
2239
	set lfname [labelframe $frm.lfname -text [trans prefft]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2240
	pack $frm.lfname -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2241
	label $lfname.pshared -image [::skin::loadPixmap prefnat]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2242
	pack $lfname.pshared -side left -anchor nw
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2243
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2244
	pack $lfname.1 -side left -padx 0 -pady 5 -expand 1 -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2245
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2246
	label $lfname.1.conntype -padx 5 -font splainf -text "[trans type]: [::abook::getDemographicField conntype]"
7059 by kakaroto
Removed bug with the connectivity checked when we click 'test port' before connecting to msn..
2247
	label $lfname.1.listening -padx 5 -font splainf
2248
	if { [::abook::getDemographicField conntype] == "" } {
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2249
		$lfname.1.listening configure -text  "[trans connectfirst]" -fg [::skin::getKey extrastderrcolor]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2250
	} else {
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2251
		if { [::abook::getDemographicField listening] == "false"} {
2252
			$lfname.1.listening configure -text "[trans firewalled]" -fg [::skin::getKey extrastderrcolor]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2253
		} else {
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2254
			$lfname.1.listening configure -text "[trans portswellconfigured]" -fg [::skin::getKey extrastdokcolor]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2255
2256
		}
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2257
	}
2258
	pack $lfname.1.conntype $lfname.1.listening -anchor w -side top -padx 10
7059 by kakaroto
Removed bug with the connectivity checked when we click 'test port' before connecting to msn..
2259
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2260
	frame $lfname.1.ftport
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2261
	label $lfname.1.ftport.text -text "[trans ftportpref2] :" -padx 5 -font splainf
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2262
	entry $lfname.1.ftport.entry -font splainf  -width 5 -textvariable [::config::getVar initialftport]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2263
	button $lfname.1.ftport.bttest -text "[trans ftporttest]" -padx 5 -font splainf -command [list after 0 connection_check $lfname]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2264
	label $lfname.1.ftport.test -text "" -padx 5 -font splainf
6416 by tjikkun
some basic test-if-i-am-smart-enough-to-have-opened-up-my-firewall-correctly-button
2265
	grid $lfname.1.ftport.text -row 1 -column 1 -sticky w -pady 5 -padx 0 -columnspan 3
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2266
	grid $lfname.1.ftport.entry -row 2 -column 1 -sticky w -pady 5 -padx [list 20 3]
2267
	grid $lfname.1.ftport.bttest -row 2 -column 2 -sticky w -pady 5 -padx 3
2268
	grid $lfname.1.ftport.test -row 2 -column 3 -sticky w -pady 5 -padx 3
2269
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2270
	checkbutton $lfname.1.autoip -text "[trans autodetectip]" -onvalue 1 -offvalue 0 -variable [::config::getVar autoftip] -command UpdatePreferences
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2271
	frame $lfname.1.ipaddr
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2272
	label $lfname.1.ipaddr.text -text "[trans ipaddress] :" -padx 5 -font splainf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2273
	entry $lfname.1.ipaddr.entry -font splainf  -width 15 -textvariable [::config::getVar manualip]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2274
	grid $lfname.1.ipaddr.text -row 1 -column 1 -sticky w -pady 5 -padx 0
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2275
	grid $lfname.1.ipaddr.entry -row 1 -column 2 -sticky w -pady 5 -padx 3
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2276
2277
	checkbutton $lfname.1.autoaccept -text "[trans autoacceptft]" -onvalue 1 -offvalue 0 -variable [::config::getVar ftautoaccept]
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2278
2279
	pack $lfname.1.ftport $lfname.1.autoip $lfname.1.ipaddr $lfname.1.autoaccept -anchor w -side top -padx 10
2280
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2281
2282
	## Remote Control Frame ##
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2283
	set lfname [labelframe $frm.lfname3 -text [trans prefremote]]
2284
	pack $frm.lfname3 -anchor n -side top -expand 1 -fill x
2285
	label $lfname.pshared -image [::skin::loadPixmap prefremote]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2286
	pack $lfname.pshared -side left -anchor nw
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2287
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2288
	frame $lfname.2
2289
	pack $lfname.1 -side left -padx 0 -pady 5 -expand 1 -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2290
	checkbutton $lfname.1.eremote -text "[trans enableremote]" -onvalue 1 -offvalue 0 -variable [::config::getVar enableremote] -command UpdatePreferences
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2291
	pack $lfname.1.eremote  -anchor w -side top -padx 10
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2292
	pack $lfname.1 $lfname.2  -anchor w -side top -padx 0 -pady 0 -expand 1 -fill both
2293
	label $lfname.2.lpass -text "[trans pass] :" -padx 5 -font sboldf
2294
	entry $lfname.2.pass -font splainf  -width 20 -show "*"
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2295
	grid $lfname.2.lpass -row 2 -column 3 -sticky e
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2296
	grid $lfname.2.pass -row 2 -column 4 -sticky w
2297
2298
	$nb.nn compute_size
2278 by airadier
Fixed preferences and user properties window size.
2299
	[$nb.nn getframe connection].sw.sf compute_size
2300
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2301
	#  .--------.
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2302
	# _| Others |________________________________________________
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2303
	::skin::setPixmap prefapps prefpers.gif
2611 by germinator2000
Now use ::skins::setPixmap instead of image create photo, to change skin fast
2304
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2305
	#set frm [Rnotebook:frame $nb $Preftabs(others)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
2306
	set frm [$nb.nn getframe others]
2307
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2308
	#Scrollable frame that will contain options
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2309
	ScrolledWindow $frm.sw
2238 by airadier
Damn! forgot to remove some testing things...
2310
	ScrollableFrame $frm.sw.sf -constrainedwidth 1
2278 by airadier
Fixed preferences and user properties window size.
2311
	$frm.sw setwidget $frm.sw.sf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2312
	pack $frm.sw -anchor n -side top -expand true -fill both
2313
	set frm [$frm.sw.sf getframe]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2314
2315
	## Delete Profiles Frame ##
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2316
	set lfname [labelframe $frm.lfname3 -text [trans prefprofile3]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2317
	pack $frm.lfname3 -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2318
	label $lfname.pprofile -image [::skin::loadPixmap prefapps]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2319
	pack $lfname.pprofile -side left -anchor nw
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2320
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2321
	label $lfname.1.ldelprofile -text "[trans delprofile2]" -font sboldf -padx 5
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2322
	combobox::combobox $lfname.1.profile -editable true -width 22
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2323
	button $lfname.1.bdel -text [trans delprofile] -command "DeleteProfile \[${lfname}.1.profile get\] $lfname.1.profile"
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2324
	grid $lfname.1.ldelprofile -row 1 -column 1 -sticky w
2325
	grid $lfname.1.profile -row 1 -column 2 -sticky w
2326
	grid $lfname.1.bdel -row 1 -column 3 -padx 5 -sticky w
2327
	pack $lfname.1 -anchor w -side top -expand 0 -fill none
2328
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2329
	## Applications Frame ##
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2330
	set lfname [labelframe $frm.lfname -text [trans prefapps]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2331
	pack $frm.lfname -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2332
	label $lfname.pshared -image [::skin::loadPixmap prefapps]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2333
	pack $lfname.pshared -side left -anchor nw
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2334
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2335
	pack $lfname.1 -anchor w -side left -padx 0 -pady 5 -expand 0 -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2336
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2337
	#Don't change filemanager and open file manager on Mac OS X
6174 by thaven
This one is a messy diff.... but I did it a few days ago and didn't catch any bugs yet, so I think it's quite safe to commit.
2338
	if { ![OnMac] && ![OnWin] } {
9599 by kakaroto
Do not show mailer/browser/open file/ application entries in preferences->others for windows, since we just use a the default on the system (please test)
2339
		label $lfname.1.lbrowser -text "[trans browser] :" -padx 5 -font sboldf
6211 by germinator2000
Same fucking thing
2340
		entry $lfname.1.browser -width 40 -textvariable [::config::getVar browser]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2341
		label $lfname.1.lbrowserex -text "[trans browserexample]" -font examplef
6211 by germinator2000
Same fucking thing
2342
		#file manager
3761 by germinator2000
fix preferences window on Mac OS X, fix open button feature in transfer window
2343
		label $lfname.1.lfileman -text "[trans fileman] :" -padx 5 -font sboldf
2344
		entry $lfname.1.fileman -width 40 -textvariable [::config::getVar filemanager]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2345
		label $lfname.1.lfilemanex -text "[trans filemanexample]" -font examplef
3761 by germinator2000
fix preferences window on Mac OS X, fix open button feature in transfer window
2346
		#open file command
2347
		label $lfname.1.lopenfile -text "[trans openfilecommand] :" -padx 5 -font sboldf
2348
		entry $lfname.1.openfile -width 40 -textvariable [::config::getVar openfilecommand]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2349
		label $lfname.1.lopenfileex -text "(Gnome: gnome-open \$file) (KDE: kfmclient exec \$file)" -font examplef
8081 by billiob
improve translation use. Thanks to Ton (dutch translator)
2350
	}
3761 by germinator2000
fix preferences window on Mac OS X, fix open button feature in transfer window
2351
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2352
	if {![OnWin] } {
9599 by kakaroto
Do not show mailer/browser/open file/ application entries in preferences->others for windows, since we just use a the default on the system (please test)
2353
		label $lfname.1.lmailer -text "[trans mailer] :" -padx 5 -font sboldf
2354
		entry $lfname.1.mailer -width 40 -textvariable [::config::getVar mailcommand]
2355
		label $lfname.1.lmailerex -text "[trans mailerexample]" -font examplef
2356
	}
2357
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2358
	#aMSN for Mac OS X always use "QuickTimeTCL" (except in Alarms) so don't let mac user choose sound player
2737 by germinator2000
Don't let Mac users choose soundplayer (totally useless)
2359
	if { ![OnMac] } {
6174 by thaven
This one is a messy diff.... but I did it a few days ago and didn't catch any bugs yet, so I think it's quite safe to commit.
2360
		label $lfname.1.lsound -text "[trans soundserver] :" -padx 5 -font sboldf
2737 by germinator2000
Don't let Mac users choose soundplayer (totally useless)
2361
		frame $lfname.1.sound
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2362
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2363
		radiobutton $lfname.1.sound.snack -text "[trans usesnack]" -value 1 -variable [::config::getVar usesnack] -command UpdatePreferences
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2364
		pack $lfname.1.sound.snack -anchor w -side top -padx 10
2737 by germinator2000
Don't let Mac users choose soundplayer (totally useless)
2365
		radiobutton $lfname.1.sound.other -text "[trans useother]" -value 0 -variable [::config::getVar usesnack] -command UpdatePreferences
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2366
		pack $lfname.1.sound.other -anchor w -side top -padx 10
2737 by germinator2000
Don't let Mac users choose soundplayer (totally useless)
2367
		entry $lfname.1.sound.sound -width 40 -textvariable [::config::getVar soundcommand]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2368
		pack $lfname.1.sound.sound -anchor w -side top -padx 10
2737 by germinator2000
Don't let Mac users choose soundplayer (totally useless)
2369
		label $lfname.1.sound.lsoundex -text "[trans soundexample]" -font examplef
2370
		pack $lfname.1.sound.lsoundex -anchor w -side top -padx 10
2371
9603 by kakaroto
Thankfully, I tested this before we released! Fix the crash when trying to access preferences on windows!
2372
	}
2373
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2374
9603 by kakaroto
Thankfully, I tested this before we released! Fix the crash when trying to access preferences on windows!
2375
	#aMSN for Mac OS X always use "QuickTimeTCL" (except in Alarms) so don't let mac user choose sound player
2376
	#because we don't change filemanager and open file manager on Mac OS X
2377
	if { [OnMac] } {
2378
		grid $lfname.1.lmailer -row 7 -column 1 -sticky w
2379
		grid $lfname.1.mailer -row 7 -column 2 -sticky w
2380
		grid $lfname.1.lmailerex -row 8 -column 2 -columnspan 1 -sticky w
2381
	} elseif {![OnWin] } {
2382
		grid $lfname.1.lbrowser -row 1 -column 1 -sticky w
6212 by germinator2000
Small bug I introduced yesterday on Mac
2383
		grid $lfname.1.browser -row 1 -column 2 -sticky w
2384
		grid $lfname.1.lbrowserex -row 2 -column 2 -columnspan 1 -sticky w
2385
2386
		grid $lfname.1.lfileman -row 3 -column 1 -sticky w
3761 by germinator2000
fix preferences window on Mac OS X, fix open button feature in transfer window
2387
		grid $lfname.1.fileman -row 3 -column 2 -sticky w
2388
		grid $lfname.1.lfilemanex -row 4 -column 2 -columnspan 1 -sticky w
2389
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2390
		grid $lfname.1.lopenfile -row 5 -column 1 -sticky w
3761 by germinator2000
fix preferences window on Mac OS X, fix open button feature in transfer window
2391
		grid $lfname.1.openfile -row 5 -column 2 -sticky w
2392
		grid $lfname.1.lopenfileex -row 6 -column 2 -columnspan 1 -sticky w
2393
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2394
		grid $lfname.1.lmailer -row 7 -column 1 -sticky w
3761 by germinator2000
fix preferences window on Mac OS X, fix open button feature in transfer window
2395
		grid $lfname.1.mailer -row 7 -column 2 -sticky w
2396
		grid $lfname.1.lmailerex -row 8 -column 2 -columnspan 1 -sticky w
2397
9603 by kakaroto
Thankfully, I tested this before we released! Fix the crash when trying to access preferences on windows!
2398
	}
2399
2400
	if {![OnMac] } {
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2401
		grid $lfname.1.lsound -row 9 -column 1 -sticky nw
3754 by airadier
Applied Emmanuel Counasse patch for opening received files.
2402
		grid $lfname.1.sound -row 9 -column 2 -sticky w
2403
		#grid $lfname.1.lsoundex -row 10 -column 2 -columnspan 1 -sticky w
2404
	}
2737 by germinator2000
Don't let Mac users choose soundplayer (totally useless)
2405
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2406
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2407
	## File transfert directory frame ##
2992 by gadget_boy
Switch TLS and received files directory in the preferences
2408
	set lfname [labelframe $frm.lfname4 -text [trans receiveddir]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2409
	pack $frm.lfname4 -anchor n -side top -expand 1 -fill x
2992 by gadget_boy
Switch TLS and received files directory in the preferences
2410
	label $lfname.pshared -image [::skin::loadPixmap prefapps]
2411
	pack $lfname.pshared -side left -anchor nw
2412
2413
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2414
	pack $lfname.1 -anchor w -side left -padx 0 -pady 5 -fill none
2992 by gadget_boy
Switch TLS and received files directory in the preferences
2415
	label $lfname.1.receivedpath -text [trans receiveddir] -padx 5 -font sboldf
2416
	entry $lfname.1.receiveddir -width 45  -textvariable [::config::getVar receiveddir]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2417
	button $lfname.1.browse -text [trans browse] -command "Browse_Dialog_dir [::config::getVar receiveddir]"
2996 by gadget_boy
Fix a bug with the received file directory in the preference window
2418
2992 by gadget_boy
Switch TLS and received files directory in the preferences
2419
	grid $lfname.1.receivedpath -row 1 -column 1 -sticky w
2420
	grid $lfname.1.receiveddir -row 1 -column 2 -sticky w
2421
	grid $lfname.1.browse -row 1 -column 3 -sticky w
2422
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2423
	set lfname [labelframe $frm.lfname5 -text [trans audiovideo]]
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2424
	pack $frm.lfname5 -anchor n -side top -expand 1 -fill x
5007 by germinator2000
Configure webcam window added to aMSN
2425
	label $lfname.pshared -image [::skin::loadPixmap webcam]
2426
	pack $lfname.pshared -side left -anchor nw
2427
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2428
	frame $lfname.1
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2429
	pack $lfname.1 -anchor w -side left -padx 0 -pady 5 -fill none
5007 by germinator2000
Configure webcam window added to aMSN
2430
	button $lfname.1.webcam -text [trans editavsettings] -command [list ::AVAssistant::AVAssistant] -padx 20
7006 by billiob
- finish the assistant: add it to the Preferences + add a small notice when firewalled
2431
	grid $lfname.1.webcam -row 1 -column 3 -sticky w -padx 20
5007 by germinator2000
Configure webcam window added to aMSN
2432
2992 by gadget_boy
Switch TLS and received files directory in the preferences
2433
	$nb.nn compute_size
2278 by airadier
Fixed preferences and user properties window size.
2434
	[$nb.nn getframe others].sw.sf compute_size
2435
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2436
	#  .----------.
2437
	# _| Advanced |________________________________________________
2438
2439
	#set frm [Rnotebook:frame $nb $Preftabs(advanced)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
2440
	set frm [$nb.nn getframe advanced]
2441
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2442
	set lfname [labelframe $frm.lfname -text [trans advancedprefs]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2443
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2444
	#Scrollable frame that will contain advanced optoins
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2445
	ScrolledWindow $lfname.sw
2238 by airadier
Damn! forgot to remove some testing things...
2446
	ScrollableFrame $lfname.sw.sf -constrainedwidth 1
2278 by airadier
Fixed preferences and user properties window size.
2447
	$lfname.sw setwidget $lfname.sw.sf
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2448
	set path [$lfname.sw.sf getframe]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2449
8027 by dpcris85
Advanced preferences search box
2450
	# search box
2451
	set searchfrm [frame $frm.searchframe]
2452
	label $searchfrm.searchlabel -text "[trans searchadvprefs]" -anchor ne
2453
	entry $searchfrm.searchfield -bg #FFFFFF -width 20 -validate key -vcmd "filter_prefs $path %P %d"
2454
2455
	pack $searchfrm.searchfield -anchor ne -side right
2456
	pack $searchfrm.searchlabel -anchor ne -side right
2457
	pack $searchfrm -anchor n -side top -fill x
2458
2459
	pack $frm.lfname -anchor n -side top -expand true -fill both
2460
	pack $lfname.sw -anchor n -side top -expand true -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2461
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2462
	advanced_options_reload $path
8236 by kakaroto
rename reload_advanced_options to advanced_options_reload.. makes it easier for autocompleting reload_files while debugging
2463
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2464
	#add bindings to scroll with mousewheel
5445 by billiob
added bindings to scroll with the mousewheel the advanced preferences' window.
2465
	#can not use local variables in bind scripts with {}.
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2466
	#and with "", can not use %D  :(
5446 by billiob
add the bindings for scrolling to every platform (thx for pointing it Jerome).
2467
	# Mac OS X and Windows
6174 by thaven
This one is a messy diff.... but I did it a few days ago and didn't catch any bugs yet, so I think it's quite safe to commit.
2468
	if { [OnMac] } {
2469
	    bind .cfg <MouseWheel> {
5564 by kakaroto
Fixed scrolling issue in prefs window + fixes a bug with chameleon + added few credits
2470
		    set w [.cfg.notebook.nn getframe [.cfg.notebook.nn raise]]
2471
		    if { [winfo exists $w.sw.sf] } {
2472
			    $w.sw.sf yview scroll [expr {- (%D)}] units
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2473
		    } elseif { [winfo exists $w.lfname.sw.sf] } {
5564 by kakaroto
Fixed scrolling issue in prefs window + fixes a bug with chameleon + added few credits
2474
			    $w.lfname.sw.sf yview scroll [expr {- (%D)}] units
2475
		    }
2476
	    }
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2477
	} elseif { [OnWin] } {
6174 by thaven
This one is a messy diff.... but I did it a few days ago and didn't catch any bugs yet, so I think it's quite safe to commit.
2478
	    bind .cfg <MouseWheel> {
5564 by kakaroto
Fixed scrolling issue in prefs window + fixes a bug with chameleon + added few credits
2479
		    set w [.cfg.notebook.nn getframe [.cfg.notebook.nn raise]]
2480
		    if { [winfo exists $w.sw.sf] } {
2481
			    $w.sw.sf yview scroll [expr {%D/-120}] units
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2482
		    } elseif { [winfo exists $w.lfname.sw.sf] } {
5564 by kakaroto
Fixed scrolling issue in prefs window + fixes a bug with chameleon + added few credits
2483
			    $w.lfname.sw.sf yview scroll [expr {%D/-120}] units
8113 by kakaroto
Fixes mouse wheel scrolling for windows.. it needs /-120 ... fix for dpbrowser and preferences window!
2484
		    }
5564 by kakaroto
Fixed scrolling issue in prefs window + fixes a bug with chameleon + added few credits
2485
	    }
2486
	} elseif { [OnX11] } {
6174 by thaven
This one is a messy diff.... but I did it a few days ago and didn't catch any bugs yet, so I think it's quite safe to commit.
2487
	    bind .cfg <5> {
5564 by kakaroto
Fixed scrolling issue in prefs window + fixes a bug with chameleon + added few credits
2488
		    set w [.cfg.notebook.nn getframe [.cfg.notebook.nn raise]]
2489
		    if { [winfo exists $w.sw.sf] } {
2490
			    $w.sw.sf yview scroll +1 units
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2491
		    } elseif { [winfo exists $w.lfname.sw.sf] } {
5564 by kakaroto
Fixed scrolling issue in prefs window + fixes a bug with chameleon + added few credits
2492
			    $w.lfname.sw.sf yview scroll +1 units
2493
		    }
2494
	    }
2495
	    bind .cfg <4> {
2496
		    set w [.cfg.notebook.nn getframe [.cfg.notebook.nn raise]]
2497
		    if { [winfo exists $w.sw.sf] } {
2498
			    $w.sw.sf yview scroll -1 units
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2499
		    } elseif { [winfo exists $w.lfname.sw.sf] } {
5564 by kakaroto
Fixed scrolling issue in prefs window + fixes a bug with chameleon + added few credits
2500
			    $w.lfname.sw.sf yview scroll -1 units
2501
		    }
2502
	    }
2503
	}
5446 by billiob
add the bindings for scrolling to every platform (thx for pointing it Jerome).
2504
5445 by billiob
added bindings to scroll with the mousewheel the advanced preferences' window.
2505
	frame $path.2
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2506
	label $path.2.delimiters -text "[trans delimiters]" -padx 5
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2507
	entry $path.2.ldelimiter -font splainf -width 3 -textvariable [::config::getVar leftdelimiter]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2508
	label $path.2.example -text "HH:MM:SS" -padx 5
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2509
	entry $path.2.rdelimiter -font splainf -width 3 -textvariable [::config::getVar rightdelimiter]
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2510
	pack $path.2 -side top -padx 0 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2511
	pack $path.2.delimiters $path.2.ldelimiter $path.2.example $path.2.rdelimiter -side left
2512
2513
	$nb.nn compute_size
2278 by airadier
Fixed preferences and user properties window size.
2514
	$lfname.sw.sf compute_size
9183 by kakaroto
fix a possible typo
2515
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2516
2517
	#  .---------.
7043 by billiob
Preferences: unregister events when no longer needed
2518
	# _| Privacy |________________________________________________
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2519
	#set frm [Rnotebook:frame $nb $Preftabs(privacy)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
2520
	set frm [$nb.nn getframe privacy]
2521
	ScrolledWindow $frm.sw
6961 by kakaroto
FINALLY have the privacy tab work for all resolutions.. I just added a ScrolledWindow on top of it! no more complaints, yeay!!!!
2522
	ScrollableFrame $frm.sw.sf -constrainedwidth 1
2523
	$frm.sw setwidget $frm.sw.sf
2524
	pack $frm.sw -anchor n -side top -expand true -fill both
2525
	set frm [$frm.sw.sf getframe]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2526
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2527
         # Allow/Block lists
2528
	set lfname [labelframe $frm.lfname -text [trans prefprivacy]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2529
	pack $frm.lfname -anchor n -side top -expand 1 -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2530
	label $lfname.pprivacy -image [::skin::loadPixmap prefapps]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2531
	pack $lfname.pprivacy -anchor nw -side left
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2532
2533
	frame $lfname.allowlist -relief sunken -borderwidth 3
2534
    label $lfname.allowlist.label -text "[trans allowlist]" \
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2535
		-foreground [::skin::getKey extraprivacy_intoal_fg] -font sboldf
2536
	listbox $lfname.allowlist.box -yscrollcommand "$lfname.allowlist.ys set" \
2537
		-relief flat -highlightthickness 0 -height 5
2538
	scrollbar $lfname.allowlist.ys -command "$lfname.allowlist.box yview" -highlightthickness 0 \
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2539
        -borderwidth 1 -elementborderwidth 2
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2540
	pack $lfname.allowlist.label $lfname.allowlist.box -side top -expand false -fill x
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2541
	pack $lfname.allowlist.box -side left -expand true -fill both
5631 by vivia
Better handling of filename in drag-and-drop
2542
	pack $lfname.allowlist.ys -side right -fill y -expand false
2543
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2544
2545
	frame $lfname.blocklist -relief sunken -borderwidth 3
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2546
	label $lfname.blocklist.label -text "[trans blocklist]" -foreground [::skin::getKey extraprivacy_intobl_fg] -font sboldf
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2547
	listbox $lfname.blocklist.box -yscrollcommand "$lfname.blocklist.ys set" \
2548
		-relief flat -highlightthickness 0  -height 5
2549
2550
	scrollbar $lfname.blocklist.ys -command "$lfname.blocklist.box yview" -highlightthickness 0 \
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2551
         -borderwidth 1 -elementborderwidth 2
2552
	pack $lfname.blocklist.label $lfname.blocklist.box -side top -expand false -fill x
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2553
	pack $lfname.blocklist.box -side left -expand true -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2554
	pack $lfname.blocklist.ys -side right -fill y -expand false
5631 by vivia
Better handling of filename in drag-and-drop
2555
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2556
2557
	frame $lfname.buttons -borderwidth 0
2558
	button $lfname.buttons.right -text "[trans move] -->"  -command "Allow_to_Block $lfname" -width 13
7640 by thaven
Some little changes by Ton and me:
2559
	button $lfname.buttons.left -text "<-- [trans move]"  -command "Block_to_Allow $lfname" -width 13
2560
	pack $lfname.buttons.right $lfname.buttons.left  -side top
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2561
2562
	label $lfname.status -text ""
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2563
	frame $lfname.allowframe
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2564
	radiobutton $lfname.allowframe.allowallbutbl -text "[trans allowallbutbl]" -value 1 -variable temp_BLP
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2565
	radiobutton $lfname.allowframe.allowonlyinal -text "[trans allowonlyinal]" -value 0 -variable temp_BLP
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2566
	grid $lfname.allowframe.allowallbutbl -row 1 -column 1 -sticky w
2567
	grid $lfname.allowframe.allowonlyinal -row 2 -column 1 -sticky w
2568
	pack $lfname.status $lfname.allowframe -side bottom -anchor w -fill x
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2569
	pack $lfname.allowlist $lfname.buttons $lfname.blocklist -anchor w -side left -padx 10 -pady 10 -expand 1 -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2570
2571
	bind $lfname.allowlist.box <<Button3>> "create_users_list_popup $lfname \"allow\" %X %Y"
8492 by lephilousophe
Make mouse Mac compatible everywhere
2572
	bind $lfname.blocklist.box <<Button3>> "create_users_list_popup $lfname \"block\" %X %Y"
2573
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2574
2575
	# Contact/Reverse lists
2576
	set lfname [labelframe $frm.lfname2 -text [trans prefprivacy2]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2577
	set framePrivacyReverseList $lfname.reverselist
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2578
	pack $frm.lfname2 -anchor n -side top -expand 1 -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2579
	label $lfname.pprivacy -image [::skin::loadPixmap prefapps]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2580
	pack $lfname.pprivacy -anchor nw -side left
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2581
2582
	frame $lfname.contactlist -relief sunken -borderwidth 3
2583
	label $lfname.contactlist.label -text "[trans contactlist]" -background [::skin::getKey extraprivacy_notfl_bg] -font sboldf
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2584
	listbox $lfname.contactlist.box -yscrollcommand "$lfname.contactlist.ys set" \
2585
		-relief flat -highlightthickness 0 -height 5
2586
2587
	scrollbar $lfname.contactlist.ys -command "$lfname.contactlist.box yview" -highlightthickness 0 \
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2588
		-borderwidth 1 -elementborderwidth 2
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2589
	pack $lfname.contactlist.label $lfname.contactlist.box -side top -expand false -fill x
2590
	pack $lfname.contactlist.ys -side right -fill y -expand false
5631 by vivia
Better handling of filename in drag-and-drop
2591
	pack $lfname.contactlist.box -side left -expand true -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2592
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2593
	frame $lfname.reverselist -relief sunken -borderwidth 3
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2594
	label $lfname.reverselist.label -text "[trans reverselist]" -background [::skin::getKey extraprivacy_notrl_bg] -font sboldf
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2595
	listbox $lfname.reverselist.box -yscrollcommand "$lfname.reverselist.ys set" \
2596
		-relief flat -highlightthickness 0  -height 5
2597
	scrollbar $lfname.reverselist.ys -command "$lfname.reverselist.box yview" -highlightthickness 0 \
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2598
		-borderwidth 1 -elementborderwidth 2
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2599
	pack $lfname.reverselist.label $lfname.reverselist.box -side top -expand false -fill x
2600
	pack $lfname.reverselist.ys -side right -fill y -expand false
5631 by vivia
Better handling of filename in drag-and-drop
2601
	pack $lfname.reverselist.box -side left -expand true -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2602
2603
	frame $lfname.adding
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2604
	entry $lfname.adding.enter
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2605
	button $lfname.adding.addal -text "[trans addtoal]" -command "Add_To_List $lfname AL"
8980 by billiob
apply patch to improve translations in the Privacy tab. Thanks to Murat Senel for the patch :)
2606
	button $lfname.adding.addbl -text "[trans addtobl]" -command "Add_To_List $lfname BL"
2607
	button $lfname.adding.addfl -text "[trans addtofl]" -command "Add_To_List $lfname FL"
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2608
	pack $lfname.adding.addal $lfname.adding.addbl $lfname.adding.addfl -side left
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2609
	pack $lfname.adding.enter -side top
2610
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2611
2612
	frame $lfname.buttons -borderwidth 0
2613
	button $lfname.buttons.right -text "[trans delete] -->"  -command "Remove_Contact $lfname" -width 13
7640 by thaven
Some little changes by Ton and me:
2614
	button $lfname.buttons.left -text "<-- [trans copy]"  -command "Reverse_to_Contact $lfname" -width 13
2615
	pack $lfname.adding  $lfname.buttons.right $lfname.buttons.left -side top
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2616
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2617
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2618
 #       pack $lfname.addal $lfname.addbl $lfname.addfl -side left
2619
2620
 #    	grid $lfname.enter -row 3 -column 1 -sticky w
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2621
 #	grid $lfname.addal -row 4 -column 1 -sticky w
2622
 #	grid $lfname.addbl -row 4 -column 2 -sticky w
2623
 #	grid $lfname.addfl -row 4 -column 3 -sticky w
2624
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2625
	label $lfname.status -text ""
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2626
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2627
	pack $lfname.status -side bottom  -anchor w  -fill x
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2628
	pack $lfname.contactlist $lfname.buttons $lfname.reverselist -anchor w -side left -padx 10 -pady 10 -expand 1 -fill both
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2629
2630
	bind $lfname.contactlist.box <<Button3>> "create_users_list_popup $lfname \"contact\" %X %Y"
8492 by lephilousophe
Make mouse Mac compatible everywhere
2631
	bind $lfname.reverselist.box <<Button3>> "create_users_list_popup $lfname \"reverse\" %X %Y"
2632
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2633
2634
	::Event::registerEvent contactRemoved protocol [list Fill_users_list_event $frm.lfname $frm.lfname2]
7036 by kakaroto
Fixed previous commit with privacy tab...
2635
	::Event::registerEvent contactListChange all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2636
	::Event::registerEvent contactBlocked all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2637
	::Event::registerEvent contactUnblocked all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2638
	::Event::registerEvent contactMoved all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2639
	::Event::registerEvent contactAdded all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2640
	::Event::registerEvent contactRemoved all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2641
	::Event::registerEvent contactlistLoaded all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2642
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2643
	#  .----------.
2644
	# _| Blocking |________________________________________________
2645
	#set frm [Rnotebook:frame $nb $Preftabs(blocking)]
2646
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2647
	## Check on disconnect ##
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2648
	#set lfname [labelframe $frm.lfname -text [trans prefblock1]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2649
	#pack $frm.lfname -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2650
	#label $lfname.ppref1 -image [::skin::loadPixmap prefapps]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2651
	#pack $lfname.ppref1 -side left -padx 5 -pady 5
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2652
	#checkbutton $lfname.enable -text "[trans checkonfln]" -onvalue 1 -offvalue 0 -variable [::config::getVar checkonfln]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2653
	#pack $lfname.enable  -anchor w -side left -padx 0 -pady 5
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2654
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2655
	## "You have been blocked" group ##
2656
	#set lfname [labelframe $frm.lfname3 -text [trans prefblock3]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2657
	#pack $frm.lfname3 -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2658
	#label $lfname.ppref3 -image [::skin::loadPixmap prefapps]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2659
	#pack $lfname.ppref3 -side left -padx 5 -pady 5
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2660
	#checkbutton $lfname.group -text "[trans blockedyougroup]" -onvalue 1 -offvalue 0 -variable [::config::getVar showblockedgroup]
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2661
	#pack $lfname.group  -anchor w -side left -padx 0 -pady 5
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2662
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2663
	## Continuously check ##
2664
	#set lfname [labelframe $frm.lfname2 -text [trans prefblock2]]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2665
	#pack $frm.lfname2 -anchor n -side top -expand 1 -fill x
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2666
	#label $lfname.ppref2 -image [::skin::loadPixmap prefapps]
2815 by airadier
Pixmaps are now loaded on demand, not at the beginning.
2667
	#pack $lfname.ppref2 -side left -padx 5 -pady 5
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2668
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2669
	#frame $lfname.enable -class Degt
2670
	#pack $lfname.enable -anchor w -side left
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2671
	#checkbutton $lfname.enable.cb -text "[trans checkblocking]" -onvalue 1 -offvalue 0 -variable [::config::getVar checkblocking] -command UpdatePreferences
2803 by lio_lion
Removed -variable config(...) replaced with -variable [::config::getVar ...]
2672
	#grid $lfname.enable.cb -row 1 -column 1 -sticky w
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2673
2674
	#frame $lfname.check -class Degt
2675
	#pack $lfname.check -anchor w -side left -padx 0 -pady 5
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2676
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2677
        #label $lfname.check.linter1 -text "[trans blockinter1]"
2678
        #label $lfname.check.linter2 -text "[trans blockinter2]"
2679
        #label $lfname.check.linter3 -text "[trans blockinter3]"
2680
        #label $lfname.check.linter4 -text "[trans blockinter4]"
2681
        #label $lfname.check.lusers -text "[trans blockusers]"
2682
        #entry $lfname.check.inter1 -validate all -vcmd "BlockValidateEntry %W %P 1" -invcmd "BlockValidateEntry %W %P 0 15" -width 4 -textvariable [::config::getVar blockinter1]
2806 by lio_lion
Removed -textvariable config(...) replaced with -variable [::config::getVar ...]
2683
        #entry $lfname.check.inter2 -validate all -vcmd "BlockValidateEntry %W %P 2" -invcmd "BlockValidateEntry %W %P 0 30"  -width 4 -textvariable [::config::getVar blockinter2]
2684
        #entry $lfname.check.inter3 -validate all -vcmd "BlockValidateEntry %W %P 3" -invcmd "BlockValidateEntry %W %P 0 2" -width 4 -textvariable [::config::getVar blockinter3]
2685
        #entry $lfname.check.users -validate all -vcmd "BlockValidateEntry %W %P 4" -invcmd "BlockValidateEntry %W %P 0 5" -width 4 -textvariable [::config::getVar blockusers]
2686
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2687
        #grid $lfname.check.linter1 -row 1 -column 1 -sticky w
2688
        #grid $lfname.check.linter2 -row 1 -column 3 -sticky w
2689
        #grid $lfname.check.linter3 -row 2 -column 3 -sticky w
2690
        #grid $lfname.check.linter4 -row 2 -column 5 -sticky w
2691
        #grid $lfname.check.lusers -row 2 -column 1 -sticky w
2692
        #grid $lfname.check.inter1 -row 1 -column 2 -sticky w
2693
        #grid $lfname.check.inter2 -row 1 -column 4 -sticky w
2694
        #grid $lfname.check.inter3 -row 2 -column 4 -sticky w
2695
        #grid $lfname.check.users -row 2 -column 2 -sticky w
2696
2697
	#pack $lfname.enable $lfname.check -anchor w -side top
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2698
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2699
	#frame $frm.dummy -class Degt
2700
	#pack $frm.dummy -anchor n -side top -expand 1 -fill both -pady 150
2701
2702
    # Frame for common buttons (all preferences)
2237 by airadier
Some fixes in preferences window (but not yet finished)
2703
    frame .cfg.buttons
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
2704
    button .cfg.buttons.save -text [trans save] -default active -command "wm withdraw .cfg; SavePreferences; destroy .cfg"
6529 by lephilousophe
Should fix buf #1605758 from SF tracker...
2705
    button .cfg.buttons.cancel -text [trans close] -command "destroy .cfg"
3631 by germinator2000
Get default font for button in preferences
2706
    bind .cfg <<Escape>> "destroy .cfg"
2828 by gadget_boy
Added <<Escape>>
2707
    pack .cfg.buttons.save .cfg.buttons.cancel -side right -padx 10 -pady 5
2237 by airadier
Some fixes in preferences window (but not yet finished)
2708
    pack .cfg.buttons -side bottom -fill x
2709
2828 by gadget_boy
Added <<Escape>>
2710
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2711
    #Rnotebook:totalwidth $nb
2228 by airadier
Moved preferences to use BWidget NoteBook.
2712
    $nb.nn raise personal
2237 by airadier
Some fixes in preferences window (but not yet finished)
2713
    $nb.nn compute_size
2228 by airadier
Moved preferences to use BWidget NoteBook.
2714
    pack $nb.nn -expand true -fill both
2237 by airadier
Some fixes in preferences window (but not yet finished)
2715
    #pack $nb -fill both -expand 1 -padx 10 -pady 10
2716
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2717
    pack .cfg.notebook -side bottom -fill both -expand true -padx 5 -pady 5
2237 by airadier
Some fixes in preferences window (but not yet finished)
2718
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2719
2720
    InitPref 1
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
2721
    UpdatePreferences
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2722
2723
    #wm geometry .cfg [expr [Rnotebook:totalwidth $nb] + 50]x595
2228 by airadier
Moved preferences to use BWidget NoteBook.
2724
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2725
    #catch { Rnotebook:raise $nb $Preftabs($settings) }
2228 by airadier
Moved preferences to use BWidget NoteBook.
2726
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2727
	# This should raise the settings tab depending on the arg..
7062 by kakaroto
As requested by Tom J. we get back the old behavior we had of the prefs window being opened at a specific tab.
2728
	catch {$nb.nn raise $settings}
2729
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2730
    bind .cfg <Destroy> "UnregisterPrivacyEvents; RestorePreferences %W"
9018 by kakaroto
Fix the 'Close' button of the preferences not to save the config... the array unset must be called inside the RestorePreferences because the Destroy event is called on every subwidget first... Thanks to murdok for reporting
2731
2638 by lio_lion
added moveinscreen procedure
2732
    wm state .cfg normal
2821 by lio_lion
small fix for window sizing
2733
2734
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2735
    moveinscreen .cfg 60
7592 by kakaroto
preferences window should leave 60 pixels on each side of the screen, because some people might have panels on the top and bottom (gnome) and it could overflow...
2736
7069 by bluetit
Make prefs window show page you ask for when you call Preferences
2737
    # Show requested page
2738
    # The move in screen could maybe cause the window to get destroyed when it does the 'update' so let's catch this
9681 by kakaroto
Avoid a bug with prefs window
2739
    catch { $nb.nn raise $settings }
2740
}
7043 by billiob
Preferences: unregister events when no longer needed
2741
2742
proc UnregisterPrivacyEvents {} {
2743
	set nb .cfg.notebook
2744
	if {[winfo exists $nb]} {
2745
		set lfname [$nb.nn getframe privacy]
2746
		set frm [$lfname.sw.sf getframe]
2747
		::Event::unregisterEvent contactRemoved protocol [list Fill_users_list_event $frm.lfname $frm.lfname2]
2748
		::Event::unregisterEvent contactListChange all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2749
		::Event::unregisterEvent contactBlocked all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2750
		::Event::unregisterEvent contactUnblocked all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2751
		::Event::unregisterEvent contactMoved all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2752
		::Event::unregisterEvent contactAdded all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2753
		::Event::unregisterEvent contactRemoved all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2754
		::Event::unregisterEvent contactlistLoaded all [list Fill_users_list_event $frm.lfname $frm.lfname2]
2755
	}
2756
}
2638 by lio_lion
added moveinscreen procedure
2757
2758
proc Fill_users_list_event { path1 path2 args} {
7036 by kakaroto
Fixed previous commit with privacy tab...
2759
        Fill_users_list $path1 $path2
2760
}
7035 by billiob
Should fix bug reported on the forums ( http://www.amsn-project.net/forums/viewtopic.php?t=3010 ), when trying to delete a contact no longer in RL
2761
2762
8816 by kakaroto
A more complete (although unused) getTaskBarHeight.. it gives the height of the top/bottom/left/right of the taskbar... it should be called only once at program startup to avoid problems...
2763
proc getTaskbarHeight {{w .taskBarSize}} {
6241 by airadier
Added getTaskbarHeight procedure (proc name is self-descriptive), but not using it, small flicker when called. TODO: May be useful for finding out notify window offset?
2764
	global taskbarHeight
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2765
7474 by kakaroto
Fixed the taskbar problem TEMPORARLY until we (phil) implement a way of getting it using winutils
2766
	return [list 30 0 0 0]
8816 by kakaroto
A more complete (although unused) getTaskBarHeight.. it gives the height of the top/bottom/left/right of the taskbar... it should be called only once at program startup to avoid problems...
2767
7474 by kakaroto
Fixed the taskbar problem TEMPORARLY until we (phil) implement a way of getting it using winutils
2768
	catch {destroy $w}
7440 by kakaroto
Finally a fix to avoid having the prefs window (or any other huge window that uses moveinscreen to position a window) overlap with the window's taskbar. So now, the save and close buttons are visible from the very start.
2769
	# the -bg {} is used as a trick, it's some kind of bug with tk, where the background of the window becomes transparent
8816 by kakaroto
A more complete (although unused) getTaskBarHeight.. it gives the height of the top/bottom/left/right of the taskbar... it should be called only once at program startup to avoid problems...
2770
	toplevel $w
2771
	wm attributes $w -alpha 0 -disabled 1
2772
	wm state $w zoomed
7440 by kakaroto
Finally a fix to avoid having the prefs window (or any other huge window that uses moveinscreen to position a window) overlap with the window's taskbar. So now, the save and close buttons are visible from the very start.
2773
 	update
8816 by kakaroto
A more complete (although unused) getTaskBarHeight.. it gives the height of the top/bottom/left/right of the taskbar... it should be called only once at program startup to avoid problems...
2774
 	set taskbarBottom [expr {[winfo screenheight $w] - [winfo height $w] - [winfo rooty $w]}]
2775
 	set taskbarRight [expr {[winfo screenwidth $w] - [winfo width $w] - [winfo rootx $w]}]
2776
2777
 	set taskbarTop [expr {[winfo y $w] + 4}]
2778
 	set taskbarLeft [expr {[winfo x $w] + 4}]
2779
 	destroy $w
2780
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2781
 	return [list $taskbarTop $taskbarRight $taskbarBottom $taskbarLeft]
8816 by kakaroto
A more complete (although unused) getTaskBarHeight.. it gives the height of the top/bottom/left/right of the taskbar... it should be called only once at program startup to avoid problems...
2782
}
6241 by airadier
Added getTaskbarHeight procedure (proc name is self-descriptive), but not using it, small flicker when called. TODO: May be useful for finding out notify window offset?
2783
2784
7440 by kakaroto
Finally a fix to avoid having the prefs window (or any other huge window that uses moveinscreen to position a window) overlap with the window's taskbar. So now, the save and close buttons are visible from the very start.
2785
#check if a window is outside the screen and move it in
2638 by lio_lion
added moveinscreen procedure
2786
proc moveinscreen {window {mindist 0}} {
2787
4308 by germinator2000
Hostname problem: Get back to the old changes (to fix the problem a lot of people are having on CVS), fix it permanantly later
2788
	update
3419 by lio_lion
fix for bug when window closed during update
2789
2790
	#Small check to verify the window really exist
3181 by germinator2000
Fix inside moveinscreen, to fix some bugreport
2791
	if { ![winfo exists $window] } {
2792
 		return
2793
 	}
2794
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2795
	#set winx [winfo width $window]
6247 by airadier
Commented 2 unnecessary commands in moveinscreen
2796
	#set winy [winfo height $window]
2797
6243 by airadier
Damn window managers driving me mad with moveinscreen... It wasn't
2798
	set scrx [winfo screenwidth .]
2638 by lio_lion
added moveinscreen procedure
2799
	set scry [winfo screenheight .]
2800
6243 by airadier
Damn window managers driving me mad with moveinscreen... It wasn't
2801
 	if {[OnWin] } {
8816 by kakaroto
A more complete (although unused) getTaskBarHeight.. it gives the height of the top/bottom/left/right of the taskbar... it should be called only once at program startup to avoid problems...
2802
 		set tb [getTaskbarHeight]
2803
 		set scry [expr {$scry - [lindex $tb 0] - [lindex $tb 2]}]
2804
 		set scrx [expr {$scrx - [lindex $tb 1] - [lindex $tb 3]}]
2805
 	}
2806
7440 by kakaroto
Finally a fix to avoid having the prefs window (or any other huge window that uses moveinscreen to position a window) overlap with the window's taskbar. So now, the save and close buttons are visible from the very start.
2807
	#set wi_geometry [winfo geometry $window]
6246 by airadier
Use rootx and rooty instead of winfo geometry, as it works better on windows.
2808
	#scan $wi_geometry "%dx%d+%d+%d" winx winy winpx winpy
2809
6243 by airadier
Damn window managers driving me mad with moveinscreen... It wasn't
2810
	set winpx [winfo rootx $window]
6246 by airadier
Use rootx and rooty instead of winfo geometry, as it works better on windows.
2811
	set winpy [winfo rooty $window]
2812
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2813
	set geom [wm geometry $window]
6239 by airadier
Fixed preferences window being partially hidden by taskbar on Window$.
2814
	scan $geom "%dx%d%c%d%c%d" winx winy sign1 decorationLeft sign2 decorationTop
6242 by airadier
Some fixes in moveinscreen (¿¿¿¡¡¡damn wm geometry returning
2815
2816
	# Measure left edge, and assume all edges except top are the
6239 by airadier
Fixed preferences window being partially hidden by taskbar on Window$.
2817
	# same thickness
2818
	if { $sign1 == 45} { ;#'-' character
6243 by airadier
Damn window managers driving me mad with moveinscreen... It wasn't
2819
		#Get size from right decoration
2820
		set decorationThickness [expr {($scrx - $decorationLeft) - ($winpx + $winx)}]
2821
		status_log "Minus: dec=$decorationThickness --> ($scrx + $decorationLeft) - ($winpx + $winx)\n"
2822
	} else {
6242 by airadier
Some fixes in moveinscreen (¿¿¿¡¡¡damn wm geometry returning
2823
		set decorationThickness [expr {$winpx - $decorationLeft}]
2824
	}
2825
2826
	# Find titlebar and menubar thickness
6239 by airadier
Fixed preferences window being partially hidden by taskbar on Window$.
2827
	if { $sign2 == 45 } { ;#'-' character
6243 by airadier
Damn window managers driving me mad with moveinscreen... It wasn't
2828
		set menubarThickness [expr {($scry - $decorationLeft) - ($winpy + $winy)}]
2829
	} else {
6242 by airadier
Some fixes in moveinscreen (¿¿¿¡¡¡damn wm geometry returning
2830
		set menubarThickness [expr {$winpy - $decorationTop}]
2831
	}
2832
2833
2834
	#status_log "Window information: $window\n" white
6246 by airadier
Use rootx and rooty instead of winfo geometry, as it works better on windows.
2835
	#status_log "Geometry: $geom\n (menuThickness= $menubarThickness, dec=$decorationThickness)\n"
2836
	#status_log "Width, height: [winfo width $window]x[winfo height $window]\n"
2837
	#status_log "winPx, winPy: $winpx,$winpy\n"
2838
	#status_log "decLeft=$decorationLeft / decTop=$decorationTop\n"
2839
	#status_log "-------------------\n" white
2840
6243 by airadier
Damn window managers driving me mad with moveinscreen... It wasn't
2841
6242 by airadier
Some fixes in moveinscreen (¿¿¿¡¡¡damn wm geometry returning
2842
    	# Add this decoration size when checking size and limits
2843
	incr winx [expr {2 * $decorationThickness}]
6239 by airadier
Fixed preferences window being partially hidden by taskbar on Window$.
2844
	incr winy $decorationThickness
2845
	incr winy $menubarThickness
2846
	incr winpx [expr {0 - $decorationThickness}]
6243 by airadier
Damn window managers driving me mad with moveinscreen... It wasn't
2847
	incr winpy [expr {0 - $menubarThickness}]
2848
6239 by airadier
Fixed preferences window being partially hidden by taskbar on Window$.
2849
	#check if the window is too large to fit on the screen
2638 by lio_lion
added moveinscreen procedure
2850
	if { [expr {$winx > ($scrx-(2*$mindist))}] } {
4131 by gadget_boy
Add {} to all expressions
2851
		set winx [expr {$scrx-(2*$mindist)}]
2852
	}
2638 by lio_lion
added moveinscreen procedure
2853
	if { [expr {$winy > ($scry-(2*$mindist))}] } {
4131 by gadget_boy
Add {} to all expressions
2854
		set winy [expr {$scry-(2*$mindist)}]
2855
	}
2638 by lio_lion
added moveinscreen procedure
2856
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2857
	#check if the window is positioned off the screen
2638 by lio_lion
added moveinscreen procedure
2858
	if { [expr {$winpx + $winx > ($scrx-$mindist)}] } {
4131 by gadget_boy
Add {} to all expressions
2859
		set winpx [expr {$scrx-$mindist-$winx}]
2860
	}
2638 by lio_lion
added moveinscreen procedure
2861
	if { [expr {$winpx < $mindist}] } {
4131 by gadget_boy
Add {} to all expressions
2862
		set winpx $mindist
2638 by lio_lion
added moveinscreen procedure
2863
	}
2864
	if { [expr {$winpy + $winy > ($scry-(2*$mindist))}] } {
6239 by airadier
Fixed preferences window being partially hidden by taskbar on Window$.
2865
		set winpy [expr {$scry-$mindist-$winy}]
4131 by gadget_boy
Add {} to all expressions
2866
	}
2638 by lio_lion
added moveinscreen procedure
2867
	if { [expr {$winpy < $mindist}] } {
4131 by gadget_boy
Add {} to all expressions
2868
		set winpy $mindist
2638 by lio_lion
added moveinscreen procedure
2869
	}
2870
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2871
    	# Substract decoration size, as wm geometry needs the window geometry
6242 by airadier
Some fixes in moveinscreen (¿¿¿¡¡¡damn wm geometry returning
2872
    	# without decoration
2873
	incr winx [expr {0 - 2 * $decorationThickness}]
6239 by airadier
Fixed preferences window being partially hidden by taskbar on Window$.
2874
	incr winy [expr {0 - $decorationThickness}]
2875
	incr winy [expr {0 - $menubarThickness }]
2876
6243 by airadier
Damn window managers driving me mad with moveinscreen... It wasn't
2877
	catch {wm geometry $window "${winx}x${winy}+${winpx}+${winpy}"}
2878
}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2879
2880
proc advanced_options_reload {path} {
8236 by kakaroto
rename reload_advanced_options to advanced_options_reload.. makes it easier for autocompleting reload_files while debugging
2881
	global advanced_options
2805 by airadier
Removed an unsued "global gconfig"
2882
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2883
	set i 0
2884
	foreach opt $advanced_options {
2885
		incr i
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2886
		#For each advanced option, check if it's a title, it's local config, or global configs
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2887
		if {[lindex $opt 0] == "title" } {
2888
			if { $i != 1 } {
2889
				label $path.sp$i -font bboldf
2890
				label $path.l$i -font bboldf -text "[trans [lindex $opt 1]]"
2891
				pack $path.sp$i $path.l$i -side top -anchor w -pady 4
2892
			} else {
2893
				label $path.l$i -font bboldf -text "[trans [lindex $opt 1]]"
2894
				pack $path.l$i -side top -anchor w -pady 4
2895
			}
2896
		} else {
2897
			if {[lindex $opt 0] == "local"} {
2898
				set config_var [::config::getVar [lindex $opt 1]]
2899
			} elseif {[lindex $opt 0] == "global"} {
2900
				set config_var [::config::getGlobalVar [lindex $opt 1]]
2901
			} else {
2902
				label $path.l$i -text "ERROR: Unknown advanced option type: \"[lindex $opt 0]\""
2316 by airadier
Fixed typo in preferences
2903
				pack $path.l$i -side top -anchor w
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2904
				continue
2905
			}
2906
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2907
			switch [lindex $opt 2] {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2908
				bool {
2909
					checkbutton $path.cb$i -text [trans [lindex $opt 3]] -font splainf -variable $config_var
2910
					pack $path.cb$i -side top -anchor w
2911
				}
2912
				bool_inv {
4405 by kakaroto
new FT protocol now used by default.. might not work properly, needs ALOT of testing...thx
2913
					checkbutton $path.cb$i -text [trans [lindex $opt 3]] -font splainf -variable $config_var -onvalue 0 -offvalue 1
2914
					pack $path.cb$i -side top -anchor w
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2915
				}
4405 by kakaroto
new FT protocol now used by default.. might not work properly, needs ALOT of testing...thx
2916
				folder {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2917
					frame $path.fr$i
2918
					button $path.fr$i.browse -text [trans browse] -command "Browse_Dialog_dir [::config::getVar [lindex $opt 1]]"
2811 by lio_lion
Removed more global references to config
2919
					LabelEntry $path.fr$i.le "[trans [lindex $opt 3]]:" $config_var 20
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2920
					pack $path.fr$i.le -side left -anchor w -expand true -fill x
2921
					pack $path.fr$i.browse -side left
2922
					pack $path.fr$i -side top -anchor w -expand true -fill x
2923
				}
2924
				int {
2925
					LabelEntry $path.le$i "[trans [lindex $opt 3]]:" $config_var 20
2926
					$path.le$i.ent configure -validate focus -validatecommand "check_int %W" -invalidcommand "$path.le$i.ent delete 0 end; $path.le$i.ent insert end [set $config_var]"
2927
					pack $path.le$i -side top -anchor w -expand true -fill x
2928
				}
2929
				default {
2930
					LabelEntry $path.le$i "[trans [lindex $opt 3]]:" $config_var 20
2931
					pack $path.le$i -side top -anchor w -expand true -fill x
2932
				}
2933
			}
2934
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2935
			if { [lindex $opt 4] != "" } {
2240 by airadier
Change recent_message time to 2 seconds (it was 5!!).
2936
				label $path.exp$i -text "[trans [lindex $opt 4]]\n" -font examplef
2937
				pack $path.exp$i -side top -anchor w -padx 15
2938
			}
2939
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2940
		}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2941
2942
	}
2943
2944
}
2945
2946
2947
2948
proc check_int {text} {
2949
	set int_val "0"
2950
	catch { expr {int([$text get])} } int_val
2951
	if { $int_val != [$text get] } {
2952
		status_log "Bad!!\n"
2953
		return false
2954
	}
2955
	status_log "Good!!\n"
2956
	return true
2957
}
2958
2959
# This is where we fill in the Entries of the Preferences
2960
proc InitPref { {fullinit 0} } {
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
2961
	global Preftabs proxy_user proxy_pass pager locale_codes
8416 by baaazen
improved locale-selector and locale-autodetection
2962
	set nb .cfg.notebook
2228 by airadier
Moved preferences to use BWidget NoteBook.
2963
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
2964
	if { $fullinit } {
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
2965
		set proxy_user [::config::getKey proxyuser]
2966
		set proxy_pass [::config::getKey proxypass]
2967
	        set pager [::abook::getPersonal MOB]
3550 by kakaroto
fixed mobile information (MBE / MOB) in personal preferences tab (by foufou and kakaroto)
2968
		# Insert nickname if online, disable if offline
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
2969
		#set lfname [Rnotebook:frame $nb $Preftabs(personal)]
2970
		set lfname [$nb.nn getframe personal]
2971
		set lfname [$lfname.sw.sf getframe]
2972
5344 by kakaroto
refixing my fix... now tested and works
2973
		if { [::MSN::myStatusIs] == "FLN" } {
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
2974
			$lfname.lfname.1.name.entry configure -state disabled
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2975
			$lfname.lfname4.2.chgmob configure -state disabled
5344 by kakaroto
refixing my fix... now tested and works
2976
			$lfname.lfname4.2.person configure -state disabled
2977
		} else {
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
2978
			set nick [::abook::getPersonal MFN]
9090 by baaazen
store information about unverified email adresses and use information to lock the fields for changing nicks and for showing a notice in the contact
2979
			if {[::config::getKey emailVerified 1] == 0} {
2980
				set nick "$nick [trans emailnotverified]"
2981
			}
2982
2983
			$lfname.lfname.1.name.entry delete 0 end
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
2984
			$lfname.lfname.1.name.entry insert 0 $nick
9090 by baaazen
store information about unverified email adresses and use information to lock the fields for changing nicks and for showing a notice in the contact
2985
			if {[::config::getKey emailVerified 1] == 0} {
2986
				#disable nick change (email not yet verified)
2987
				$lfname.lfname.1.name.entry configure -state disabled
2988
			} else {
2989
				$lfname.lfname.1.name.entry configure -state normal
2990
			}
2991
5343 by kakaroto
oups...fixed a little bug I just introduced
2992
2993
			$lfname.lfname4.2.chgmob configure -state normal
5344 by kakaroto
refixing my fix... now tested and works
2994
			$lfname.lfname4.2.person configure -state normal
2995
		}
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
2996
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
2997
		if {[::config::getKey protocol] >= 11} {
8599 by billiob
add menu entries to change psm + an entry in prefs
2998
			$lfname.lfname.1.psm.entry delete 0 end
2999
			$lfname.lfname.1.psm.entry insert 0 [::abook::getPersonal PSM]
3000
		}
3001
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3002
		$lfname.lfname.1.p4c.entry delete 0 end
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3003
		$lfname.lfname.1.p4c.entry insert 0 [::config::getKey p4c_name]
3004
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3005
		if {[::config::getKey protocol] >= 18} {
8960 by kakaroto
change protocol 16 to 18, use MSNP18, fix differences between P16 and P18.. autojoin all our endpoints to a convo and add the ClientType in the UUX data
3006
			$lfname.lfname.1.ep.entry delete 0 end
8211 by kakaroto
Adding UI for the mpop.. you can now see in the top CL where you are connected and you can change the location name from the preferences, and you can sign out from each individual one or all of them...
3007
			$lfname.lfname.1.ep.entry insert 0 [::config::getKey epname aMSN]
3008
		}
3009
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3010
3011
		# Get My Phone numbers and insert them
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
3012
		set lfname "$lfname.lfname4"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3013
	    if { [::abook::getPersonal MBE] == "N" } {
3550 by kakaroto
fixed mobile information (MBE / MOB) in personal preferences tab (by foufou and kakaroto)
3014
		 $lfname.2.mobphone configure -state disabled
3015
	    }
3016
		if { [::MSN::myStatusIs] == "FLN" } {
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
3017
			$lfname.2.ephone1 configure -state disabled
3018
			$lfname.2.ephone31 configure -state disabled
3019
			$lfname.2.ephone32 configure -state disabled
3020
			$lfname.2.ephone41 configure -state disabled
3021
			$lfname.2.ephone42 configure -state disabled
3022
			$lfname.2.ephone51 configure -state disabled
3023
			$lfname.2.ephone52 configure -state disabled
3024
		        $lfname.2.mobphone configure -state disabled
3550 by kakaroto
fixed mobile information (MBE / MOB) in personal preferences tab (by foufou and kakaroto)
3025
		} else {
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
3026
			$lfname.2.ephone1 configure -state normal
3027
			$lfname.2.ephone31 configure -state normal
3028
			$lfname.2.ephone32 configure -state normal
3029
			$lfname.2.ephone41 configure -state normal
3030
			$lfname.2.ephone42 configure -state normal
3031
			$lfname.2.ephone51 configure -state normal
3032
			$lfname.2.ephone52 configure -state normal
3033
			$lfname.2.ephone1 delete 0 end
3034
			$lfname.2.ephone31 delete 0 end
3035
			$lfname.2.ephone32 delete 0 end
3036
			$lfname.2.ephone41 delete 0 end
3037
			$lfname.2.ephone42 delete 0 end
3038
			$lfname.2.ephone51 delete 0 end
3039
			$lfname.2.ephone52 delete 0 end
3040
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3041
			$lfname.2.ephone1 insert 0 [lindex [split [::abook::getPersonal PHH] " "] 0]
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
3042
			$lfname.2.ephone31 insert 0 [lindex [split [::abook::getPersonal PHH] " "] 1]
3043
			$lfname.2.ephone32 insert 0 [join [lrange [split [::abook::getPersonal PHH] " "] 2 end]]
3044
			$lfname.2.ephone41 insert 0 [lindex [split [::abook::getPersonal PHW] " "] 1]
3045
			$lfname.2.ephone42 insert 0 [join [lrange [split [::abook::getPersonal PHW] " "] 2 end]]
3046
			$lfname.2.ephone51 insert 0 [lindex [split [::abook::getPersonal PHM] " "] 1]
3047
			$lfname.2.ephone52 insert 0 [join [lrange [split [::abook::getPersonal PHM] " "] 2 end]]
3048
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3049
		    #$lframe.2.mobphone configure -variable [::abook::getPersonal MOB]
3550 by kakaroto
fixed mobile information (MBE / MOB) in personal preferences tab (by foufou and kakaroto)
3050
		}
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
3051
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3052
		# Init remote preferences
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
3053
		#set lfname [Rnotebook:frame $nb $Preftabs(connection)]
3054
		set lfname [$nb.nn getframe connection]
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3055
		set lfname [$lfname.sw.sf getframe]
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
3056
		$lfname.lfname3.2.pass delete 0 end
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3057
		$lfname.lfname3.2.pass insert 0 "[::config::getKey remotepassword]"
3058
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3059
	}
2895 by airadier
don't reset some things (like nick) in preferences, if called from cmsn_draw_online or cmsn_draw_offline
3060
8416 by baaazen
improved locale-selector and locale-autodetection
3061
	#fill the locales combobox
3062
	set lfname [$nb.nn getframe personal]
3063
	set lfname "[$lfname.sw.sf getframe].lfname2a"
3064
	$lfname.clocale list delete 0 end
3065
	set loc_item_id 0
3066
	set loc_item_selected 0
3067
	foreach loc_item $locale_codes {
3068
		set loc_name [lindex $loc_item 0]
3069
		set loc_id [lindex $loc_item 1]
3070
		$lfname.clocale list insert end $loc_name
3071
		if {$loc_id == [::config::getKey localecode [::config::getKey localecode_autodetect 1033]]} {
3072
			set loc_item_selected $loc_item_id
3073
		}
3074
		incr loc_item_id
3075
	}
3076
	$lfname.clocale select $loc_item_selected
3077
	$lfname.clocale configure -editable false
3078
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3079
	# Lets fill our profile combobox
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3080
	#set lfname [Rnotebook:frame $nb $Preftabs(others)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
3081
	set lfname [$nb.nn getframe others]
3082
	set lfname "[$lfname.sw.sf getframe].lfname3"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3083
   	set idx 0
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3084
   	set tmp_list ""
3085
	$lfname.1.profile list delete 0 end
3086
   	while { [LoginList get $idx] != 0 } {
3087
		lappend tmp_list [LoginList get $idx]
3088
		incr idx
3089
	}
3090
   	eval $lfname.1.profile list insert end $tmp_list
3091
	$lfname.1.profile insert 0 [lindex $tmp_list 0]
3092
   	unset idx
3093
   	unset tmp_list
3094
	$lfname.1.profile configure -editable false
3095
3096
	# Lets disable loging if on default profile
3097
	if { [LoginList exists 0 [::config::getKey login]] == 0 } {
2799 by lio_lion
Removed all occurrences of $config global variable, use ::config::getKey and ::config::setKey instead
3098
		#set lfname [Rnotebook:frame $nb $Preftabs(loging)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
3099
		set lfname [$nb.nn getframe loging]
3100
		set lfname [$lfname.sw.sf getframe]
6984 by kakaroto
patch by Zaskar, fixes bug with prefs window when using default profile. (http://www.amsn-project.net/forums/viewtopic.php?t=2927)
3101
		set lfname "$lfname.lfname"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3102
		$lfname.log configure -state disabled
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3103
		$lfname.camlog configure -state disabled
8817 by kakaroto
omg! disable webcam logs when using the default profile!
3104
		set lfname [$nb.nn getframe loging]
2948 by gadget_boy
Eventlogging is now disabled when there is no profile
3105
		set lfname [$lfname.sw.sf getframe]
6984 by kakaroto
patch by Zaskar, fixes bug with prefs window when using default profile. (http://www.amsn-project.net/forums/viewtopic.php?t=2927)
3106
		set lfname "$lfname.lfname3"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3107
		$lfname.logconnect configure -state disabled
2948 by gadget_boy
Eventlogging is now disabled when there is no profile
3108
		$lfname.logdisconnect configure -state disabled
3109
		$lfname.logemail configure -state disabled
3110
		$lfname.logstate configure -state disabled
3111
		$lfname.lognick configure -state disabled
7568 by kakaroto
Thanks to Thanatermesis for pointing this bug out. default profile allowed logevent for nick and psm, and it made amsn bug if they were enabled because we don't check if the fileid is != from 0
3112
		$lfname.logpsm configure -state disabled
3113
	}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3114
3115
	# Let's fill our list of States
3116
	#set lfname [Rnotebook:frame $nb $Preftabs(session)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
3117
	set lfname [$nb.nn getframe session]
3118
	set lfname [$lfname.sw.sf getframe]
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3119
	$lfname.lfname2.statelist.box delete 0 end
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3120
	for { set idx 0 } { $idx < [StateList size] } {incr idx } {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3121
		$lfname.lfname2.statelist.box insert end [lindex [StateList get $idx] 0]
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3122
	}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3123
3124
        # Fill the user's lists
3125
        #set lfname [Rnotebook:frame $nb $Preftabs(privacy)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
3126
	set lfname [$nb.nn getframe privacy]
3127
	set lfname [$lfname.sw.sf getframe]
6961 by kakaroto
FINALLY have the privacy tab work for all resolutions.. I just added a ScrolledWindow on top of it! no more complaints, yeay!!!!
3128
        Fill_users_list "$lfname.lfname" "$lfname.lfname2"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3129
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3130
}
3131
3132
3133
# This is where the preferences entries get enabled disabled
3134
proc UpdatePreferences {} {
3135
	global Preftabs
2799 by lio_lion
Removed all occurrences of $config global variable, use ::config::getKey and ::config::setKey instead
3136
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3137
	set nb .cfg.notebook
2228 by airadier
Moved preferences to use BWidget NoteBook.
3138
7368 by lephilousophe
Better organization for contact font managment
3139
	#fonts
3140
	set lfname [$nb.nn getframe personal]
3141
	set lfname [$lfname.sw.sf getframe]
3142
	set lfname "${lfname}.lfname3"
3143
	if { [::config::getKey disableuserfonts] } {
3144
			$lfname.bfontin configure -state disabled
3145
			$lfname.bfontinreset configure -state disabled
3146
	} else {
3147
		$lfname.bfontin configure -state normal
3148
		if { [::config::getKey theirchatfont] == "" } {
3149
			$lfname.bfontinreset configure -state disabled
3150
		} else {
3151
			$lfname.bfontinreset configure -state normal
3152
		}
3153
	}
3154
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3155
	# autoaway checkbuttons and entries
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3156
	#set lfname [Rnotebook:frame $nb $Preftabs(session)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
3157
	set lfname [$nb.nn getframe session]
3158
	set lfname [$lfname.sw.sf getframe]
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3159
	set lfname "${lfname}.lfname"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3160
	if { [::config::getKey autoidle] == 0 } {
2799 by lio_lion
Removed all occurrences of $config global variable, use ::config::getKey and ::config::setKey instead
3161
		$lfname.1.eautonoact configure -state disabled
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3162
	} else {
3163
		$lfname.1.eautonoact configure -state normal
3164
	}
3165
	if { [::config::getKey autoaway] == 0 } {
2799 by lio_lion
Removed all occurrences of $config global variable, use ::config::getKey and ::config::setKey instead
3166
		$lfname.2.eautoaway configure -state disabled
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3167
	} else {
3168
		$lfname.2.eautoaway configure -state normal
3169
	}
3170
3171
	# proxy connection entries and checkbuttons
3172
	#set lfname [Rnotebook:frame $nb $Preftabs(connection)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
3173
	set lfname [$nb.nn getframe connection]
3174
	set lfname [$lfname.sw.sf getframe]
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3175
	set lfname "${lfname}.lfnameconnection"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3176
	if { [::config::getKey connectiontype] == "proxy" } {
2799 by lio_lion
Removed all occurrences of $config global variable, use ::config::getKey and ::config::setKey instead
3177
		$lfname.4.post configure -state normal
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3178
		$lfname.4.ssl configure -state disable
2488 by airadier
Disable SSL and socks5 proxy for the moment
3179
		$lfname.4.socks5 configure -state normal
4520 by lephilousophe
-Fixed some issue when generating GUIDs
3180
		$lfname.5.server configure -state normal
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3181
		$lfname.5.port configure -state normal
3182
		if { [::config::getKey proxytype] == "socks5" || [::config::getKey proxytype] == "http"} {
2799 by lio_lion
Removed all occurrences of $config global variable, use ::config::getKey and ::config::setKey instead
3183
			$lfname.5.user configure -state normal
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3184
			$lfname.5.pass configure -state normal
3185
		} else {
3186
			$lfname.5.user configure -state disabled
3187
			$lfname.5.pass configure -state disabled
3188
		}
3189
	} else {
3190
		$lfname.4.post configure -state disabled
3191
		$lfname.4.ssl configure -state disabled
3192
		$lfname.4.socks5 configure -state disabled
3193
		$lfname.5.server configure -state disabled
3194
		$lfname.5.port configure -state disabled
3195
		$lfname.5.user configure -state disabled
3196
		$lfname.5.pass configure -state disabled
3197
	}
3198
	#set lfname [Rnotebook:frame $nb $Preftabs(connection)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
3199
	set lfname [$nb.nn getframe connection]
3200
	set lfname [$lfname.sw.sf getframe]
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3201
	set lfname "${lfname}.lfname"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3202
	if { [::config::getKey autoftip] } {
2799 by lio_lion
Removed all occurrences of $config global variable, use ::config::getKey and ::config::setKey instead
3203
		$lfname.1.ipaddr.entry configure -textvariable "" -text "Hola"
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3204
		$lfname.1.ipaddr.entry delete 0 end
3205
		$lfname.1.ipaddr.entry insert end [::config::getKey myip]
2799 by lio_lion
Removed all occurrences of $config global variable, use ::config::getKey and ::config::setKey instead
3206
		$lfname.1.ipaddr.entry configure -state disabled
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3207
	} else {
3208
		$lfname.1.ipaddr.entry configure -state normal -textvariable [::config::getVar manualip]
2806 by lio_lion
Removed -textvariable config(...) replaced with -variable [::config::getVar ...]
3209
	}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3210
3211
	# remote control
3212
	#set lfname [Rnotebook:frame $nb $Preftabs(connection)]
2228 by airadier
Moved preferences to use BWidget NoteBook.
3213
	set lfname [$nb.nn getframe connection]
3214
	set lfname [$lfname.sw.sf getframe]
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3215
	set lfname "${lfname}.lfname3"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3216
	if { [::config::getKey enableremote] == 1 } {
2799 by lio_lion
Removed all occurrences of $config global variable, use ::config::getKey and ::config::setKey instead
3217
		$lfname.2.pass configure -state normal
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3218
	} else {
3219
		$lfname.2.pass configure -state disabled
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3220
	}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3221
3222
	# sound
2686 by lio_lion
added an option to use the Snack library for sounds
3223
	set lfname [$nb.nn getframe others]
3224
	set lfname [$lfname.sw.sf getframe]
3225
	set lfname "${lfname}.lfname"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3226
	#Disabled that if we are on Mac OS X because we can't choose Snack
2856 by germinator2000
Disable snack on Mac OS X and fig bug with preferences window on Mac
3227
	if { ![OnMac] } {
6174 by thaven
This one is a messy diff.... but I did it a few days ago and didn't catch any bugs yet, so I think it's quite safe to commit.
3228
		if { [::config::getKey usesnack] == 1 } {
2856 by germinator2000
Disable snack on Mac OS X and fig bug with preferences window on Mac
3229
			#load Snack when being used
3230
			if {![catch {require_snack}]} {
6397 by kakaroto
ok, a few changes here... I make sure to load the shipped version of snack for windows and mac + it removed the 'version compatibility' error you get because of providing 2.2.10 in one place (snack.tcl) and providing 2.2 in another place (inside the .dll/.dylib). I also changed that for every 'package require snack' inside of amsn's code. I also fixed the 2.2 vs. 2.2.10 package require/provide..
3231
				$lfname.1.sound.sound configure -state disabled
2856 by germinator2000
Disable snack on Mac OS X and fig bug with preferences window on Mac
3232
				snack::audio playLatency 750
3233
			} else {
3234
				::config::setKey usesnack 0
3235
				$lfname.1.sound.sound configure -state normal
3236
				msg_box [trans snackfailed]
3237
			}
3238
		} else {
2738 by germinator2000
Don't use snack on Mac OS X for the preferences
3239
			$lfname.1.sound.sound configure -state normal
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3240
		}
2738 by germinator2000
Don't use snack on Mac OS X for the preferences
3241
	}
2686 by lio_lion
added an option to use the Snack library for sounds
3242
3243
}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3244
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3245
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3246
# This function sets all fonts to plain instead of bold,
3247
# excluding the ones that are set to sboldf or examplef
3248
proc setCfgFonts {path value} {
3249
	catch {set res [$path cget -font]}
3250
	if { [info exists res] } {
3251
		if { $res != "sboldf" && $res != "examplef" && $res != "bboldf"} {
3252
		    catch { $path configure -font $value }
5585 by tjikkun
-bug trace now will appear in bug window correctly in tcl8.5
3253
		}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3254
	}
3255
        foreach child [winfo children $path] {
3256
            setCfgFonts $child $value
3257
        }
3258
}
3259
3260
3261
3262
proc SavePreferences {} {
3263
	global auto_path HOME2 tlsinstalled
6432 by jonne_z
Merged tip_tcl_278 branch into trunk.
3264
	global myconfig proxy_server proxy_port list_BLP temp_BLP Preftabs libtls proxy_user proxy_pass pager locale_codes
8416 by baaazen
improved locale-selector and locale-autodetection
3265
2805 by airadier
Removed an unsued "global gconfig"
3266
	set nb .cfg.notebook
3267
4955 by kakaroto
fixed the NS problem (bug 1357602)
3268
	# If the default ns server changed, change the start_ns_server too.
3269
	if { [::config::getKey default_ns_server] != [set myconfig(default_ns_server)] } {
3270
		::config::setKey start_ns_server [::config::getKey default_ns_server]
3271
	}
3272
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3273
	# I. Data Validation & Metavariable substitution
2805 by airadier
Removed an unsued "global gconfig"
3274
	# Proxy settings
3275
	set p_server [string trim $proxy_server]
3276
	set p_port [string trim $proxy_port]
3277
	if { ![string is integer -strict $p_port] } {
2981 by airadier
Fix proxy port when it's not an integer
3278
		set p_port 8080
3279
	}
3280
	set p_user [string trim $proxy_user]
2805 by airadier
Removed an unsued "global gconfig"
3281
	set p_pass [string trim $proxy_pass]
3282
3283
	::config::setKey proxy [list $p_server $p_port]
3284
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3285
	if { ($p_pass != "") && ($p_user != "")} {
3286
		::config::setKey proxypass $p_pass
2805 by airadier
Removed an unsued "global gconfig"
3287
		::config::setKey proxyuser $p_user
3288
		::config::setKey proxyauthenticate 1
3289
	} else {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3290
		::config::setKey proxypass ""
2805 by airadier
Removed an unsued "global gconfig"
3291
		::config::setKey proxyuser ""
3292
		::config::setKey proxyauthenticate 0
3293
	}
2799 by lio_lion
Removed all occurrences of $config global variable, use ::config::getKey and ::config::setKey instead
3294
3295
	if {![string is digit [::config::getKey initialftport]] || [string length [::config::getKey initialftport]] == 0 } {
3296
		::config::setKey initialftport 6891
3297
	}
3298
3299
	# Make sure entries x and y offsets and idle time are digits, if not revert to old values
2805 by airadier
Removed an unsued "global gconfig"
3300
	if { [string is digit [::config::getKey notifyXoffset]] == 0 } {
3301
		::config::setKey notifyXoffset $myconfig(notifyXoffset)
3302
	}
3303
	if { [string is digit [::config::getKey notifyYoffset]] == 0 } {
3304
		::config::setKey notifyYoffset $myconfig(notifyYoffset)
3305
	}
3306
	if { [string is digit [::config::getKey idletime]] == 0 } {
3307
		::config::setKey idletime $myconfig(idletime)
3308
	}
3309
	if { [string is digit [::config::getKey awaytime]] == 0 } {
3310
		::config::setKey awaytime $myconfig(awaytime)
3311
	}
3312
	if { [::config::getKey idletime] >= [::config::getKey awaytime] } {
3313
		::config::setKey awaytime $myconfig(awaytime)
3314
		::config::setKey idletime $myconfig(idletime)
3315
	}
3316
3317
	# write correct locale code to config
8416 by baaazen
improved locale-selector and locale-autodetection
3318
	set lfname [$nb.nn getframe personal]
3319
	set lfname "[$lfname.sw.sf getframe].lfname2a"
3320
	set loc_item_selected [$lfname.clocale curselection]
3321
	status_log "selected item: $loc_item_selected" red
3322
	::config::setKey localecode [lindex [lindex $locale_codes $loc_item_selected] 1]
3323
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3324
	# Check and save phone numbers
2805 by airadier
Removed an unsued "global gconfig"
3325
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3326
	if { [::MSN::myStatusIs] != "FLN" && 1 == 0} {
3327
		#set lfname [Rnotebook:frame $nb $Preftabs(personal)]
2805 by airadier
Removed an unsued "global gconfig"
3328
		set lfname [$nb.nn getframe personal]
3329
		set lfname [$lfname.sw.sf getframe]
3330
		set lfname "$lfname.lfname4"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3331
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3332
		set cntrycode [$lfname.2.ephone1 get]
2805 by airadier
Removed an unsued "global gconfig"
3333
		if { [string is digit $cntrycode] == 0 } {
3334
			set cntrycode [lindex [split [::abook::getPersonal PHH] " "] 0]
3335
		}
3336
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3337
		append home [$lfname.2.ephone31 get] " " [$lfname.2.ephone32 get]
2805 by airadier
Removed an unsued "global gconfig"
3338
		if { [string is digit [$lfname.2.ephone31 get]] == 0 } {
3339
			set home [join [lrange [split [::abook::getPersonal PHH] " "] 1 end]]
3340
		}
3341
		append work [$lfname.2.ephone41 get] " " [$lfname.2.ephone42 get]
3342
		if { [string is digit [$lfname.2.ephone41 get]] == 0 } {
3343
			set work [join [lrange [split [::abook::getPersonal PHW] " "] 1 end]]
3344
		}
3345
		append mobile [$lfname.2.ephone51 get] " " [$lfname.2.ephone52 get]
3346
		if { [string is digit [$lfname.2.ephone51 get]] == 0 } {
3347
			set mobile [join [lrange [split [::abook::getPersonal PHM] " "] 1 end]]
3348
		}
3349
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3350
		set home [urlencode [set home "$cntrycode $home"]]
2805 by airadier
Removed an unsued "global gconfig"
3351
		set work [urlencode [set work "$cntrycode $work"]]
3352
		set mobile [urlencode [set mobile "$cntrycode $mobile"]]
3353
		if { $home != [::abook::getPersonal PHH] } {
3354
			::abook::setPhone home $home
3355
		}
3356
		if { $work != [::abook::getPersonal PHW] } {
3357
			::abook::setPhone work $work
3358
		}
3359
		if { $mobile != [::abook::getPersonal PHM] } {
4110 by airadier
Working in preferences window
3360
			::abook::setPhone mobile $mobile
2805 by airadier
Removed an unsued "global gconfig"
3361
		}
3362
		if {$pager != [::abook::getPersonal MOB] } {
3550 by kakaroto
fixed mobile information (MBE / MOB) in personal preferences tab (by foufou and kakaroto)
3363
			::abook::setPhone pager $pager
3364
		}
2805 by airadier
Removed an unsued "global gconfig"
3365
6438 by lephilousophe
Retest the connection when saving prefs
3366
		::abook::getIPConfig
3367
	}
2805 by airadier
Removed an unsued "global gconfig"
3368
3369
	# Change name
3370
	#set lfname [Rnotebook:frame $nb $Preftabs(personal)]
3371
	set lfname [$nb.nn getframe personal]
3372
	set lfname [$lfname.sw.sf getframe]
3373
	set lfname "$lfname.lfname.1"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3374
	set new_name [$lfname.name.entry get]
2805 by airadier
Removed an unsued "global gconfig"
3375
	if {$new_name != "" && $new_name != [::abook::getPersonal MFN] && [::MSN::myStatusIs] != "FLN" && [::config::getKey emailVerified 1] == 1} {
9090 by baaazen
store information about unverified email adresses and use information to lock the fields for changing nicks and for showing a notice in the contact
3376
		::MSN::changeName $new_name
8288 by kakaroto
Add support for content roaming (nickname+psm.. not dp.. for now)
3377
	}
2805 by airadier
Removed an unsued "global gconfig"
3378
	if {[::config::getKey protocol] >= 11} {
8599 by billiob
add menu entries to change psm + an entry in prefs
3379
		set new_psm [$lfname.psm.entry get]
3380
		if {$new_psm != "" && $new_psm != [::abook::getPersonal PSM] && [::MSN::myStatusIs] != "FLN"} {
3381
			::MSN::changePSM $new_psm
3382
		}
3383
	}
3384
	::config::setKey p4c_name [$lfname.p4c.entry get]
2315 by kakaroto
added P4C support
3385
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3386
	if {[::config::getKey protocol] >= 18} {
8960 by kakaroto
change protocol 16 to 18, use MSNP18, fix differences between P16 and P18.. autojoin all our endpoints to a convo and add the ClientType in the UUX data
3387
		::MSN::changeEndPointName [$lfname.ep.entry get]
8211 by kakaroto
Adding UI for the mpop.. you can now see in the top CL where you are connected and you can change the location name from the preferences, and you can sign out from each individual one or all of them...
3388
	}
3389
3390
	# Get remote controlling preferences
2805 by airadier
Removed an unsued "global gconfig"
3391
	#set lfname [Rnotebook:frame $nb $Preftabs(connection)]
3392
	set lfname [$nb.nn getframe connection]
3393
	set lfname [$lfname.sw.sf getframe]
3394
	set myconfig(remotepassword) "[$lfname.lfname3.2.pass get]"
5193 by kakaroto
Using Tk labelframe instead of deprecated code for LabelFrame; NEEDS TESTING
3395
	::config::setKey remotepassword $myconfig(remotepassword)
2805 by airadier
Removed an unsued "global gconfig"
3396
3397
	#Copy to myconfig array, because when the window is closed, these will be restored (RestorePreferences)
3398
	array set myconfig [::config::getAll]
3399
3400
	# Save configuration of the BLP ( Allow all other users to see me online )
3401
	if { $list_BLP != $temp_BLP } {
3402
		AllowAllUsers $temp_BLP
3403
	}
3404
3405
3406
	# Save tls package configuration
3407
	if { [::config::getKey libtls_temp] != $libtls } {
2992 by gadget_boy
Switch TLS and received files directory in the preferences
3408
		set libtls [::config::getKey libtls_temp]
3409
		if { $libtls != "" && [lsearch $auto_path $libtls] == -1 } {
2805 by airadier
Removed an unsued "global gconfig"
3410
			lprepend auto_path $libtls
7723 by kakaroto
addition and use of lprepend instead of lappend for auto_path in order to avoid conflicts when other versions of the provided are installed on the system. For example most users have tcllib 1.9 which has an old version of snit that uses {expand} instead of {*}, so all tcl/tk 8.5 users get an error starting amsn
3411
		}
2805 by airadier
Removed an unsued "global gconfig"
3412
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3413
		if { $tlsinstalled == 0 && [catch {package require tls}] } {
2805 by airadier
Removed an unsued "global gconfig"
3414
			# Either tls is not installed, or $auto_path does not point to it.
3415
			# Should now never happen; the check for the presence of tls is made
3416
			# before this point.
3417
			status_log "Could not find the package tls on this system.\n"
3418
			set tlsinstalled 0
3419
		} else {
3420
			set tlsinstalled 1
3421
		}
3422
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3423
		set fd [open [file join $HOME2 tlsconfig.tcl] w]
2805 by airadier
Removed an unsued "global gconfig"
3424
		puts $fd "set libtls [list $libtls]"
3425
		close $fd
3426
	}
3427
3428
3429
	# Blocking
3430
	#if { [::config::getKey blockusers] == "" } { ::config::setKey blockusers 1}
3431
	#if { [::config::getKey checkblocking] == 1 } {
3432
		#BeginVerifyBlocked [::config::getKey blockinter1] [::config::getKey blockinter2] [::config::getKey blockusers] [::config::getKey blockinter3]
3433
	#} else {
3434
		#StopVerifyBlocked
3435
	#}
3436
3437
	# Save configuration.
3438
	save_config
3439
	::MSN::contactListChanged
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3440
	::config::saveGlobal
2805 by airadier
Removed an unsued "global gconfig"
3441
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3442
	if { [::MSN::myStatusIs] != "FLN" } {
2805 by airadier
Removed an unsued "global gconfig"
3443
		cmsn_draw_online 0 1
6790 by lephilousophe
Remove more cmsn_draw_online
3444
	}
2805 by airadier
Removed an unsued "global gconfig"
3445
5127 by kakaroto
Added the auto-start option for windows users
3446
	if { [info exists ::start_on_windows_boot] } {
3447
		WinRegKey $::start_on_windows_boot
3448
        }
3449
6520 by lephilousophe
Implemented smiley setting for newCL
3450
	::Event::fireEvent changedPreferences gui
3451
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3452
	#Reset the banner incase the option changed
2805 by airadier
Removed an unsued "global gconfig"
3453
	resetBanner
3454
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3455
	#Reload the trayicon in case it got changed
4729 by scapor
Remove the tray submene, making it 1 option .. needs testing on windows
3456
	init_dock
3457
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3458
4729 by scapor
Remove the tray submene, making it 1 option .. needs testing on windows
3459
}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3460
3461
proc RestorePreferences { {win ".cfg"} } {
3462
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3463
	if { $win != ".cfg" } { return }
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3464
3465
	global myconfig proxy_server proxy_port
2799 by lio_lion
Removed all occurrences of $config global variable, use ::config::getKey and ::config::setKey instead
3466
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3467
	::config::setAll [array get myconfig]
2805 by airadier
Removed an unsued "global gconfig"
3468
	array unset myconfig
9018 by kakaroto
Fix the 'Close' button of the preferences not to save the config... the array unset must be called inside the RestorePreferences because the Destroy event is called on every subwidget first... Thanks to murdok for reporting
3469
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3470
	# Save configuration.
2805 by airadier
Removed an unsued "global gconfig"
3471
	save_config
3472
	::MSN::contactListChanged
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3473
	::config::saveGlobal
2805 by airadier
Removed an unsued "global gconfig"
3474
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3475
	if { [::MSN::myStatusIs] != "FLN" } {
2805 by airadier
Removed an unsued "global gconfig"
3476
		cmsn_draw_online 0 1
6790 by lephilousophe
Remove more cmsn_draw_online
3477
	}
3478
3479
	::Event::fireEvent changedPreferences gui
3480
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3481
	#::MSN::WriteSB ns "SYN" "0"
2805 by airadier
Removed an unsued "global gconfig"
3482
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3483
	# Save configuration.
3484
	#save_config
3485
3486
}
3487
3488
###################### Other Features     ###########################
3489
3490
# Usage: LabelEntry .mypath.mailer "Label:" config(mailcommand) 20
3491
proc LabelEntry { path lbl variable width } {
3492
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3493
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3494
    frame $path
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
3495
	label $path.lbl -text $lbl -justify left \
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3496
	    -font splainf
3497
	entry $path.ent -textvariable $variable  \
3921 by germinator2000
Adding new arrow for combobox
3498
	    -width $width -font splainf
7626 by billiob
HUGE skins improvements thanks to Nuitari (from the forums)
3499
	pack $path.lbl -side left -anchor e
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3500
	pack $path.ent -side left -anchor e -expand 1 -fill x -padx 3
3501
#	pack $path.ent $path.lbl -side right -anchor e -expand 1 -fill x
3502
}
3503
3504
proc LabelEntryGet { path } {
3505
    return [$path.ent get]
3506
}
3507
3508
3509
proc BlockValidateEntry { widget data type {correct 0} } {
3510
3511
    switch  $type  {
3512
	0 {
3513
	    if { [string is integer  $data] } {
3514
		$widget delete 0 end
3515
		$widget insert 0 "$correct"
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3516
		after idle "$widget configure -validate all"
5585 by tjikkun
-bug trace now will appear in bug window correctly in tcl8.5
3517
	    }
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3518
	}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3519
	1 {
3520
	    if { [string is integer  $data] } {
3521
		if { $data < 15 } {
3522
		    return 0
3523
		}
3524
		return 1
3525
	    } else {return 0}
3526
	}
3527
	2 {
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3528
	    if { [string is integer $data] } {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3529
		if { $data < 30 } {
3530
		    return 0
3531
		}
3532
		return 1
3533
	    } else {return 0}
3534
	}
3535
	3 {
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3536
	    if { [string is integer   $data] } {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3537
		if { $data < 2 } {
3538
		    return 0
3539
		}
3540
		return 1
3541
	    } else {return 0}
3542
	}
3543
	4 {
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3544
	    if { [string is integer  $data] } {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3545
		if { $data > 5 } {
3546
		    return 0
3547
		}
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3548
		return 1
3549
	    } else {return 0}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3550
	}
3551
    }
3552
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3553
}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3554
3555
3556
#proc Browse_Dialog {}
3557
#Browse dialog function (used in TLS directory and convert file), first show the dialog (choose folder or choose file), after check if user choosed something, if yes, set the new variable
3558
proc Browse_Dialog_dir {configitem {initialdir ""}} {
3559
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3560
	if { $initialdir == "" } {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3561
		set initialdir [set $configitem]
3562
	}
3563
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3564
	if { ![file isdirectory $initialdir]} {
2743 by airadier
Additional checks on initialdir for file dialogs
3565
		set initialdir [pwd]
3566
	}
3567
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3568
	catch { set parent [focus]}
7806 by kakaroto
-parent [focus] where no window has focus causes a bug because "" is in invalid window.
3569
	if {![info exists parent] || $parent == "" } {
3570
		set parent .
3571
	}
3572
	set browsechoose [tk_chooseDirectory -parent $parent -initialdir $initialdir]
3573
	if { $browsechoose !="" } {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3574
		set $configitem $browsechoose
3575
	}
3576
}
3577
3578
proc Browse_Dialog_file {configitem {initialfile ""}} {
3579
2992 by gadget_boy
Switch TLS and received files directory in the preferences
3580
	if { $initialfile == "" } {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3581
		set initialfile [set $configitem]
3582
	}
3583
2849 by airadier
Fixed a bug when initialfile doesn't exist on mac
3584
	if { ![file exists $initialfile] } {
3585
		set initialfile ""
3586
	}
3587
7806 by kakaroto
-parent [focus] where no window has focus causes a bug because "" is in invalid window.
3588
	catch { set parent [focus]}
3589
	if {![info exists parent] || $parent == "" } {
3590
		set parent .
3591
	}
3592
	set browsechoose [tk_getOpenFile -parent $parent -initialfile $initialfile]
3593
	if { $browsechoose !="" } {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3594
		set $configitem $browsechoose
3595
	}
3596
}
3597
3598
#///////////////////////////////////////////////////////////////////////
3599
proc choose_basefont { } {
3600
	if { [winfo exists .basefontsel] } {
3601
		raise .basefontsel
3602
		return
3603
	}
3604
3605
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3606
	if { [catch {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3607
			set font [SelectFont .basefontsel -parent .cfg -title [trans choosebasefont] -font [::config::getGlobalKey basefont] -styles [list]]
3608
		}]} {
3609
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3610
		set font [SelectFont .basefontsel -parent .cfg -title [trans choosebasefont] -font [list "helvetica" 12 [list]] -styles [list]]
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3611
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3612
	}
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3613
3614
	set family [lindex $font 0]
3615
	set size [lindex $font 1]
3616
9889 by alexandernst
Don't save home/work/mobile/pager numbers. Sending PRP PHH/PHW/PHM/MOB will result in 715 always.
3617
	if { $family == "" || $size == ""} {
2223 by airadier
Renaming ctdegt.tcl preferences.tcl
3618
		return
3619
	}
3620
3621
	set newfont [list $family $size normal]
3622
3623
	if { $newfont != [::config::getGlobalKey basefont]} {
3624
		::config::setGlobalKey basefont $newfont
3625
		focus .cfg
3626
		msg_box [trans mustrestart]
3627
	}
3628
3629
}
3630
#///////////////////////////////////////////////////////////////////////
3631
6425 by tjikkun
youness says it is better this way :) Now I guess we still need to detect if it is just amsn-project.net that is down or that we really have a configuration issue?
3632
#///////////////////////////////////////////////////////////////////////
7637 by tomhennigan
Fix an issue with duplicate entries of a preferences menu item.
3633
# Since Tk 8.4.14 the Preferences AppleMenu item is hardcoded by TkAqua.
7638 by billiob
fix previous commit about the ::tk::mac::ShowPreference issue.
3634
# When the menu item is pressed, it calls ::tk::mac::ShowPreferences.
3635
if {[OnMac] && [version_vcompare [info patchlevel] 8.4.14] >= 0 } {
7642 by thaven
Fix the fix for double preferences item ;-)
3636
    proc ::tk::mac::ShowPreferences {} {
3637
        after 0 [list Preferences]
9403 by kakaroto
afaik, this is typo fix
3638
    }
7642 by thaven
Fix the fix for double preferences item ;-)
3639
}
7638 by billiob
fix previous commit about the ::tk::mac::ShowPreference issue.
3640
#///////////////////////////////////////////////////////////////////////
7637 by tomhennigan
Fix an issue with duplicate entries of a preferences menu item.
3641