1388
1410
self.controller, \
1391
#self.fontFace = gtk.ToolButton()
1392
#self.fontFace.set_stock_id(gtk.STOCK_SELECT_FONT)
1393
#self.fontFace.connect('clicked', self.on_font_face_clicked)
1396
self.fontFace = gtk.ToolButton()
1397
if self.controller.theme.getImage('fontface'):
1415
if self.config.user['toolFontType']:
1416
self.fontFace = gtk.ToolButton()
1417
if self.controller.theme.getImage('fontface'):
1398
1418
fontfaceicon = gtk.Image()
1399
1419
fontfaceicon.set_from_pixbuf(self.controller.theme.getImage('fontface'))
1400
1420
self.fontFace.set_icon_widget(fontfaceicon)
1402
1422
self.fontFace.set_stock_id(gtk.STOCK_SELECT_FONT)
1403
self.fontFace.connect('clicked', self.on_font_face_clicked)
1423
self.fontFace.connect('clicked', self.on_font_face_clicked)
1424
self.insert(self.fontFace, -1)
1425
self.fontFace.set_tooltip_text(_('Font selection'))
1428
self.fontFace = None
1405
#self.fontColor = gtk.ToolButton()
1406
#self.fontColor.set_stock_id(gtk.STOCK_SELECT_COLOR)
1407
#self.fontColor.connect('clicked', self.on_font_color_clicked)
1410
self.fontColor = gtk.ToolButton()
1411
if self.controller.theme.getImage('fontcolor'):
1431
if self.config.user['toolFontColor']:
1432
self.fontColor = gtk.ToolButton()
1433
if self.controller.theme.getImage('fontcolor'):
1412
1434
fontcoloricon = gtk.Image()
1413
1435
fontcoloricon.set_from_pixbuf(self.controller.theme.getImage('fontcolor'))
1414
1436
self.fontColor.set_icon_widget(fontcoloricon)
1416
1438
self.fontColor.set_stock_id(gtk.STOCK_SELECT_COLOR)
1417
self.fontColor.connect('clicked', self.on_font_color_clicked)
1419
#self.fontStyleButton = gtk.ToolButton()
1420
#self.fontStyleButton.set_label(_('Fontstyle'))
1421
#self.fontStyleButton.set_stock_id(gtk.STOCK_BOLD)
1422
#self.fontStyleButton.connect('clicked', self.showFontStyleWindow)
1439
self.fontColor.connect('clicked', self.on_font_color_clicked)
1440
self.insert(self.fontColor, -1)
1441
self.fontColor.set_tooltip_text(_('Font color selection'))
1444
self.fontColor = None
1424
1446
#font style button
1425
self.fontStyleButton = gtk.ToolButton()
1426
self.fontStyleButton.set_label(_('Fontstyle'))
1427
if self.controller.theme.getImage('fontstyle'):
1447
if self.config.user['toolFontStyle']:
1448
self.fontStyleButton = gtk.ToolButton()
1449
self.fontStyleButton.set_label(_('Fontstyle'))
1450
if self.controller.theme.getImage('fontstyle'):
1428
1451
fonticon = gtk.Image()
1429
1452
fonticon.set_from_pixbuf(self.controller.theme.getImage('fontstyle'))
1430
1453
self.fontStyleButton.set_icon_widget(fonticon)
1432
1455
self.fontStyleButton.set_stock_id(gtk.STOCK_BOLD)
1433
self.fontStyleButton.connect('clicked', self.showFontStyleWindow)
1456
self.fontStyleButton.connect('clicked', self.showFontStyleWindow)
1457
self.insert(self.fontStyleButton, -1)
1458
self.fontStyleButton.set_tooltip_text(_('Font styles'))
1461
self.fontStyleButton = None
1435
#self.smilieButton = gtk.ToolButton()
1436
#self.smilieButton.set_label(_('Smilie'))
1437
#self.smilieButton.connect('clicked', self.showSmilieWindow)
1464
self.insert(gtk.SeparatorToolItem(), -1)
1439
1467
#smilie button, fixed for mac4lin
1440
smilieicon = gtk.Image()
1441
smilieicon.set_from_pixbuf(self.controller.theme.getImage('smilie'))
1442
self.smilieButton = gtk.ToolButton(smilieicon, _('Smilie'))
1443
self.smilieButton.connect('clicked', self.showSmilieWindow)
1445
#self.nudgeButton = gtk.ToolButton()
1446
#self.nudgeButton.set_label(_('Nudge'))
1447
#self.nudgeButton.connect('clicked', self.doNudge)
1468
if self.config.user['toolSmilies']:
1469
smilieicon = gtk.Image()
1470
smilieicon.set_from_pixbuf(self.controller.theme.getImage('smilie'))
1471
self.smilieButton = gtk.ToolButton(smilieicon, _('Smilie'))
1472
self.smilieButton.connect('clicked', self.showSmilieWindow)
1473
self.insert(self.smilieButton, -1)
1474
self.smilieButton.set_tooltip_text(_('Insert a smilie'))
1477
self.smilieButton = None
1449
1479
#nudge button, fixed for mac4lin
1450
nudgeicon = gtk.Image()
1451
nudgeicon.set_from_pixbuf(self.controller.theme.getImage('nudge'))
1452
self.nudgeButton = gtk.ToolButton(nudgeicon, _('Nudge'))
1453
self.nudgeButton.connect('clicked', self.doNudge)
1480
if self.config.user['toolNudge']:
1481
nudgeicon = gtk.Image()
1482
nudgeicon.set_from_pixbuf(self.controller.theme.getImage('nudge'))
1483
self.nudgeButton = gtk.ToolButton(nudgeicon, _('Nudge'))
1484
self.nudgeButton.connect('clicked', self.doNudge)
1485
self.insert(self.nudgeButton, -1)
1486
self.nudgeButton.set_tooltip_text(_('Send nudge'))
1489
self.nudgeButton = None
1455
#self.inviteButton = gtk.ToolButton()
1456
#self.inviteButton.set_label(_('Invite'))
1457
#self.inviteButton.set_stock_id(gtk.STOCK_ADD)
1458
#self.inviteButton.connect('clicked', self.showInviteDialog)
1492
self.insert(gtk.SeparatorToolItem(), -1)
1461
self.inviteButton = gtk.ToolButton()
1462
self.inviteButton.set_label(_('Invite'))
1463
if self.controller.theme.getImage('invite'):
1496
if self.config.user['toolInvite']:
1497
self.inviteButton = gtk.ToolButton()
1498
self.inviteButton.set_label(_('Invite'))
1499
if self.controller.theme.getImage('invite'):
1464
1500
inviteicon = gtk.Image()
1465
1501
inviteicon.set_from_pixbuf(self.controller.theme.getImage('invite'))
1466
1502
self.inviteButton.set_icon_widget(inviteicon)
1468
1504
self.inviteButton.set_stock_id(gtk.STOCK_ADD)
1469
self.inviteButton.connect('clicked', self.showInviteDialog)
1471
#imgclear = gtk.Image()
1472
#imgclear.set_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_LARGE_TOOLBAR)
1473
#self.clearButton = gtk.ToolButton(imgclear, _('Clear Conversation'))
1474
#self.clearButton.connect('clicked', self.clearOutputText)
1476
#clear conversation toolbar button
1477
imgclear = gtk.Image()
1478
if self.controller.theme.getImage('clear'):
1479
imgclear.set_from_pixbuf(self.controller.theme.getImage('clear'))
1505
self.inviteButton.connect('clicked', self.showInviteDialog)
1506
self.insert(self.inviteButton, -1)
1507
self.inviteButton.set_tooltip_text( \
1508
_('Invite a friend to the conversation'))
1481
imgclear.set_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_LARGE_TOOLBAR)
1482
self.clearButton = gtk.ToolButton(imgclear, _('Clear Conversation'))
1483
self.clearButton.connect('clicked', self.clearOutputText)
1485
#self.sendfileButton = gtk.ToolButton()
1486
#self.sendfileButton.set_label(_('Send File'))
1487
#self.sendfileButton.set_stock_id(gtk.STOCK_GOTO_TOP)
1488
#self.sendfileButton.connect('clicked', self.sendFileClicked)
1511
self.inviteButton = None
1491
self.sendfileButton = gtk.ToolButton()
1492
self.sendfileButton.set_label(_('Send File'))
1493
if self.controller.theme.getImage('sendfile'):
1514
if self.config.user['toolSendFile']:
1515
self.sendfileButton = gtk.ToolButton()
1516
self.sendfileButton.set_label(_('Send File'))
1517
if self.controller.theme.getImage('sendfile'):
1494
1518
imgsendfile = gtk.Image()
1495
1519
imgsendfile.set_from_pixbuf(self.controller.theme.getImage('sendfile'))
1496
1520
self.sendfileButton.set_icon_widget(imgsendfile)
1498
1522
self.sendfileButton.set_stock_id(gtk.STOCK_GOTO_TOP)
1499
self.sendfileButton.connect('clicked', self.sendFileClicked)
1523
self.sendfileButton.connect('clicked', self.sendFileClicked)
1524
self.insert(self.sendfileButton, -1)
1525
self.sendfileButton.set_tooltip_text(_('Send a file'))
1528
self.sendfileButton = None
1501
1530
# webcam send hax
1502
camicon = gtk.Image()
1503
camicon.set_from_pixbuf(self.controller.theme.getImage('cam'))
1504
self.sendWebcamButton = gtk.ToolButton(camicon, _('Send Webcam'))
1505
self.sendWebcamButton.connect('clicked', self.sendWebcamClicked)
1531
if self.config.user['toolWebcam']:
1532
camicon = gtk.Image()
1533
camicon.set_from_pixbuf(self.controller.theme.getImage('cam'))
1534
self.sendWebcamButton = gtk.ToolButton(camicon, _('Send Webcam'))
1535
self.sendWebcamButton.connect('clicked', self.sendWebcamClicked)
1536
self.insert(self.sendWebcamButton, -1)
1537
self.sendWebcamButton.set_tooltip_text(_('Send your Webcam'))
1540
self.sendWebcamButton = None
1543
self.insert(gtk.SeparatorToolItem(), -1)
1546
#clear conversation toolbar button
1547
if self.config.user['toolClear']:
1548
imgclear = gtk.Image()
1549
if self.controller.theme.getImage('clear'):
1550
imgclear.set_from_pixbuf(self.controller.theme.getImage('clear'))
1552
imgclear.set_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_LARGE_TOOLBAR)
1553
self.clearButton = gtk.ToolButton(imgclear, _('Clear Conversation'))
1554
self.clearButton.connect('clicked', self.clearOutputText)
1555
self.insert(self.clearButton, -1)
1556
self.clearButton.set_tooltip_text(_('Clear conversation'))
1559
self.clearButton = None
1562
self.insert(gtk.SeparatorToolItem(), -1)
1565
#remove the last separator
1566
count = self.get_n_items()
1567
item = self.get_nth_item(count-1)
1568
if isinstance(item, gtk.SeparatorToolItem):
1507
1571
# ENABLE THIS IF YOU IMPLEMENT INKDRAW P2P STACK
1508
1572
#self.inkdrawButton = gtk.ToolButton()
1509
1573
#self.inkdrawButton.set_label(_('Send Ink'))
1510
1574
#self.inkdrawButton.set_stock_id(gtk.STOCK_EDIT)
1511
1575
#self.inkdrawButton.connect('clicked', self.inkDrawClicked)
1513
# Add buttons to the toolbar
1514
self.insert(self.fontFace, -1)
1515
self.insert(self.fontColor, -1)
1516
self.insert(self.fontStyleButton, -1)
1518
self.insert(gtk.SeparatorToolItem(), -1)
1520
self.insert(self.smilieButton, -1)
1521
self.insert(self.nudgeButton, -1)
1523
self.insert(gtk.SeparatorToolItem(), -1)
1525
self.insert(self.inviteButton, -1)
1526
self.insert(self.sendfileButton, -1)
1527
self.insert(self.sendWebcamButton, -1)
1528
1576
#self.insert(self.inkdrawButton, -1)
1530
self.insert(gtk.SeparatorToolItem(), -1)
1532
self.insert(self.clearButton, -1)
1534
# Set tooltips to buttons
1535
self.fontFace.set_tooltip_text(_('Font selection'))
1536
self.fontColor.set_tooltip_text(_('Font color selection'))
1537
self.fontStyleButton.set_tooltip_text(_('Font styles'))
1538
self.smilieButton.set_tooltip_text(_('Insert a smilie'))
1539
self.nudgeButton.set_tooltip_text(_('Send nudge'))
1540
self.inviteButton.set_tooltip_text( \
1541
_('Invite a friend to the conversation'))
1542
self.clearButton.set_tooltip_text(_('Clear conversation'))
1543
self.sendfileButton.set_tooltip_text(_('Send a file'))
1544
self.sendWebcamButton.set_tooltip_text(_('Send your Webcam'))
1546
1578
self.show_all()
1548
1580
def setFontBold(self, value):