File: Config_Win.py

package info (click to toggle)
xpn 1.2.6-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 2,500 kB
  • ctags: 1,685
  • sloc: python: 12,693; xml: 206; makefile: 16; sh: 1
file content (1393 lines) | stat: -rw-r--r-- 67,170 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
import gtk
import pango
import gobject
import webbrowser
import os
import gettext
import ConfigParser
from xpn_src.Config_File import Config_File
from xpn_src.add_tag import Tags_Window
from xpn_src.Charset_List import encodings_list, encodings_tip, CharsetList
from xpn_src.Headers_List import HeadersList
from xpn_src.UserDir import get_wdir
from xpn_src.Connections_Handler import Connection, SSLConnection
from xpn_src.Server_Win import NNTPServer_Win
from xpn_src.ID_Win import ID_Win


class Config_Win:
    def show(self):
        self.win.show_all()

    def delete_event(self,widget,event,data=None):
        return False

    def destroy(self,obj):
        self.win.destroy()


    def gdkcolor_to_hex(self,gdk_color):
        colors=[gdk_color.red,gdk_color.green,gdk_color.blue]
        colors= [("0"+str(hex(col*255/65535))[2:])[-2:].upper() for col in (colors)]
        color = "#"+colors[0]+colors[1]+colors[2]
        return color

    def update_text_color_entry(self,obj):
        color=obj.get_color()
        color=self.gdkcolor_to_hex(color)
        if obj==self.text_color_button:
            self.apply_text_color(self.text_color_entry,obj,color)
        elif obj==self.quote1_color_button:
            self.apply_text_color(self.quote1_color_entry,obj,color)
        elif obj==self.quote2_color_button:
            self.apply_text_color(self.quote2_color_entry,obj,color)
        elif obj==self.quote3_color_button:
            self.apply_text_color(self.quote3_color_entry,obj,color)
        elif obj==self.sign_color_button:
            self.apply_text_color(self.sign_color_entry,obj,color)
        elif obj==self.url_color_button:
            self.apply_text_color(self.url_color_entry,obj,color)
        else:
            self.apply_text_color(self.headers_color_entry,obj,color)


    def update_back_color_entry(self,obj):
        color=obj.get_color()
        color=self.gdkcolor_to_hex(color)
        self.apply_back_color(obj,color)

    def apply_text_color(self,widget,button,color):
        style=widget.get_style().copy()
        gdk_color=gtk.gdk.color_parse(color)
        style.text[gtk.STATE_NORMAL]=gdk_color
        button.set_color(gdk_color)
        widget.set_style(style)

    def apply_back_color(self,button,color):
        if not button==self.headers_bg_color_button:
            style=self.text_color_entry.get_style().copy()
            gdk_color=gtk.gdk.color_parse(color)
            style.base[gtk.STATE_NORMAL]=gdk_color
            self.text_color_entry.set_style(style)
            style=self.quote1_color_entry.get_style().copy()
            style.base[gtk.STATE_NORMAL]=gdk_color
            self.quote1_color_entry.set_style(style)
            style=self.quote2_color_entry.get_style().copy()
            style.base[gtk.STATE_NORMAL]=gdk_color
            self.quote2_color_entry.set_style(style)
            style=self.quote3_color_entry.get_style().copy()
            style.base[gtk.STATE_NORMAL]=gdk_color
            self.quote3_color_entry.set_style(style)
            style=self.sign_color_entry.get_style().copy()
            style.base[gtk.STATE_NORMAL]=gdk_color
            self.sign_color_entry.set_style(style)
            self.background2_color_label.set_text(color)
            style=self.url_color_entry.get_style().copy()
            style.base[gtk.STATE_NORMAL]=gdk_color
            self.url_color_entry.set_style(style)
        else:
            style=self.headers_color_entry.get_style().copy()
            gdk_color=gtk.gdk.color_parse(color)
            style.base[gtk.STATE_NORMAL]=gdk_color
            self.headers_color_entry.set_style(style)
            self.headers2_bg_color_label.set_text(color)
        button.set_color(gdk_color)


    def get_text_color(self,widget):
        style=widget.get_style().copy()
        gdk_color=style.text[gtk.STATE_NORMAL]
        color=self.gdkcolor_to_hex(gdk_color)
        return color

    def get_back_color(self,widget):
        style=widget.get_style().copy()
        gdk_color=style.base[gtk.STATE_NORMAL]
        color=self.gdkcolor_to_hex(gdk_color)
        return color


    def update_all(self,configs):
        self.mail_server_entry.set_text(configs["smtp_server"])
        self.mail_port_entry.set_text(configs["smtp_port"])
        if configs["smtp_auth"]=="True":
            self.mail_server_auth_checkbutton.set_active(True)
        else:
            self.mail_server_auth_checkbutton.set_active(False)
            self.mail_server_username.set_sensitive(False)
            self.mail_server_password.set_sensitive(False)
            self.mail_username_label.set_sensitive(False)
            self.mail_password_label.set_sensitive(False)
        self.mail_server_username.set_text(configs["smtp_username"])
        self.mail_server_password.set_text(configs["smtp_password"])


        self.font_article_button.set_font_name(configs["font_name"].encode("utf-8"))
        self.font_threads_button.set_font_name(configs["font_threads_name"].encode("utf-8"))
        self.font_groups_button.set_font_name(configs["font_groups_name"].encode("utf-8"))
        self.use_system_fonts_checkbutton.set_active(configs.get("use_system_fonts","True")=="True")
        self.change_fonts_status(None)

        self.apply_back_color(self.background_color_button,configs["background_color"])
        self.text_color_entry.set_text("Text Color")
        self.apply_text_color(self.text_color_entry,self.text_color_button,configs["text_color"])
        self.quote1_color_entry.set_text(">Quoted Text Level 1 Color")
        self.apply_text_color(self.quote1_color_entry,self.quote1_color_button,configs["quote1_color"])
        self.quote2_color_entry.set_text(">Quoted Text Level 2 Color")
        self.apply_text_color(self.quote2_color_entry,self.quote2_color_button,configs["quote2_color"])
        self.quote3_color_entry.set_text(">Quoted Text Level 3 Color")
        self.apply_text_color(self.quote3_color_entry,self.quote3_color_button,configs["quote3_color"])
        self.sign_color_entry.set_text("Sign Color")
        self.apply_text_color(self.sign_color_entry,self.sign_color_button,configs["sign_color"])
        self.url_color_entry.set_text("http://xpn.altervista.org")
        self.apply_text_color(self.url_color_entry,self.url_color_button,configs["url_color"])
        self.headers_color_entry.set_text("Header: sample")
        self.apply_text_color(self.headers_color_entry,self.headers_fg_color_button,configs["headers_fg_color"])
        self.apply_back_color(self.headers_bg_color_button,configs["headers_bg_color"])
        self.layout_radiobuttons[0].set_active(True)
        layout_number=int(self.configs["layout"])
        self.layout_radiobuttons[layout_number-1].set_active(True)
        if self.configs["exp_column"]=="From":
            self.thread_exp_radiobutton2.set_active(True)
        else:
            self.thread_exp_radiobutton1.set_active(True)
        self.headers_checkbutton.set_active(configs.get("show_headers","False")=="True")
        self.oneclick_checkbutton.set_active(configs.get("oneclick","False")=="True")
        self.advance_on_mark_checkbutton.set_active(configs.get("advance_on_mark","False")=="True")
        self.oneclick_article_checkbutton.set_active(configs.get("oneclick_article","False")=="True")
        self.expand_groups_checkbutton.set_active(configs.get("expand_group","False")=="True")
        self.one_key_spin.set_value(int(configs["scroll_fraction"]))
        self.sort_order_checkbutton.set_active(configs.get("ascend_order","False")=="True")
        self.sort_combo.child.set_text(configs["sort_col"].encode("utf-8").capitalize())
        self.fallback_charset_combo.child.set_text(configs["fallback_charset"])
 

        if configs["custom_browser"]=="True":
            self.browser_checkbutton.set_active(True)
            self.browser_entry.set_text(configs["browser_launcher"].encode("utf-8"))
        else:
            self.browser_checkbutton.set_active(False)
            self.browser_entry.set_sensitive(False)

      
            
        self.editor_checkbutton.set_active(eval(configs["external_editor"]))
        self.editor_entry.set_text(configs["editor_launcher"].encode("utf-8"))

        self.purge_read_spinbutton.set_value(int(configs["purge_read"]))
        self.purge_unread_spinbutton.set_value(int(configs["purge_unread"]))

        
            
        self.download_bodies_checkbutton.set_active(eval(configs["download_bodies"]))

        
        if configs["limit_articles"]=="True":
            self.limit_articles_checkbutton.set_active(True)
            self.limit_articles_spinbutton.set_sensitive(True)
        else:
            self.limit_articles_spinbutton.set_sensitive(False)

        self.limit_articles_spinbutton.set_value(int(configs["limit_articles_number"]))
        if configs["automatic_download"]=="True":
            self.auto_download_checkbutton.set_active(True)
            self.auto_download_spinbutton.set_sensitive(True)
        else:
            self.auto_download_spinbutton.set_sensitive(False)

        self.auto_download_spinbutton.set_value(int(configs["download_timeout"]))
        
        try: self.configs["threading_method"]               # upgrading check 
        except KeyError: self.config["threading_method"]=2 # upgrading check 
        
        if self.configs["threading_method"]=="1":
            self.threading_method_radiobutton1.set_active(True)
        else:
            self.threading_method_radiobutton2.set_active(True)
        
        if self.configs["lang"]=="en":
            self.lang_en_radiobutton.set_active(True)
        elif configs["lang"]=="it":
            self.lang_it_radiobutton.set_active(True)
        elif configs["lang"]=="fr":
            self.lang_fr_radiobutton.set_active(True)
        elif configs["lang"]=="de":
            self.lang_de_radiobutton.set_active(True)
        else:
            self.lang_en_radiobutton.set_active(True)




    def save_configs(self,object,conf):
        conf.configs["smtp_server"]=self.mail_server_entry.get_text().decode("utf-8")
        conf.configs["smtp_port"]=self.mail_port_entry.get_text()
        if self.mail_server_auth_checkbutton.get_active():
            conf.configs["smtp_auth"]="True"
            conf.configs["smtp_username"]=self.mail_server_username.get_text()
            conf.configs["smtp_password"]=self.mail_server_password.get_text()
        else:
            conf.configs["smtp_auth"]="False"
            conf.configs["smtp_username"]=""
            conf.configs["smtp_password"]=""



        conf.configs["font_name"]=self.font_article_button.get_font_name()
        conf.configs["font_threads_name"]=self.font_threads_button.get_font_name()
        conf.configs["font_groups_name"]=self.font_groups_button.get_font_name()
        conf.configs["use_system_fonts"]=str(bool(self.use_system_fonts_checkbutton.get_active()))
        conf.configs["text_color"]=self.get_text_color(self.text_color_entry)
        conf.configs["quote1_color"]=self.get_text_color(self.quote1_color_entry)
        conf.configs["quote2_color"]=self.get_text_color(self.quote2_color_entry)
        conf.configs["quote3_color"]=self.get_text_color(self.quote3_color_entry)
        conf.configs["sign_color"]=self.get_text_color(self.sign_color_entry)
        conf.configs["background_color"]=self.get_back_color(self.text_color_entry)
        conf.configs["url_color"]=self.get_text_color(self.url_color_entry)
        conf.configs["headers_fg_color"]=self.get_text_color(self.headers_color_entry)
        conf.configs["headers_bg_color"]=self.get_back_color(self.headers_color_entry)
        for rbutton in self.layout_radiobuttons:
            if rbutton.get_active():
                conf.configs["layout"]=str(self.layout_radiobuttons.index(rbutton)+1)
                break
        if self.thread_exp_radiobutton1.get_active():
            conf.configs["exp_column"]="Subject"
        else:
            conf.configs["exp_column"]="From"
        conf.configs["show_headers"]=str(bool(self.headers_checkbutton.get_active()))
        conf.configs["oneclick"]=str(bool(self.oneclick_checkbutton.get_active()))
        conf.configs["advance_on_mark"]=str(bool(self.advance_on_mark_checkbutton.get_active()))
        conf.configs["oneclick_article"]=str(bool(self.oneclick_article_checkbutton.get_active()))
        conf.configs["expand_group"]=str(bool(self.expand_groups_checkbutton.get_active()))
        conf.configs["scroll_fraction"]=repr(self.one_key_spin.get_value_as_int())
        conf.configs["sort_col"]=self.sort_combo.child.get_text().decode("utf-8")
        conf.configs["ascend_order"]=str(bool(self.sort_order_checkbutton.get_active()))
        conf.configs["fallback_charset"]=self.fallback_charset_combo.child.get_text()

