~ubuntu-branches/ubuntu/oneiric/psi/oneiric

« back to all changes in this revision

Viewing changes to src/eventdlg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2006-01-20 00:20:36 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060120002036-7nw6yo6totip0ee5
Tags: 0.10-2
* Added upstream changelog (Closes: Bug#327748)
* Mention --no-gpg and --no-gpg-agent in manpage (Closes: Bug#204416)

Show diffs side-by-side

added added

removed removed

Lines of Context:
450
450
        bool enc;
451
451
        int transid;
452
452
        IconButton *pb_next;
453
 
        IconButton *pb_close, *pb_quote, *pb_deny, *pb_send, *pb_reply, *pb_auth;
 
453
        IconButton *pb_close, *pb_quote, *pb_deny, *pb_send, *pb_reply, *pb_chat, *pb_auth;
454
454
        ChatView *mle;
455
455
        AttachView *attachView;
456
456
        QTimer *whois;
499
499
};
500
500
 
501
501
EventDlg::EventDlg(const QString &to, PsiCon *psi, PsiAccount *pa)
502
 
:QWidget(0, 0, WDestructiveClose | WGroupLeader)
 
502
:AdvancedWidget<QWidget>(0, 0, WDestructiveClose | WGroupLeader)
503
503
{
504
504
        d = new Private(this);
505
505
        d->composing = true;
565
565
}
566
566
 
567
567
EventDlg::EventDlg(const Jid &j, PsiAccount *pa, bool unique)
568
 
:QWidget(0, 0, WDestructiveClose | WGroupLeader)
 
568
:AdvancedWidget<QWidget>(0, 0, WDestructiveClose | WGroupLeader)
569
569
{
570
570
        d = new Private(this);
571
571
        d->composing = false;
818
818
        d->pb_send->hide();
819
819
        d->pb_send->setMinimumWidth(96);
820
820
        hb4->addWidget(d->pb_send);
 
821
        d->pb_chat = new IconButton(this);
 
822
        d->pb_chat->setText(tr("&Chat"));
 
823
        connect(d->pb_chat, SIGNAL(clicked()), SLOT(doChat()));
 
824
        d->pb_chat->hide();
 
825
        d->pb_chat->setMinimumWidth(96);
 
826
        hb4->addWidget(d->pb_chat);
821
827
        d->pb_reply = new IconButton(this);
822
828
        d->pb_reply->setText(tr("&Reply"));
823
829
        connect(d->pb_reply, SIGNAL(clicked()), SLOT(doReply()));
1239
1245
                doSend();
1240
1246
        else if(e->key() == Key_H && (e->state() & ControlButton))
1241
1247
                doHistory();
 
1248
        else if(e->key() == Key_I && (e->state() & ControlButton))
 
1249
                doInfo();
1242
1250
        else
1243
1251
                e->ignore();
1244
1252
}
1317
1325
        aReadNext(d->realJid);
1318
1326
}
1319
1327
 
 
1328
void EventDlg::doChat()
 
1329
{
 
1330
        QStringList list = stringToList(d->le_from->text());
 
1331
        if(list.isEmpty())
 
1332
                return;
 
1333
 
 
1334
        // FIXME: Maybe it's better without bare(), but then PsiAccount::actionChat
 
1335
        // doesn't find the UserListItem to chat with :-(
 
1336
        Jid jf(list[0]);
 
1337
        Jid j(jf.bare());
 
1338
        aChat(j);
 
1339
}
 
1340
 
1320
1341
void EventDlg::doReply()
1321
1342
{
1322
1343
        QStringList list = stringToList(d->le_from->text());
1489
1510
                d->pb_auth->hide();
1490
1511
                d->pb_deny->hide();
1491
1512
 
 
1513
                d->pb_chat->show();
1492
1514
                d->pb_reply->show();
1493
1515
                d->pb_quote->show();
1494
1516
 
1529
1551
                        d->mle->setTextFormat(RichText);
1530
1552
                        d->mle->setText("<qt>" + body + "</qt>");
1531
1553
 
 
1554
                        d->pb_chat->show();
1532
1555
                        d->pb_reply->hide();
1533
1556
                        d->pb_quote->hide();
1534
1557
 
1544
1567
 
1545
1568
                        d->pb_auth->hide();
1546
1569
                        d->pb_deny->hide();
 
1570
                        d->pb_chat->show();
1547
1571
                        d->pb_reply->show();
1548
1572
                        d->pb_quote->show();
1549
1573
                }
1555
1579
 
1556
1580
                        d->pb_auth->hide();
1557
1581
                        d->pb_deny->hide();
 
1582
                        d->pb_chat->show();
1558
1583
                        d->pb_reply->show();
1559
1584
                        d->pb_quote->show();
1560
1585
                }