220
225
self.pack_start(self.rgba, False)
221
226
self.pack_start(self.disableTray, False)
222
self.pack_start(frame, False)
227
self.pack_start(frame1, False)
228
self.pack_start(frame2, False)
224
230
def save(self, widget=None):
225
231
self.config.glob['rgbaColormap'] = self.rgba.get_active()
226
232
self.config.glob['disableTrayIcon'] = self.disableTray.get_active()
227
233
self.urlSettings.save()
234
self.emailSettings.save()
236
class EmailSettings(gtk.VBox):
237
def __init__(self, config):
238
gtk.VBox.__init__(self)
241
self.set_border_width(8)
245
markup = _('By default, your e-mails will be opened with <b>your webbrowser</b>.'
246
'But you can change these settings, deciding to open you e-mails with a specific e-mail program.')
248
self.infolabel = gtk.Label()
249
self.infolabel.set_markup(markup)
250
self.infolabel.set_line_wrap(True)
251
self.infolabel.set_alignment(0.0, 0.0)
253
self.hboxentry = gtk.HBox()
254
self.entry = gtk.Entry()
255
self.entry.connect('activate', self.save)
256
self.hboxentry.pack_start(gtk.Label(_('Command line:')), False)
257
self.hboxentry.pack_start(self.entry)
259
self.override = gtk.CheckButton(_('Override default settings'))
260
self.override.set_active(self.config.glob['overrideMail'] != '')
261
self.override.connect('toggled', self.toggleOverride)
263
self.hboxtest = gtk.HBox()
264
self.testbutton = gtk.Button(_('Click to test'))
265
self.testbutton.connect('clicked', self.testMail)
266
self.hboxtest.pack_start(gtk.Label())
267
self.hboxtest.pack_start(self.testbutton, False, True, 6)
269
self.pack_start(self.infolabel, False)
270
self.pack_start(self.override, False)
271
self.pack_start(self.hboxentry, False)
272
self.pack_start(self.hboxtest, False)
274
self.toggleOverride()
276
def toggleOverride(self, override=None):
277
active = self.override.get_active()
278
self.hboxentry.set_sensitive(active)
279
self.hboxtest.set_sensitive(active)
281
self.entry.set_text(self.config.glob['overrideMail'])
283
self.entry.set_text('')
286
def save(self, widget=None):
287
self.config.glob['overrideMail'] = self.entry.get_text()
289
def testMail(self, button):
292
os.popen(self.config.glob['overrideMail'])
230
296
class UrlSettings(gtk.VBox):
231
297
def __init__(self, config):
612
678
self.mainvbox.set_size_request(60, -1)
613
679
add(self.mainvbox, 'showMenu', _('Show _menu bar'), 10)
614
680
add(self.mainvbox, 'showUserPanel', _('Show _user panel'), 20)
615
add(self.mainvbox, 'showSearchEntry', _('Show _search entry'), 10)
616
add(self.mainvbox, None, None, 80)
617
add(self.mainvbox, 'showStatusCombo', _('Show status _combo'), 10)
681
if self.config.user['statusComboOnTop']:
682
add(self.mainvbox, 'showStatusCombo', _('Always show _search entry'), 10)
683
add(self.mainvbox, 'showSearchEntry', _('Show _search entry'), 10)
684
add(self.mainvbox, None, None, 80)
686
add(self.mainvbox, 'showSearchEntry', _('Always show _search entry'), 10)
687
add(self.mainvbox, None, None, 80)
688
add(self.mainvbox, 'showStatusCombo', _('Show status _combo'), 10)
619
690
mainwindowlabel = gtk.Label()
620
691
mainwindowlabel.set_markup('<b>' + _('Main window') + '</b>')
621
692
mainwindowlabel.set_alignment(0.5, 0.0)
622
693
self.mainalign.add(self.mainvbox)
623
self.maindescvbox.pack_start(mainwindowlabel)
624
694
self.maindescvbox.pack_start(self.mainalign, False)
625
self.windowshbox.pack_start(self.maindescvbox)
627
696
self.convdescvbox = gtk.VBox()
628
697
self.convalign = gtk.Alignment(0.5, 0.5, 0.0, 0.0)
629
698
self.convbox1 = gtk.VBox()
652
721
convwindowlabel.set_markup('<b>' + _('Conversation Window') + '</b>')
653
722
convwindowlabel.set_alignment(0.5, 0.0)
654
723
self.convalign.add(self.convbox1)
655
self.convdescvbox.pack_start(convwindowlabel)
656
self.convdescvbox.pack_start(self.convalign, True)
657
self.windowshbox.pack_start(self.convdescvbox)
659
self.pack_start(self.windowshbox)
661
self.pack_start(self.label, True)
724
self.convdescvbox.pack_start(self.convalign, False)
726
#self.pack_start(self.windowshbox)
727
notebook = gtk.Notebook()
728
notebook.append_page(self.maindescvbox, mainwindowlabel)
729
notebook.append_page(self.convdescvbox, convwindowlabel)
730
notebook.set_tab_pos(gtk.POS_TOP)
732
self.pack_start(notebook)
733
self.pack_start(self.label, False)
664
mkcheck(self, 'windows', _('Use multiple _windows'))
665
mkcheck(self, 'showTabCloseButton', _('Show close button on _each tab'))
666
mkcheck(self, 'avatarsInUserList', _('Show _avatars'))
667
mkcheck(self, 'avatarsOnRight', _('Put avatars in the _right side'))
668
mkcheck(self, 'avatarsInTaskbar', _('Show avatars in task_bar'))
669
mkcheck(self, 'hideNewWindow', _('Hide new conversation window automatically'))
670
mkcheck(self, 'showMailTyping', _('Show ma_il on "is typing" message'))
671
mkcheck(self, 'disableEsc', _('Don\'t _close conversation by pressing ESC'))
672
mkcheck(self, 'dontDisturbOnBusy', _('Don\'t disturb on busy _status'))
673
mkcheck(self, 'preventClosingTime', _('Prevent closing window when a new message arrives'))
736
mkcheck(self.convdescvbox, 'windows', _('Use multiple _windows'), self)
737
mkcheck(self.convdescvbox, 'showTabCloseButton', \
738
_('Show close button on _each tab'), self)
739
mkcheck(self.maindescvbox, 'avatarsInUserList', \
740
_('Show _avatars in user list'), self)
741
mkcheck(self.convdescvbox, 'avatarsOnRight', \
742
_('Put avatars in the _right side'), self)
743
mkcheck(self.maindescvbox, 'statusComboOnTop', \
744
_('Put status combo on the top side (requires restart)'), self)
745
mkcheck(self.convdescvbox, 'avatarsInTaskbar', \
746
_('Show avatars in task_bar'), self)
747
mkcheck(self.convdescvbox, 'hideNewWindow', \
748
_('Hide new conversation window automatically'), self)
749
mkcheck(self.convdescvbox, 'showMailTyping', \
750
_('Show ma_il on "is typing" message'), self)
751
mkcheck(self.convdescvbox, 'disableEsc', \
752
_('Don\'t _close conversation by pressing ESC'), self)
753
mkcheck(self.maindescvbox, 'dontDisturbOnBusy', \
754
_('Don\'t disturb on busy _status'), self)
755
mkcheck(self.convdescvbox, 'preventClosingTime', \
756
_('Prevent closing window when a new message arrives'), self)
757
mkcheck(self.convdescvbox, 'showLastMessageReceivedAt', \
758
_('Show "last message received at.." in conversation status bar'), self)
848
936
image2 = gtk.image_new_from_stock(gtk.STOCK_GO_FORWARD, gtk.ICON_SIZE_BUTTON)
849
937
button2.set_image(image2)
850
938
button2.connect('clicked', self.block)
851
self.view1.connect("key-press-event", self.onKeyPressOfView1)
852
939
vbox.pack_start(button1, True, False)
853
940
vbox.pack_start(button2, True, False)
854
941
hbox.pack_start(vbox, False)
856
943
scroll2 = gtk.ScrolledWindow()
857
944
scroll2.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
858
945
hbox.add(scroll2)
859
946
self.model2 = gtk.ListStore(gobject.TYPE_STRING)
860
947
self.view2 = gtk.TreeView(self.model2)
861
948
self.view2.connect('button-press-event', self.right_click2)
949
self.view2.connect("key-press-event", self.onKeyPressOfView2)
862
950
scroll2.add(self.view2)
863
951
render2 = gtk.CellRendererText()
864
952
col2 = gtk.TreeViewColumn(_('Block list:'), render2, text=0)
865
953
col2.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
866
954
col2.set_cell_data_func(render2, self.func)
867
955
self.view2.append_column(col2)
868
self.view2.connect("key-press-event", self.onKeyPressOfView2)
870
957
for contact in self.controller.msn.contactManager.lists['Allow']:
871
958
self.model1.append([contact])
872
959
for contact in self.controller.msn.contactManager.lists['Block']:
873
960
self.model2.append([contact])
877
962
##Draw the statusBar
878
963
eventBox = gtk.EventBox()
879
964
box = gtk.HBox(False, 0)
883
968
eventBox.modify_bg(gtk.STATE_NORMAL, self.controller.tooltipColor)
884
969
firstLabel = gtk.Label(_('Yellow contacts are not in your contact list'))
885
970
secondLabel = gtk.Label(_('Purple contacts don\'t have you in their contact list'))
887
image.set_from_stock (gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_LARGE_TOOLBAR)
888
box.pack_start(image, False, False,10 )
889
otherBox.pack_start(firstLabel, False, False,2 )
890
otherBox.pack_start(secondLabel, False, False,2 )
971
image = gtk.image_new_from_stock(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_LARGE_TOOLBAR)
972
box.pack_start(image, False, False, 10)
973
otherBox.pack_start(firstLabel, False, False, 2)
974
otherBox.pack_start(secondLabel, False, False, 2)
891
975
box.pack_start(otherBox, False, False, 10)
893
self.pack_start(eventBox, False, False,5)
976
self.pack_start(eventBox, False, False, 5)
895
978
def right_click1(self, view, event):
896
979
'''Occurs when somebody clicks in the allow list'''
897
980
selection = self.view2.get_selection()
957
1040
def addcon(self, item, contact):
958
1041
self.controller.contacts.add(contact)
960
def delete1(self, item, iter=None):
962
iter = self.view1.get_selection().get_selected()[1]
1043
def delete1(self, item, iter):
965
1044
contact = self.model1.get_value(iter, 0)
966
1045
self.model1.remove(iter)
967
1046
self.controller.msn.contactManager.lists['Allow'].remove(contact)
968
1047
if self.controller.contacts.exists(contact):
969
self.controller.contacts.remove(contact)
1048
self.controller.msn.removeUser(contact)
970
1049
if contact not in self.controller.msn.contactManager.contacts:
971
1050
soap.requests.delete_role(self.controller.msn.proxy, 'Allow', contact, None, None)
973
def delete2(self, item, iter=None):
975
iter = self.view2.get_selection().get_selected()[1]
1052
def delete2(self, item, iter):
978
1053
contact = self.model2.get_value(iter, 0)
979
1054
self.model2.remove(iter)
980
1055
self.controller.msn.contactManager.lists['Block'].remove(contact)
981
1056
if self.controller.contacts.exists(contact):
982
self.controller.contacts.remove(contact)
1057
self.controller.msn.removeUser(contact)
983
1058
if contact not in self.controller.msn.contactManager.contacts:
984
1059
soap.requests.delete_role(self.controller.msn.proxy, 'Block', contact, None, None)
1022
1097
'''called when the user press a key'''
1023
1098
if event.keyval == gtk.keysyms.Right or event.keyval == gtk.keysyms.Return:
1024
1099
self.block(None)
1025
elif event.keyval == gtk.keysyms.Delete or event.keyval == gtk.keysyms.Return:
1030
1101
def onKeyPressOfView2(self , widget, event):
1031
1102
'''called when the user press a key'''
1032
1103
if event.keyval == gtk.keysyms.Left or event.keyval == gtk.keysyms.Return:
1033
1104
self.unblock(None)
1034
elif event.keyval == gtk.keysyms.Delete or event.keyval == gtk.keysyms.Return:
1106
def manageDeleteConfirmation1(self, *args):
1108
if args[0] == abstract.stock.YES:
1109
self.delete1(None, iter)
1111
def deleteConfirmation1(self, item, iter):
1112
contactName = self.model1.get_value(iter, 0)
1113
message = _('Are you sure you want to delete %s from your authorized contacts?') % contactName
1114
dialog.yes_no(message, self.manageDeleteConfirmation1, iter)
1116
def manageDeleteConfirmation2(self, *args):
1118
if args[0] == abstract.stock.YES:
1119
self.delete2(None, iter)
1121
def deleteConfirmation2(self, item, iter):
1122
contactName = self.model2.get_value(iter, 0)
1123
message = _('Are you sure you want to delete %s from your blocked contacts?') % contactName
1124
dialog.yes_no(message, self.manageDeleteConfirmation2, iter)
1040
1126
class WebcamTab(gtk.VBox):
1041
1127
'''This class represents the panel with the Webcam settings'''
1182
1268
self.config.user['webcamSaturation'] = self.sadj.value
1185
def mkcheck(self, id, label):
1271
def mkcheck(self, id, label, realparent=None):
1186
1272
'''little helper function to add checkbuttons'''
1187
1273
check = gtk.CheckButton(label)
1188
check.set_active(self.config.user[id])
1189
check.connect('toggled', self.onToggled, id)
1274
if realparent is None:
1275
check.set_active(self.config.user[id])
1276
check.connect('toggled', self.onToggled, id)
1277
self.pack_start(check, False, False, padding=0)
1278
setattr(self, id, check)
1279
self.checks.append(id)
1282
check.set_active(realparent.config.user[id])
1283
check.connect('toggled', realparent.onToggled, id)
1190
1284
self.pack_start(check, False, False, padding=0)
1191
setattr(self, id, check)
1192
self.checks.append(id)
1285
setattr(realparent, id, check)
1286
realparent.checks.append(id)
1194
1289
# moved from emesenecommon
1195
1290
def rgbToHexa(color):
1196
1291
'''take a gtk.gdk.Color end returns a string with html way color.