#        if self.browser_checkbutton.get_active() and self.browser_entry.get_text().strip() and \
#           self.exists(self.browser_entry.get_text().strip()):
        if self.browser_checkbutton.get_active() and self.browser_entry.get_text().strip():
            conf.configs["custom_browser"]="True"
            conf.configs["browser_launcher"]=self.browser_entry.get_text().decode("utf-8")
        else:
            conf.configs["custom_browser"]="False"
            conf.configs["browser_launcher"]=""
        if self.exists(self.editor_entry.get_text().strip()):
            conf.configs["editor_launcher"]=self.editor_entry.get_text().decode("utf-8")
        else:
            conf.configs["editor_launcher"]=""
        conf.configs["external_editor"]=str(bool(self.editor_checkbutton.get_active()))

        conf.configs["purge_read"]=repr(self.purge_read_spinbutton.get_value_as_int())
        conf.configs["purge_unread"]=repr(self.purge_unread_spinbutton.get_value_as_int())
        conf.configs["download_bodies"]=repr(bool(self.download_bodies_checkbutton.get_active()))
        conf.configs["limit_articles"]=repr(bool(self.limit_articles_checkbutton.get_active()))
        conf.configs["limit_articles_number"]=repr(self.limit_articles_spinbutton.get_value_as_int())

        conf.configs["automatic_download"]=repr(bool(self.auto_download_checkbutton.get_active()))
        conf.configs["download_timeout"]=repr(self.auto_download_spinbutton.get_value_as_int())
        
        if self.threading_method_radiobutton1.get_active():
            conf.configs["threading_method"]="1"
        else:
            conf.configs["threading_method"]="2"
            
        if self.lang_en_radiobutton.get_active():
            conf.configs["lang"]="en"
        elif self.lang_it_radiobutton.get_active():
            conf.configs["lang"]="it"
        elif self.lang_fr_radiobutton.get_active():
            conf.configs["lang"]="fr"
        elif self.lang_de_radiobutton.get_active():
            conf.configs["lang"]="de"
        else:
            conf.configs["lang"]="en"

        conf.write_configs()
        self.win.destroy()
        self.apply_changes(conf.configs)


    def exists(self, text):
        result=text.rfind("%s")
        ## if the string doesn't exist result=-1, we return 0
        return result+1

    def apply_changes(self,configs):
        #change the font
        if self.use_system_fonts_checkbutton.get_active():
            self.main_win.article_pane.textview.modify_font(pango.FontDescription(""))
            self.main_win.threads_pane.threads_tree.modify_font(pango.FontDescription(""))
            self.main_win.groups_pane.groups_list.modify_font(pango.FontDescription(""))
        else:
            if configs["fixed"]=="False":
                self.main_win.article_pane.textview.modify_font(pango.FontDescription(configs["font_name"]))
            self.main_win.threads_pane.threads_tree.modify_font(pango.FontDescription(configs["font_threads_name"]))
            self.main_win.groups_pane.groups_list.modify_font(pango.FontDescription(configs["font_groups_name"]))

        #show-hide headers
        to_show = configs["show_headers"]=="True"
        self.main_win.article_pane.expander.set_expanded(to_show)
        #update_colors
        self.main_win.article_pane.set_text_color(configs["text_color"])
        self.main_win.article_pane.set_quote_color(configs["quote1_color"],1)
        self.main_win.article_pane.set_quote_color(configs["quote2_color"],2)
        self.main_win.article_pane.set_quote_color(configs["quote3_color"],3)
        self.main_win.article_pane.set_sign_color(configs["sign_color"])
        self.main_win.article_pane.set_background(configs["background_color"])
        self.main_win.article_pane.set_url_color(configs["url_color"])
        self.main_win.article_pane.set_headers_colors(configs["headers_bg_color"],configs["headers_fg_color"])        
        self.main_win.groups_pane.set_background(configs["background_color"])
        self.main_win.groups_pane.set_foreground(configs["text_color"])
        self.main_win.threads_pane.set_background(configs["background_color"])
        self.main_win.threads_pane.set_foreground(configs["text_color"])

        #show thread cause possible sorting changes
        self.main_win.show_threads(self.main_win.groups_pane.get_first_selected_group())
            


        #update expander column
        
        self.main_win.threads_pane.threads_tree.remove_column(self.main_win.threads_pane.column2)
        self.main_win.threads_pane.threads_tree.remove_column(self.main_win.threads_pane.column3)
        if configs["exp_column"]=="From":
            self.main_win.threads_pane.threads_tree.insert_column(self.main_win.threads_pane.column3,1)
            self.main_win.threads_pane.threads_tree.insert_column(self.main_win.threads_pane.column2,2)
            self.main_win.threads_pane.threads_tree.set_expander_column(self.main_win.threads_pane.column3)
            
        else:
            self.main_win.threads_pane.threads_tree.insert_column(self.main_win.threads_pane.column2,1)
            self.main_win.threads_pane.threads_tree.insert_column(self.main_win.threads_pane.column3,2)
            self.main_win.threads_pane.threads_tree.set_expander_column(self.main_win.threads_pane.column2)




        #update browser launcher
        if configs["custom_browser"]=="True":
            self.main_win.article_pane.use_custom_browser=True
            webbrowser.register("xpn_launcher",None,webbrowser.GenericBrowser(configs["browser_launcher"]))
        else:
            self.main_win.article_pane.use_custom_browser=False

        #udatep headers shown
        self.main_win.article_pane.repopulate_headers()
        #update connection
        for connection in self.main_win.connectionsPool.itervalues():
            connection.closeConnection()

        cp=ConfigParser.ConfigParser()
        cp.read(os.path.join(get_wdir(),"dats","servers.txt"))
        self.main_win.connectionsPool=dict()
        for server in cp.sections():
            if cp.get(server,"nntp_use_ssl")=="True":
                self.main_win.connectionsPool[server]=SSLConnection(cp.get(server,"server"),cp.get(server,"port"),cp.get(server,"auth"),cp.get(server,"username"),cp.get(server,"password"))
            else:
                self.main_win.connectionsPool[server]=Connection(cp.get(server,"server"),cp.get(server,"port"),cp.get(server,"auth"),cp.get(server,"username"),cp.get(server,"password"))

    def update_layout(self,obj,configs=None,layout_number=0):
        #update_layout
        layout_methods = {"1":self.main_win.build_layout_type_1,
                          "2":self.main_win.build_layout_type_2,
                          "3":self.main_win.build_layout_type_3,
                          "4":self.main_win.build_layout_type_4
                         }
        if configs:
            r,c=divmod(int(configs["layout"])-1,6)
        else:
            r,c=divmod(layout_number-1,6)
        layout_builder = layout_methods.get(str(r+1), None)
        if layout_builder: layout_builder(c+1)
        else: self.main_win.build_layout_type_1(1)   # If there is no layout associated to
                                            # self.configs["layout"] then build 1
        self.main_win.set_sizes()
        
    def change_fonts_status(self,obj):
        status=self.use_system_fonts_checkbutton.get_active()
        self.font_article_hbox.set_sensitive(not status)
        self.font_threads_hbox.set_sensitive(not status)
        self.font_groups_hbox.set_sensitive(not status)

    def change_mid_status(self,obj):
        status=self.generate_mid_checkbutton.get_active()
        self.fqdn_entry.set_sensitive(status)
        self.fqdn_label.set_sensitive(status)

    def change_auth_status(self,obj):
        status=self.server_auth_checkbutton.get_active()
        self.server_username.set_sensitive(status)
        self.server_password.set_sensitive(status)
        self.username_label.set_sensitive(status)
        self.password_label.set_sensitive(status)

    def change_ssl_status(self,checkbutton):
        status=checkbutton.get_active()
        if status:
            self.port_entry.set_text("563")
        else:
            self.port_entry.set_text("119")

        
    def change_mail_auth_status(self,obj):
        status=self.mail_server_auth_checkbutton.get_active()
        self.mail_server_username.set_sensitive(status)
        self.mail_server_password.set_sensitive(status)
        self.mail_username_label.set_sensitive(status)
        self.mail_password_label.set_sensitive(status)
    

            
    def change_browser_status(self,obj):
        status=self.browser_checkbutton.get_active()
        self.browser_label.set_sensitive(status)
        self.browser_entry.set_sensitive(status)

    def change_limit_status(self,obj):
        status=self.limit_articles_checkbutton.get_active()
        self.limit_articles_spinbutton.set_sensitive(status)

    def change_auto_download_status(self,obj):
        status=self.auto_download_checkbutton.get_active()
        self.auto_download_spinbutton.set_sensitive(status)

    def add_tag_line(self,obj):
        tag_win=Tags_Window()

    def open_charset_list_win(self,obj):
        charset_list_win=CharsetList()
    
    def open_headers_list_win(self,obj):
        headers_list_win=HeadersList()

    def insert_rb(self,name,icon_name,shortname,tooltip,group=None):
        icon=gtk.Image()
        icon.set_from_file("pixmaps/"+icon_name)

        label=gtk.Label()
        label.set_markup("<b>"+name+"</b>")
        radiobutton=gtk.RadioButton(group)
        radiobutton.set_mode(False)
        radiobutton.set_relief( gtk.RELIEF_NONE )
        b_vbox=gtk.VBox()
        radiobutton.add(b_vbox)
        b_vbox.pack_start(icon,True,True,2)
        b_vbox.pack_start(label,True,True,2)
        self.left_buttons.pack_start(radiobutton,True,True,2)
        self.buttons[shortname]=radiobutton
        radiobutton.connect("released",self.show_config_pages,shortname)

    def show_config_pages(self,obj,name):
        current_notebook=self.main_hbox.get_children()[1]
        self.main_hbox.remove(current_notebook)
        if name=="server":
            self.main_hbox.pack_start(self.server_page,True,True,4)
        if name=="user":
            self.main_hbox.pack_start(self.user_page,True,True,4)        
        if name=="display":
            self.main_hbox.pack_start(self.display_page,True,True,4)
        if name=="groups":
            self.main_hbox.pack_start(self.groups_page,True,True,4)
        if name=="misc":
            self.main_hbox.pack_start(self.misc_page,True,True,4)
        self.main_hbox.show_all()

    def refresh_server_list(self):
        cp=ConfigParser.ConfigParser()
        cp.read(os.path.join(get_wdir(),"dats","servers.txt"))
        self.server_model.clear()
        for server in cp.sections():self.server_model.append([server])

    def refresh_id_list(self):
        cp=ConfigParser.ConfigParser()
        cp.read(os.path.join(get_wdir(),"dats","id.txt"))
        self.id_model.clear()
        for id in cp.sections():self.id_model.append([id])

    def build_server_page(self):
        notebook=gtk.Notebook()
        label_server=gtk.Label()
        label_server.set_markup("<b>"+_("Servers")+"</b>")
        
        server_profile_vbox=gtk.VBox()
        
        
        server_label=gtk.Label()
        server_label.set_markup("<b>"+_("NNTP Servers")+"</b>")
        server_label.set_alignment(0,0.5)
        server_vbox=gtk.VBox()
        server_vbox.set_border_width(4)
        server_table=gtk.Table(5,2,False)
        server_table.set_border_width(4)
        server_vbox.pack_start(server_label,True,True)
        server_vbox.pack_start(server_table,True,True)

        def add_edit_server(button):
            if button==edit_button:
                model,iter_selected= server_list.get_selection().get_selected()
                if iter_selected:
                    server= self.server_model.get_value(iter_selected,0)
                    win=NNTPServer_Win(self,server)
                    win.show()            
            else:
                win=NNTPServer_Win(self)
                win.show()
            self.refresh_server_list()
                    
                

        def remove_server(button):
            model,iter_selected= server_list.get_selection().get_selected()
            if iter_selected:
                server= self.server_model.get_value(iter_selected,0)
                cp=ConfigParser.ConfigParser()
                cp.read(os.path.join(get_wdir(),"dats","servers.txt"))
                cp.remove_section(server)
                cp.write(file(os.path.join(get_wdir(),"dats","servers.txt"),"w"))
            self.refresh_server_list()

        def server_list_row_clicked(*params):
            add_edit_server(edit_button)

        add_button=gtk.Button(None,gtk.STOCK_ADD)
        add_button.set_tooltip_text(_("Add a Server"))
        add_button.connect("clicked",add_edit_server)
        add_button.set_border_width(5)

        edit_button=gtk.Button(None,gtk.STOCK_EDIT)
        edit_button.set_tooltip_text(_("Edit Selected Server"))
        edit_button.connect("clicked",add_edit_server)
        edit_button.set_border_width(5)

        remove_button=gtk.Button(None,gtk.STOCK_REMOVE)
        remove_button.set_tooltip_text(_("Remove Selected Server"))
        remove_button.connect("clicked",remove_server)
        remove_button.set_border_width(5)


        server_scrolledwin=gtk.ScrolledWindow()
        server_scrolledwin.set_border_width(4)
        server_scrolledwin.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC)
        server_scrolledwin.set_shadow_type(gtk.SHADOW_ETCHED_IN)
        server_list=gtk.TreeView() 
        server_list.connect("row_activated",server_list_row_clicked)
        server_list.set_border_width(4)
        self.server_model=gtk.ListStore(gobject.TYPE_STRING)
        server_scrolledwin.add(server_list)
        server_list.set_model(self.server_model)
        text_renderer=gtk.CellRendererText()
        server_column=gtk.TreeViewColumn(_("List"),text_renderer,text=0)
        server_list.append_column(server_column)
        server_list.set_rules_hint(True)
        server_list.set_headers_visible(False)
        self.refresh_server_list()
        server_table.attach(server_scrolledwin,0,1,0,3,gtk.EXPAND|gtk.FILL,gtk.FILL,18)
        server_table.attach(add_button,1,2,0,1,gtk.FILL)
        server_table.attach(edit_button,1,2,1,2,gtk.FILL)
        server_table.attach(remove_button,1,2,2,3,gtk.FILL)

        server_profile_vbox.pack_start(server_vbox,True,True)

        mail_server_label=gtk.Label()
        mail_server_label.set_markup("<b>"+_("SMTP Server")+"</b>")
        mail_server_label.set_alignment(0,0.5)
        mail_server_vbox=gtk.VBox()
        mail_server_vbox.set_border_width(4)
        mail_server_vbox.pack_start(mail_server_label,False,True)
        
        mail_server_table=gtk.Table(4,2,False)
        mail_server_table.set_border_width(8)


        self.mail_port_entry=gtk.Entry()
        self.mail_port_entry.set_size_request(30,-1)
        self.mail_server_entry=gtk.Entry()
        mail_server_port_hbox=gtk.HBox()
        mail_server_port_hbox.pack_start(self.mail_server_entry,True,True)
        mail_server_port_hbox.pack_start(self.mail_port_entry,False,False,4)
        self.mail_server_username=gtk.Entry()
        self.mail_server_password=gtk.Entry()
        self.mail_server_password.set_visibility(False)
        self.mail_server_auth_checkbutton=gtk.CheckButton(_("Server requires authentication"))
        self.mail_server_auth_checkbutton.connect("clicked",self.change_mail_auth_status)

        mail_server_entry_label=gtk.Label(_("SMTP Server Address | Port Number"))
        mail_server_entry_label.set_size_request(230,-1)
        mail_server_entry_label.set_alignment(0,0.5)
        self.mail_username_label=gtk.Label(_("Username"))
        self.mail_username_label.set_size_request(230,-1)
        self.mail_username_label.set_alignment(0,0.5)
        self.mail_password_label=gtk.Label(_("Password"))
        self.mail_password_label.set_alignment(0,0.5)
        mail_auth_label=gtk.Label("")

        mail_server_table.attach(mail_server_port_hbox,0,1,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,18)
        mail_server_table.attach(self.mail_server_auth_checkbutton,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,6)
        mail_server_table.attach(self.mail_server_username,0,1,2,3,gtk.EXPAND|gtk.FILL,gtk.FILL,18)
        mail_server_table.attach(self.mail_server_password,0,1,3,4,gtk.EXPAND|gtk.FILL,gtk.FILL,18)
        mail_server_table.attach(mail_server_entry_label,1,2,0,1,gtk.EXPAND|gtk.FILL)
        mail_server_table.attach(mail_auth_label,1,2,1,2,gtk.EXPAND|gtk.FILL)
        mail_server_table.attach(self.mail_username_label,1,2,2,3,gtk.EXPAND|gtk.FILL)
        mail_server_table.attach(self.mail_password_label,1,2,3,4,gtk.EXPAND|gtk.FILL)

        mail_server_vbox.pack_start(mail_server_table,False,False)
        
        server_profile_vbox.pack_start(mail_server_vbox,True,True)
       
        notebook.append_page(server_profile_vbox,label_server)

        return notebook

        
    def build_user_page(self):
        notebook=gtk.Notebook()
        label_user=gtk.Label()
        label_user.set_markup("<b>"+_("User Profile")+"</b>")




        def add_edit_id(button):
            if button==edit_button:
                model,iter_selected= id_list.get_selection().get_selected()
                if iter_selected:
                    id= self.id_model.get_value(iter_selected,0)
                    win=ID_Win(self,id)
                    win.show()            
            else:
                win=ID_Win(self)
                win.show()
            self.refresh_id_list()
                    
                

        def remove_id(button):
            model,iter_selected= id_list.get_selection().get_selected()
            if iter_selected:
                id= self.id_model.get_value(iter_selected,0)
                cp=ConfigParser.ConfigParser()
                cp.read(os.path.join(get_wdir(),"dats","id.txt"))
                cp.remove_section(id)
                cp.write(file(os.path.join(get_wdir(),"dats","id.txt"),"w"))
            self.refresh_id_list()

        def id_list_row_clicked(*params):
            add_edit_id(edit_button)

        add_button=gtk.Button(None,gtk.STOCK_ADD)
        add_button.set_tooltip_text(_("Add an Identity"))
        add_button.connect("clicked",add_edit_id)
        add_button.set_border_width(5)

        edit_button=gtk.Button(None,gtk.STOCK_EDIT)
        edit_button.set_tooltip_text(_("Edit Selected Identity"))
        edit_button.connect("clicked",add_edit_id)
        edit_button.set_border_width(5)

        remove_button=gtk.Button(None,gtk.STOCK_REMOVE)
        remove_button.set_tooltip_text(_("Remove Selected Identity"))
        remove_button.connect("clicked",remove_id)
        remove_button.set_border_width(5)

        user_profile_vbox=gtk.VBox()
        user_profile_vbox.set_border_width(4)
        personal_table=gtk.Table(4,2,False)
        personal_table.set_border_width(8)

        id_scrolledwin=gtk.ScrolledWindow()
        id_scrolledwin.set_border_width(4)
        id_scrolledwin.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC)
        id_scrolledwin.set_shadow_type(gtk.SHADOW_ETCHED_IN)
        id_list=gtk.TreeView() 
        id_list.connect("row_activated",id_list_row_clicked)
        id_list.set_border_width(4)
        self.id_model=gtk.ListStore(gobject.TYPE_STRING)
        id_scrolledwin.add(id_list)
        id_list.set_model(self.id_model)
        text_renderer=gtk.CellRendererText()
        id_column=gtk.TreeViewColumn(_("List"),text_renderer,text=0)
        id_list.append_column(id_column)
        id_list.set_rules_hint(True)
        id_list.set_headers_visible(False)
        self.refresh_id_list()
        personal_table.attach(id_scrolledwin,0,1,0,3,gtk.EXPAND|gtk.FILL,gtk.FILL,18)
        personal_table.attach(add_button,1,2,0,1,gtk.FILL)
        personal_table.attach(edit_button,1,2,1,2,gtk.FILL)
        personal_table.attach(remove_button,1,2,2,3,gtk.FILL)
 
        user_profile_vbox.pack_start(personal_table,False,False)
        notebook.append_page(user_profile_vbox,label_user)

        return notebook


    
    def build_display_page(self):
        notebook=gtk.Notebook()
        label_display_profile=gtk.Label()
        label_display_profile.set_markup("<b>"+_("Fonts and Colors")+"</b>")

        
        display_profile_vbox=gtk.VBox()
        display_profile_vbox_2=gtk.VBox()


        font_vbox=gtk.VBox()
        font_label=gtk.Label()
        font_label.set_markup("<b>"+_("Fonts")+"</b>")
        font_label.set_alignment(0,0.5)
        font_vbox.pack_start(font_label,False,False,4)
        font_vbox.set_border_width(4)
        self.font_article_hbox=gtk.HBox()
        self.font_article_hbox.set_border_width(4)
        font_article_label=gtk.Label(_("Article"))
        font_article_label.set_size_request(68,-1)
        font_article_label.set_alignment(0,0.5)
        self.font_article_hbox.pack_start(font_article_label,False,False,16)
        self.font_article_button=gtk.FontButton(None)
        self.font_article_button.set_use_font(True)
        self.font_article_button.set_use_size(True)
        self.font_article_hbox.pack_start(self.font_article_button,True,True,0)
        
        self.font_threads_hbox=gtk.HBox()
        self.font_threads_hbox.set_border_width(4)
        font_threads_label=gtk.Label(_("Threads"))
        font_threads_label.set_size_request(68,-1)
        font_threads_label.set_alignment(0,0.5)
        self.font_threads_hbox.pack_start(font_threads_label,False,False,16)
        self.font_threads_button=gtk.FontButton(None)
        self.font_threads_button.set_use_font(True)
        self.font_threads_button.set_use_size(True)
        self.font_threads_hbox.pack_start(self.font_threads_button,True,True,0)
        
        self.font_groups_hbox=gtk.HBox()
        self.font_groups_hbox.set_border_width(4)
        font_groups_label=gtk.Label(_("Groups"))
        font_groups_label.set_size_request(68,-1)
        font_groups_label.set_alignment(0,0.5)
        self.font_groups_hbox.pack_start(font_groups_label,False,False,16)
        self.font_groups_button=gtk.FontButton(None)
        self.font_groups_button.set_use_font(True)
        self.font_groups_button.set_use_size(True)
        self.font_groups_hbox.pack_start(self.font_groups_button,True,True,0)
        
        use_system_fonts_hbox=gtk.HBox()
        use_system_fonts_hbox.set_border_width(4)
        self.use_system_fonts_checkbutton=gtk.CheckButton(_("Use System Fonts"))
        use_system_fonts_hbox.pack_start(self.use_system_fonts_checkbutton,False,False,16)
        self.use_system_fonts_checkbutton.connect("clicked",self.change_fonts_status)

        font_vbox.pack_start(use_system_fonts_hbox,False,False)
        font_vbox.pack_start(self.font_article_hbox,False,False)
        font_vbox.pack_start(self.font_threads_hbox,False,False)
        font_vbox.pack_start(self.font_groups_hbox,False,False)


        colors_vbox=gtk.VBox()
        colors_label=gtk.Label()
        colors_label.set_markup("<b>"+_("Colors")+"</b>")
        colors_label.set_alignment(0,0.5)
        colors_vbox.pack_start(colors_label)

        colors_vbox.set_border_width(4)
        colors_table=gtk.Table(5,3,False)
        colors_table.set_border_width(4)
        text_color_label=gtk.Label(_("Text"))
        text_color_label.set_alignment(0,0.5)
        quote1_color_label=gtk.Label(_("Quote Level 1"))
        quote1_color_label.set_alignment(0,0.5)
        quote1_color_label.set_size_request(80,-1)
        quote2_color_label=gtk.Label(_("Quote Level 2"))
        quote2_color_label.set_alignment(0,0.5)
        quote3_color_label=gtk.Label(_("Quote Level 3"))
        quote3_color_label.set_alignment(0,0.5)
        sign_color_label=gtk.Label(_("Sign"))
        sign_color_label.set_alignment(0,0.5)
        background_color_label=gtk.Label(_("Background"))
        background_color_label.set_alignment(0,0.5)
        self.background2_color_label=gtk.Label("")
        url_color_label=gtk.Label(_("URL"))
        url_color_label.set_alignment(0,0.5)
        self.text_color_entry=gtk.Entry()
        self.text_color_entry.set_editable(False)
        self.quote1_color_entry=gtk.Entry()
        self.quote1_color_entry.set_editable(False)
        self.quote2_color_entry=gtk.Entry()
        self.quote2_color_entry.set_editable(False)
        self.quote3_color_entry=gtk.Entry()
        self.quote3_color_entry.set_editable(False)
        self.sign_color_entry=gtk.Entry()
        self.sign_color_entry.set_editable(False)
        self.url_color_entry=gtk.Entry()
        self.url_color_entry.set_editable(False)
        self.text_color_button=gtk.ColorButton(gtk.gdk.Color(0,0,0))
        self.text_color_button.set_size_request(100,25)
        self.text_color_button.set_title(_("Select Text Color"))
        self.text_color_button.connect("color_set",self.update_text_color_entry)
        self.quote1_color_button=gtk.ColorButton(gtk.gdk.Color(0,0,0))
        self.quote1_color_button.set_size_request(100,25)
        self.quote1_color_button.set_title(_("Select Quote Level 1 Color"))
        self.quote1_color_button.connect("color_set",self.update_text_color_entry)
        self.quote2_color_button=gtk.ColorButton(gtk.gdk.Color(0,0,0))
        self.quote2_color_button.set_size_request(100,25)
        self.quote2_color_button.set_title(_("Select Quote Level 2 Color"))
        self.quote2_color_button.connect("color_set",self.update_text_color_entry)
        self.quote3_color_button=gtk.ColorButton(gtk.gdk.Color(0,0,0))
        self.quote3_color_button.set_size_request(100,25)
        self.quote3_color_button.set_title(_("Select Quote Level 3 Color"))
        self.quote3_color_button.connect("color_set",self.update_text_color_entry)
        self.sign_color_button=gtk.ColorButton(gtk.gdk.Color(0,0,0))
        self.sign_color_button.set_size_request(100,25)
        self.sign_color_button.set_title(_("Select Sign Color"))
        self.sign_color_button.connect("color_set",self.update_text_color_entry)
        self.background_color_button=gtk.ColorButton(gtk.gdk.Color(0,0,0))
        self.background_color_button.set_size_request(100,25)
        self.background_color_button.set_title(_("Select Background Color"))
        self.background_color_button.connect("color_set",self.update_back_color_entry)
        self.url_color_button=gtk.ColorButton(gtk.gdk.Color(0,0,0))
        self.url_color_button.set_size_request(100,25)
        self.url_color_button.set_title(_("Select URL Color"))
        self.url_color_button.connect("color_set",self.update_text_color_entry)




        colors_table.attach(text_color_label,0,1,0,1,gtk.FILL,gtk.FILL,16)
        colors_table.attach(quote1_color_label,0,1,1,2,gtk.FILL,gtk.FILL,16)
        colors_table.attach(quote2_color_label,0,1,2,3,gtk.FILL,gtk.FILL,16)
        colors_table.attach(quote3_color_label,0,1,3,4,gtk.FILL,gtk.FILL,16)
        colors_table.attach(sign_color_label,0,1,4,5,gtk.FILL,gtk.FILL,16)
        colors_table.attach(url_color_label,0,1,5,6,gtk.FILL,gtk.FILL,16)
        colors_table.attach(background_color_label,0,1,6,7,gtk.FILL,gtk.FILL,16)

        colors_table.attach(self.text_color_entry,1,2,0,1,gtk.EXPAND|gtk.FILL,gtk.SHRINK,2)
        colors_table.attach(self.quote1_color_entry,1,2,1,2,gtk.EXPAND|gtk.FILL,gtk.SHRINK,2)
        colors_table.attach(self.quote2_color_entry,1,2,2,3,gtk.EXPAND|gtk.FILL,gtk.SHRINK,2)
        colors_table.attach(self.quote3_color_entry,1,2,3,4,gtk.EXPAND|gtk.FILL,gtk.SHRINK,2)
        colors_table.attach(self.sign_color_entry,1,2,4,5,gtk.EXPAND|gtk.FILL,gtk.SHRINK,2)
        colors_table.attach(self.url_color_entry,1,2,5,6,gtk.EXPAND|gtk.FILL,gtk.SHRINK,2)
        colors_table.attach(self.background2_color_label,1,2,6,7,gtk.EXPAND|gtk.FILL,gtk.SHRINK,2)

        colors_table.attach(self.text_color_button,2,3,0,1,gtk.EXPAND|gtk.FILL,gtk.SHRINK)
        colors_table.attach(self.quote1_color_button,2,3,1,2,gtk.EXPAND|gtk.FILL,gtk.SHRINK)
        colors_table.attach(self.quote2_color_button,2,3,2,3,gtk.EXPAND|gtk.FILL,gtk.SHRINK)
        colors_table.attach(self.quote3_color_button,2,3,3,4,gtk.EXPAND|gtk.FILL,gtk.SHRINK)
        colors_table.attach(self.sign_color_button,2,3,4,5,gtk.EXPAND|gtk.FILL,gtk.SHRINK)
        colors_table.attach(self.url_color_button,2,3,5,6,gtk.EXPAND|gtk.FILL,gtk.SHRINK)
        colors_table.attach(self.background_color_button,2,3,6,7,gtk.EXPAND|gtk.FILL,gtk.SHRINK)
        


        headers_colors_vbox=gtk.VBox()
        headers_colors_label=gtk.Label()
        headers_colors_label.set_markup("<b>"+_("Headers Colors")+"</b>")
        headers_colors_label.set_alignment(0,0.5)
        self.headers2_bg_color_label=gtk.Label()
        headers_colors_vbox.pack_start(headers_colors_label)
        
        headers_colors_vbox.set_border_width(4)
        headers_colors_table=gtk.Table(5,3,False)
        headers_colors_table.set_border_width(4)

        self.headers_bg_color_button=gtk.ColorButton(gtk.gdk.Color(0,0,0))
        self.headers_bg_color_button.set_size_request(100,25)
        self.headers_bg_color_button.set_title(_("Select Headers Background Color"))
        self.headers_bg_color_button.connect("color_set",self.update_back_color_entry)
        self.headers_fg_color_button=gtk.ColorButton(gtk.gdk.Color(0,0,0))
        self.headers_fg_color_button.set_size_request(100,25)
        self.headers_fg_color_button.set_title(_("Select Headers Foreground Color"))
        self.headers_fg_color_button.connect("color_set",self.update_text_color_entry)
        self.headers_color_entry=gtk.Entry()
        self.headers_color_entry.set_editable(False)
        headers_fg_color_label=gtk.Label(_("Color"))
        headers_fg_color_label.set_alignment(0,0.5)
        headers_fg_color_label.set_size_request(80,-1)
        headers_bg_color_label=gtk.Label(_("Background"))
        headers_bg_color_label.set_alignment(0,0.5)

        headers_colors_table.attach(headers_fg_color_label,0,1,0,1,gtk.FILL,gtk.FILL,16)
        headers_colors_table.attach(headers_bg_color_label,0,1,1,2,gtk.FILL,gtk.FILL,16)
        headers_colors_table.attach(self.headers_color_entry,1,2,0,1,gtk.EXPAND|gtk.FILL,gtk.SHRINK,2)
        headers_colors_table.attach(self.headers2_bg_color_label,1,2,1,2,gtk.EXPAND|gtk.FILL,gtk.SHRINK,2)
        headers_colors_table.attach(self.headers_fg_color_button,2,3,0,1,gtk.EXPAND|gtk.FILL,gtk.SHRINK)
        headers_colors_table.attach(self.headers_bg_color_button,2,3,1,2,gtk.EXPAND|gtk.FILL,gtk.SHRINK)


        colors_vbox.pack_start(colors_table,False,False)
        headers_colors_vbox.pack_start(headers_colors_table,False,False)

        label_display_profile_2=gtk.Label()
        label_display_profile_2.set_markup("<b>"+_("Layout")+"</b>")

        layout_label=gtk.Label()
        layout_label.set_markup("<b>"+_("Layout")+"</b>")
        layout_label.set_alignment(0,0.5)
        layout_main_vbox=gtk.VBox()
        layout_main_vbox.set_border_width(4)
        layout_main_vbox.pack_start(layout_label,False,False,4)
        layout_hbox=gtk.HBox()
        #layouts_vbox=gtk.VBox()
        layouts_table=gtk.Table(6,4,False)
        layout_vbox=gtk.VBox()
        self.layout_radiobuttons=[]
        for i in range(24):
            if i == 0: rbutton=gtk.RadioButton()
            else: rbutton=gtk.RadioButton(self.layout_radiobuttons[0])
            layout_image=gtk.Image()
            layout_image.set_from_file("pixmaps/layout_"+str(i+1)+".xpm")
            rbutton.add(layout_image)
            rbutton.connect("clicked",self.update_layout,None,i+1)
            self.layout_radiobuttons.append(rbutton)
            r,c=divmod(i,6)
            layouts_table.attach(rbutton,r,r+1,c,c+1,gtk.FILL,gtk.FILL,12,4)
        
        layout_hbox.pack_start(layouts_table,True,False,2)
        layout_label=gtk.Label(_("G:  Groups Pane\n\nH:  Headers Pane\n\nA:  Article Pane"))
        layout_hbox.pack_start(layout_label,True,False,4)
        layout_vbox.pack_start(layout_hbox,True,True,4)
        
        layout_main_vbox.pack_start(layout_vbox,False,False,16)
       
        art_pane_vbox=gtk.VBox()     
        art_pane_vbox.set_border_width(4)
        art_pane_label=gtk.Label()
        art_pane_label.set_markup("<b>"+_("Article Pane")+"</b>")
        art_pane_label.set_alignment(0,0.5)
        art_pane_table=gtk.Table(1,1,False)
        art_pane_table.set_border_width(4)
        art_pane_vbox.pack_start(art_pane_label,False,False,4)
 
        self.headers_checkbutton=gtk.CheckButton(_("Display Headers in the Article Pane"))

        self.headers_conf_button=gtk.Button(_("Headers List"))
        self.headers_conf_button.set_tooltip_text(_("XPN will show these headers on the top of the Article Pane"))
        headers_conf_label=gtk.Label(_("Headers Shown on the Article Pane"))
        self.headers_conf_button.connect("clicked",self.open_headers_list_win)
        art_pane_table.attach(self.headers_checkbutton,0,1,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        art_pane_table.attach(self.headers_conf_button,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        art_pane_table.attach(headers_conf_label,1,2,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL)
        art_pane_vbox.pack_start(art_pane_table,False,False)



        thread_pane_vbox=gtk.VBox()     
        thread_pane_vbox.set_border_width(4)
        thread_pane_label=gtk.Label()
        thread_pane_label.set_markup("<b>"+_("Threads Pane")+"</b>")
        thread_pane_label.set_alignment(0,0.5)
        thread_pane_table=gtk.Table(1,1,False)
        thread_pane_table.set_border_width(4)
        thread_pane_vbox.pack_start(thread_pane_label,False,False,4)
        
        thread_pane_label2=gtk.Label(_("Threads expander position"))
        self.thread_exp_radiobutton1=gtk.RadioButton(None,_("Subject Column"))
        self.thread_exp_radiobutton2=gtk.RadioButton(self.thread_exp_radiobutton1,_("From Column"))
        thread_pane_table.attach(self.thread_exp_radiobutton1,0,1,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        thread_pane_table.attach(self.thread_exp_radiobutton2,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        thread_pane_table.attach(thread_pane_label2,1,2,0,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        
        thread_pane_vbox.pack_start(thread_pane_table,False,False)

        display_profile_vbox.pack_start(font_vbox,False,True)
        display_profile_vbox.pack_start(colors_vbox,False,True)
        display_profile_vbox.pack_start(headers_colors_vbox,False,True)
        display_profile_vbox_2.pack_start(layout_main_vbox,False,False)
        display_profile_vbox_2.pack_start(art_pane_vbox,False,False)
        display_profile_vbox_2.pack_start(thread_pane_vbox,False,False)


        notebook.append_page(display_profile_vbox,label_display_profile)
        notebook.append_page(display_profile_vbox_2,label_display_profile_2)

        return notebook

    def build_groups_page(self):
        notebook=gtk.Notebook()
        label_groups_download=gtk.Label()
        label_groups_download.set_markup("<b>"+_("Download")+"</b>")
        label_groups_view=gtk.Label()
        label_groups_view.set_markup("<b>"+_("Visualization")+"</b>")
        label_groups_nav=gtk.Label()
        label_groups_nav.set_markup("<b>"+_("Navigation")+"</b>")
        
        groups_download_vbox=gtk.VBox()
        groups_view_vbox=gtk.VBox()
        groups_nav_vbox=gtk.VBox()


        purge_main_vbox=gtk.VBox()
        purge_main_vbox.set_border_width(4)
        purge_main_label=gtk.Label()
        purge_main_label.set_markup("<b>"+_("Purge Options")+"</b>")
        purge_main_label.set_alignment(0,0.5)
        purge_main_vbox.pack_start(purge_main_label,False,False,4)
        purge_table=gtk.Table(2,2,False)
        purge_table.set_border_width(4)
        self.purge_read_spinbutton=gtk.SpinButton(gtk.Adjustment(value=5,lower=0,upper=1000,step_incr=1,page_incr=10))
        self.purge_read_spinbutton.set_tooltip_text(_("Number of days. '0' means never purge read articles"))
        purge_read_label=gtk.Label(_("Purge read articles after (days)"))
        purge_read_label.set_alignment(0,0.5)
        self.purge_unread_spinbutton=gtk.SpinButton(gtk.Adjustment(value=10,lower=0,upper=1000,step_incr=1,page_incr=10))
        self.purge_unread_spinbutton.set_tooltip_text(_("Number of days. '0' means never purge unread articles"))
        purge_unread_label=gtk.Label(_("Purge unread articles after (days)"))
        purge_unread_label.set_alignment(0,0.5)



        purge_table.attach(self.purge_read_spinbutton,0,1,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        purge_table.attach(purge_read_label,1,2,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,2)
        purge_table.attach(self.purge_unread_spinbutton,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        purge_table.attach(purge_unread_label,1,2,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,2)
        
        purge_main_vbox.pack_start(purge_table,False,False,4)

        groups_download_vbox.pack_start(purge_main_vbox,False,True,2)

        articles_vbox=gtk.VBox()
        articles_vbox.set_border_width(4)
        articles_label=gtk.Label()
        articles_label.set_markup("<b>"+_("Articles")+"</b>")
        articles_label.set_alignment(0,0.5)
        articles_vbox.pack_start(articles_label,False,False,4)
        articles_table=gtk.Table(1,1,False)
        self.download_bodies_checkbutton=gtk.CheckButton(_("Retrieve Bodies for all new articles"))
        self.limit_articles_checkbutton=gtk.CheckButton(_("Limit the number of articles to download"))
        self.limit_articles_spinbutton=gtk.SpinButton(gtk.Adjustment(value=500,lower=1,upper=100000,step_incr=1,page_incr=10))
        limit_articles_label=gtk.Label(_("Max number of articles to download"))
        
        self.limit_articles_checkbutton.connect("clicked",self.change_limit_status)
        articles_table.attach(self.download_bodies_checkbutton,0,1,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        articles_table.attach(self.limit_articles_checkbutton,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        articles_table.attach(self.limit_articles_spinbutton,0,1,2,3,gtk.FILL,gtk.FILL,16,2)
        articles_table.attach(limit_articles_label,1,2,2,3,gtk.EXPAND|gtk.FILL,gtk.FILL)
        
        articles_vbox.pack_start(articles_table,False,False)
        groups_download_vbox.pack_start(articles_vbox,False,True,4)

        auto_download_vbox=gtk.VBox()
        auto_download_vbox.set_border_width(4)
        auto_download_label=gtk.Label()
        auto_download_label.set_markup("<b>"+_("Automatic Header Download")+"</b>")
        auto_download_label.set_alignment(0,0.5)
        auto_download_vbox.pack_start(auto_download_label,False,False,4)
        auto_download_table=gtk.Table(1,1,False)
        self.auto_download_checkbutton=gtk.CheckButton(_("Download Headers automatically"))
        self.auto_download_spinbutton=gtk.SpinButton(gtk.Adjustment(value=30,lower=5,upper=100000,step_incr=1,page_incr=10))
        timeout_label=gtk.Label(_("Minutes Between Downloads"))
        self.auto_download_checkbutton.connect("clicked",self.change_auto_download_status)
        
        auto_download_table.attach(self.auto_download_checkbutton,0,1,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        auto_download_table.attach(self.auto_download_spinbutton,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        auto_download_table.attach(timeout_label,1,2,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL)

        auto_download_vbox.pack_start(auto_download_table,False,False)
        groups_download_vbox.pack_start(auto_download_vbox,False,False,4)





        sort_main_vbox=gtk.VBox()
        sort_main_vbox.set_border_width(4)
        sort_main_label=gtk.Label()
        sort_main_label.set_markup("<b>"+_("Sorting Options")+"</b>")
        sort_main_label.set_alignment(0,0.5)
        sort_main_vbox.pack_start(sort_main_label,False,False,4)
        sort_table=gtk.Table(2,2,False)
        sort_table.set_border_width(4)
        self.sort_order_checkbutton=gtk.CheckButton(_("Ascending Order"))
        sort_label=gtk.Label(_("Sorting Column"))
        sort_label.set_alignment(0,0.5)
        self.sort_combo=gtk.combo_box_entry_new_text()
        self.sort_combo.child.set_editable(False)
        self.sort_combo.set_size_request(130,-1)
        sort_columns=[_("Subject"),_("From"),_("Date"),_("Score")]
        for column in sort_columns:
            self.sort_combo.append_text(column)

        sort_table.attach(self.sort_order_checkbutton,0,1,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        sort_table.attach(self.sort_combo,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        sort_table.attach(sort_label,1,2,1,2,gtk.EXPAND|gtk.FILL,2)
        sort_main_vbox.pack_start(sort_table,False,False)
        
        groups_view_vbox.pack_start(sort_main_vbox,False,True)





        charset_vbox=gtk.VBox()
        charset_vbox.set_border_width(4)
        charset_label=gtk.Label()
        charset_label.set_markup("<b>"+_("Charsets")+"</b>")
        charset_label.set_alignment(0,0.5)
        charset_vbox.pack_start(charset_label,False,False,4)
        charset_table=gtk.Table(2,2,False)
        charset_table.set_border_width(4)
        fallback_charset_label=gtk.Label(_("Fallback Charset (Reading)"))
        fallback_charset_label.set_alignment(0,0.5)

        self.fallback_charset_combo=gtk.combo_box_entry_new_text()
        self.fallback_charset_combo.set_size_request(130,-1)
        for encoding in encodings_list:
            self.fallback_charset_combo.append_text(encoding)
        self.fallback_charset_combo.child.set_tooltip_text(encodings_tip)

        self.fallback_charset_combo.child.set_editable(False)

        self.charset_list_button=gtk.Button(_("Charsets List"))
        self.charset_list_button.connect("clicked",self.open_charset_list_win)
        self.charset_list_button.set_size_request(130,-1)
        self.charset_list_button.set_tooltip_text(_("XPN will try to use the charsets in this order"))
        charset_list_label=gtk.Label(_("Ordered List (Writing)"))
        charset_list_label.set_alignment(0,0.5)

        charset_table.attach(self.fallback_charset_combo,0,1,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        charset_table.attach(fallback_charset_label,1,2,0,1,gtk.EXPAND|gtk.FILL,2)
        charset_table.attach(self.charset_list_button,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        charset_table.attach(charset_list_label,1,2,1,2,gtk.EXPAND|gtk.FILL,2) 
        
        charset_vbox.pack_start(charset_table,True,False,4)
        groups_view_vbox.pack_start(charset_vbox,False,True,2)
        
        threading_vbox=gtk.VBox()
        threading_vbox.set_border_width(4)
        threading_label=gtk.Label()
        threading_label.set_markup("<b>"+_("Threading Method")+"</b>")
        threading_label.set_alignment(0,0.5)
        threading_vbox.pack_start(threading_label,False,False,4)
        threading_table=gtk.Table(1,1,False)
        threading_table.set_border_width(4)
        self.threading_method_radiobutton1=gtk.RadioButton(None,_("Fast (but imprecise) old Algorithm"))
        self.threading_method_radiobutton2=gtk.RadioButton(self.threading_method_radiobutton1,_("Slow (but precise) new Algorithm"))
        threading_table.attach(self.threading_method_radiobutton1,0,1,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        threading_table.attach(self.threading_method_radiobutton2,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        threading_vbox.pack_start(threading_table,True,False,4)
        
        groups_view_vbox.pack_start(threading_vbox,False,True,2)

        main_nav_vbox=gtk.VBox()
        main_nav_vbox.set_border_width(4)
        misc_main_label=gtk.Label()
        misc_main_label.set_markup("<b>"+_("Miscellaneous")+"</b>")
        misc_main_label.set_alignment(0,0.5)
        main_nav_vbox.pack_start(misc_main_label,False,False,4)
        misc_table=gtk.Table(5,2,False)
        misc_table.set_border_width(4)
        self.advance_on_mark_checkbutton=gtk.CheckButton(_("Advance to the Next Article on Mark"))
        self.oneclick_checkbutton=gtk.CheckButton(_("One Click Enter Group"))
        self.oneclick_article_checkbutton=gtk.CheckButton(_("One Click Enter Article"))
        self.expand_groups_checkbutton=gtk.CheckButton(_("Expand Group on Entering"))
        one_key_label=gtk.Label(_("Scroll Text (% of page)"))
        one_key_label.set_size_request(200,-1)
        one_key_label.set_alignment(0,0.5)
        self.one_key_spin=gtk.SpinButton(gtk.Adjustment(value=50,lower=1,upper=100,step_incr=1,page_incr=10))
        
        misc_table.attach(self.advance_on_mark_checkbutton,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        misc_table.attach(self.oneclick_checkbutton,0,1,2,3,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        misc_table.attach(self.oneclick_article_checkbutton,0,1,3,4,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        misc_table.attach(self.expand_groups_checkbutton,0,1,4,5,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        misc_table.attach(self.one_key_spin,0,1,5,6,gtk.FILL,gtk.FILL,16,2)
        misc_table.attach(one_key_label,1,2,5,6,gtk.EXPAND|gtk.FILL,gtk.FILL,2)

        main_nav_vbox.pack_start(misc_table,False,False)

        groups_nav_vbox.pack_start(main_nav_vbox,False,True,2)

        
        notebook.append_page(groups_download_vbox,label_groups_download)
        notebook.append_page(groups_view_vbox,label_groups_view)
        notebook.append_page(groups_nav_vbox,label_groups_nav)

        return notebook


    def build_misc_page(self):
        notebook=gtk.Notebook()
        label_misc=gtk.Label()
        label_misc.set_markup("<b>"+_("External Apps")+"</b>")

        label_misc_2=gtk.Label()
        label_misc_2.set_markup("<b>"+_("Miscellaneous")+"</b>")

        miscellaneous_vbox=gtk.VBox()
        miscellaneous_vbox_2=gtk.VBox()

        browser_table=gtk.Table()
        browser_table.set_border_width(4)
        browser_main_vbox=gtk.VBox()
        browser_main_vbox.set_border_width(4)
        browser_main_label=gtk.Label()
        browser_main_label.set_markup("<b>"+_("Web Browser")+"</b>")
        browser_main_label.set_alignment(0,0.5)
        browser_main_vbox.pack_start(browser_main_label,False,False,4)

        self.browser_checkbutton=gtk.CheckButton(_("Use Custom Web Browser Launcher"))
        self.browser_checkbutton.connect("clicked",self.change_browser_status)
        self.browser_entry=gtk.Entry()
        self.browser_entry.set_tooltip_text(_("Type your custom command, %s represents the url.\nExamples:\n\nmozilla %s &\nxterm -e links %s"))

        self.browser_label=gtk.Label(_("Web Browser Launcher"))
        self.browser_label.set_alignment(0,0.5)

        browser_table.attach(self.browser_checkbutton,0,1,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        browser_table.attach(self.browser_entry,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        browser_table.attach(self.browser_label,1,2,1,2,gtk.EXPAND|gtk.FILL,2)


        browser_main_vbox.pack_start(browser_table,False,False)


        editor_table=gtk.Table()
        editor_table.set_border_width(4)
        editor_main_vbox=gtk.VBox()
        editor_main_vbox.set_border_width(4)
        editor_main_label=gtk.Label()
        editor_main_label.set_markup("<b>"+_("External Editor")+"</b>")
        editor_main_label.set_alignment(0,0.5)
        editor_main_vbox.pack_start(editor_main_label,False,False,4)
        self.editor_checkbutton=gtk.CheckButton(_("Always Use External Editor"))
        self.editor_entry=gtk.Entry()
        self.editor_entry.set_tooltip_text(_("""Type the editor launcher, %s represents the filename.\nExamples:\n\nxterm -e vim %s\ngvim -f %s\nnotepad.exe %s\n"C:\Program Files\Notepad++\Notepad++.exe" %s -nosession\n\nNOTE: This feature works only with *Nix and Windows systems"""))

        editor_label=gtk.Label(_("External Editor Command"))
        editor_label.set_alignment(0,0.5)

        editor_table.attach(self.editor_checkbutton,0,1,0,1,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        editor_table.attach(self.editor_entry,0,1,1,2,gtk.EXPAND|gtk.FILL,gtk.FILL,16,2)
        editor_table.attach(editor_label,1,2,1,2,gtk.EXPAND|gtk.FILL,2)



        editor_main_vbox.pack_start(editor_table,False,False)


        lang_vbox=gtk.VBox()
        lang_vbox.set_border_width(4)
        lang_vbox_label=gtk.Label()
        lang_vbox_label.set_markup("<b>"+_("Language")+"</b>")
        lang_vbox_label.set_alignment(0,0.5)
        lang_vbox.pack_start(lang_vbox_label,False,False,4)
        lang_hbox=gtk.HBox()
        langs_vbox=gtk.VBox()
        self.lang_en_radiobutton=gtk.RadioButton()
        lang_en_hbox=gtk.HBox()
        lang_en_label=gtk.Label(_("English"))
        lang_en_image=gtk.Image()
        lang_en_image.set_from_file("pixmaps/en.xpm")
        lang_en_hbox.pack_start(lang_en_image,True,True,2)
        lang_en_hbox.pack_start(lang_en_label,True,True,4)
        self.lang_en_radiobutton.add(lang_en_hbox)
       
        self.lang_it_radiobutton=gtk.RadioButton(self.lang_en_radiobutton)
        lang_it_hbox=gtk.HBox()
        lang_it_label=gtk.Label(_("Italian"))
        lang_it_image=gtk.Image()
        lang_it_image.set_from_file("pixmaps/it.xpm")
        lang_it_hbox.pack_start(lang_it_image,True,True,2)
        lang_it_hbox.pack_start(lang_it_label,True,True,4)
        self.lang_it_radiobutton.add(lang_it_hbox)

        self.lang_fr_radiobutton=gtk.RadioButton(self.lang_en_radiobutton)
        lang_fr_hbox=gtk.HBox()
        lang_fr_label=gtk.Label(_("French"))
        lang_fr_image=gtk.Image()
        lang_fr_image.set_from_file("pixmaps/fr.xpm")
        lang_fr_hbox.pack_start(lang_fr_image,True,True,2)
        lang_fr_hbox.pack_start(lang_fr_label,True,True,4)
        self.lang_fr_radiobutton.add(lang_fr_hbox)

        self.lang_de_radiobutton=gtk.RadioButton(self.lang_en_radiobutton)
        lang_de_hbox=gtk.HBox()
        lang_de_label=gtk.Label(_("German"))
        lang_de_image=gtk.Image()
        lang_de_image.set_from_file("pixmaps/de.xpm")
        lang_de_hbox.pack_start(lang_de_image,True,True,2)
        lang_de_hbox.pack_start(lang_de_label,True,True,4)
        self.lang_de_radiobutton.add(lang_de_hbox)
        
        langs_vbox.pack_start(self.lang_en_radiobutton,True,True,2)
        langs_vbox.pack_start(self.lang_it_radiobutton,True,True,2)
        langs_vbox.pack_start(self.lang_fr_radiobutton,True,True,2)
        langs_vbox.pack_start(self.lang_de_radiobutton,True,True,2)
        lang_hbox.pack_start(langs_vbox,True,False,2)
        lang_label=gtk.Label(_("You must restart XPN in order\n to get the translation active"))
        lang_hbox.pack_start(lang_label,True,False,4)
        lang_vbox.pack_start(lang_hbox,False,False)


        miscellaneous_vbox.pack_start(browser_main_vbox,False,True,2)
        miscellaneous_vbox.pack_start(editor_main_vbox,False,True,2)
        miscellaneous_vbox_2.pack_start(lang_vbox,False,True,2)
        
        notebook.append_page(miscellaneous_vbox,label_misc)
        notebook.append_page(miscellaneous_vbox_2,label_misc_2)

        return notebook

        
    def __init__(self,conf,main_win):
        self.configs=conf.get_configs()
        self.main_win=main_win
        self.win=gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.win.connect("delete_event",self.delete_event)
        self.win.set_title(_("XPN Preferences"))
        self.win.set_icon(gtk.gdk.pixbuf_new_from_file("pixmaps/conf.xpm"))
        self.win.set_default_size(470,400)
        self.win.set_position(gtk.WIN_POS_CENTER)

        #main_vbox
        self.main_vbox=gtk.VBox()
        self.win.add(self.main_vbox)
        
        #main_hbox
        self.main_hbox=gtk.HBox()
        self.evbox=gtk.EventBox()
        self.left_buttons=gtk.VButtonBox()
        self.left_buttons.set_layout(gtk.BUTTONBOX_EDGE)
        self.evbox.add(self.left_buttons)
        style = self.evbox.get_style()
        bgcolor = gtk.gdk.Color( 65535, 65535, 65535 )
        self.evbox.modify_bg( gtk.STATE_NORMAL, bgcolor )

        self.buttons={}
        self.insert_rb(_("Server"),"config-servers.png","server",_("Configure Server Profiles"))
        self.insert_rb(_("User"),"config-users.png","user",_("Configure User Profile"),self.buttons["server"])
        self.insert_rb(_("Display"),"config-display.png","display",_("Configure Display Profile"),self.buttons["server"])
        #self.insert_rb(_("Posting"),"config-posting.png","posting",_("Configure Posting Profile"),self.buttons["server"])
        self.insert_rb(_("Groups"),"config-groups.png","groups",_("Configure Group Properties"),self.buttons["server"])
        self.insert_rb(_("Misc"),"config-misc.png","misc",_("Configure Miscellaneous Properties"),self.buttons["server"])


        self.main_hbox.pack_start(self.evbox,False,False,4)
        self.main_vbox.pack_start(self.main_hbox,True,True,4)

        self.server_page=self.build_server_page()
        self.user_page=self.build_user_page()
        self.display_page=self.build_display_page()
#        self.posting_page=self.build_posting_page()
        self.groups_page=self.build_groups_page()
        self.misc_page=self.build_misc_page()


        self.main_hbox.pack_start(self.server_page,False,False)
        #self.show_config_pages(None,"Server")

        #buttons hbox
        self.buttons_hbox=gtk.HBox()
        self.main_vbox.pack_start(self.buttons_hbox,False,False,0)

        #cancel_button
        self.cancel_button=gtk.Button(None,gtk.STOCK_CANCEL)
        self.cancel_button.set_tooltip_text(_("Close window. Discard changes"))
        self.cancel_button.connect("clicked",self.destroy)
        self.buttons_hbox.pack_start(self.cancel_button,True,True,0)
        #ok_button
        self.ok_button=gtk.Button(None,gtk.STOCK_OK)
        self.ok_button.connect("clicked",self.save_configs,conf)
        self.ok_button.set_tooltip_text(_("Close window and save settings"))
        self.buttons_hbox.pack_start(self.ok_button,True,True,0)
        self.ok_button.set_border_width(5)
        self.cancel_button.set_border_width(5)

        self.update_all(self.configs)