361
363
QPopupMenu *pm = new QPopupMenu;
362
364
pm->insertItem(IconsetFactory::icon("psi/sendMessage"), tr("Send &message"), 0);
363
pm->insertItem(IconsetFactory::icon("psi/chat"), tr("Open &chat window"), 1);
365
pm->insertItem(IconsetFactory::icon("psi/start-chat"), tr("Open &chat window"), 1);
364
366
pm->insertSeparator();
365
367
//pm->insertItem(tr("Send &file"), 4);
366
368
//pm->insertSeparator();
685
689
setIcon(IconsetFactory::icon("psi/groupChat"));
688
d->act_find = new IconAction(tr("Find"), "psi/search", tr("&Find"), CTRL+Key_F, this);
689
connect(d->act_find, SIGNAL(activated()), SLOT(openFind()));
691
QVBoxLayout *dlg_layout = new QVBoxLayout(this);
693
QSplitter *vsplit = new QSplitter(this);
694
vsplit->setOrientation( QSplitter::Vertical );
695
dlg_layout->addWidget(vsplit);
692
QVBoxLayout *dlg_layout = new QVBoxLayout(this, 4);
695
if ( !option.chatLineEdit ) {
696
vsplit = new QSplitter(this);
697
((QSplitter *)vsplit)->setOrientation( QSplitter::Vertical );
698
dlg_layout->addWidget(vsplit);
697
703
// --- top part ---
698
704
QWidget *sp_top = new QWidget(vsplit);
699
QVBoxLayout *vb_top = new QVBoxLayout(sp_top, 4);
705
sp_top->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
706
if ( option.chatLineEdit )
707
dlg_layout->addWidget( sp_top );
708
QVBoxLayout *vb_top = new QVBoxLayout(sp_top, 0, 4);
702
QHBoxLayout *hb_top = new QHBoxLayout(vb_top);
711
QWidget *sp_top_top = new QWidget( sp_top );
712
vb_top->addWidget( sp_top_top );
713
QHBoxLayout *hb_top = new QHBoxLayout( sp_top_top, 0, 4 );
704
d->pb_topic = new QPushButton(tr("Topic:"), sp_top);
715
d->pb_topic = new QPushButton(tr("Topic:"), sp_top_top);
705
716
connect(d->pb_topic, SIGNAL(clicked()), SLOT(doTopic()));
706
717
hb_top->addWidget(d->pb_topic);
708
d->le_topic = new QLineEdit(sp_top);
719
d->le_topic = new QLineEdit(sp_top_top);
709
720
d->le_topic->setReadOnly(true);
710
721
hb_top->addWidget(d->le_topic);
712
IconToolButton *tb_find = new IconToolButton(sp_top);
713
tb_find->setIcon(IconsetFactory::iconPtr("psi/search"));
714
connect(tb_find, SIGNAL(clicked()), SLOT(openFind()));
715
hb_top->addWidget(tb_find);
723
d->act_find = new IconAction(tr("Find"), "psi/search", tr("&Find"), CTRL+Key_F, this);
724
connect(d->act_find, SIGNAL(activated()), SLOT(openFind()));
725
d->act_find->addTo( sp_top_top );
717
QLabel *lb_ident = d->pa->accountLabel(sp_top, true);
727
QLabel *lb_ident = d->pa->accountLabel(sp_top_top, true);
718
728
lb_ident->setSizePolicy(QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ));
719
729
hb_top->addWidget(lb_ident);
734
748
// --- bottom part ---
735
749
QWidget *sp_bottom = new QWidget(vsplit);
736
QVBoxLayout *vb_bottom = new QVBoxLayout(sp_bottom, 4);
740
//connect(pa->psi->iconSelectPopup(), SIGNAL(iconSelected(const Icon *)), d, SLOT(addEmoticon(const Icon *)));
750
sp_bottom->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );
751
if ( option.chatLineEdit )
752
dlg_layout->addWidget( sp_bottom );
753
QVBoxLayout *vb_bottom = new QVBoxLayout(sp_bottom);
756
d->act_clear = new IconAction (tr("Clear chat window"), "psi/clearChat", tr("Clear chat window"), 0, this);
757
connect( d->act_clear, SIGNAL( activated() ), SLOT( doClearButton() ) );
741
759
connect(pa->psi()->iconSelectPopup(), SIGNAL(textSelected(QString)), d, SLOT(addEmoticon(QString)));
743
d->tb_clear = new IconToolButton(sp_bottom) ;
744
d->tb_clear->setIcon(IconsetFactory::iconPtr("psi/clearChat"));
745
connect(d->tb_clear, SIGNAL(clicked()), SLOT(doClearButton()));
747
d->tb_icon = new IconToolButton(sp_bottom);
748
d->tb_icon->setIcon(IconsetFactory::iconPtr("psi/smile"));
749
d->tb_icon->setPopup(pa->psi()->iconSelectPopup());
750
d->tb_icon->setPopupDelay (1);
752
QHBoxLayout *toolbox = new QHBoxLayout(vb_bottom);
753
toolbox->addWidget(d->tb_clear);
754
toolbox->addStretch();
755
toolbox->addWidget(d->tb_icon);
760
d->act_icon = new IconAction( tr( "Select icon" ), "psi/smile", tr( "Select icon" ), 0, this );
761
d->act_icon->setPopup( pa->psi()->iconSelectPopup() );
763
d->toolbar = new PsiToolBar( tr("Groupchat toolbar"), 0, sp_bottom );
764
d->toolbar->setCustomizeable( false ); // it isn't ready now, and we don't want segfaults
765
d->toolbar->setFrameShape( QFrame::NoFrame );
766
vb_bottom->addWidget( d->toolbar );
768
d->act_clear->addTo( d->toolbar );
769
d->toolbar->setStretchableWidget(new StretchWidget(d->toolbar));
770
d->act_icon->addTo( d->toolbar );
758
d->mle = new ChatEdit(sp_bottom);
759
//d->mle->setFixedHeight(48);
760
vb_bottom->addWidget(d->mle);
773
if ( !option.chatLineEdit ) {
774
d->mle = new ChatEdit(sp_bottom);
775
vb_bottom->addWidget(d->mle);
778
QHBoxLayout *hb5 = new QHBoxLayout( dlg_layout );
779
d->mle = new LineEdit( vsplit );
781
hb5->addSpacing( 16 );
783
hb5->addWidget( d->mle );
785
hb5->addSpacing( 16 );
761
789
d->mle->installEventFilter( d );
791
d->pm_settings = new QPopupMenu(this);
792
connect(d->pm_settings, SIGNAL(aboutToShow()), SLOT(buildMenu()));
763
794
// resize the horizontal splitter
764
795
QValueList<int> list;
1422
void GCMainDlg::contextMenuEvent(QContextMenuEvent *)
1424
d->pm_settings->exec(QCursor::pos());
1427
void GCMainDlg::buildMenu()
1430
d->pm_settings->clear();
1431
d->pm_settings->insertItem(tr("Toggle Compact/Full Size"), this, SLOT(toggleSmallChat()));
1433
d->act_clear->addTo( d->pm_settings );
1434
d->pm_settings->insertSeparator();
1436
d->act_icon->addTo( d->pm_settings );
1439
void GCMainDlg::toggleSmallChat()
1441
d->smallChat = !d->smallChat;
1380
1445
//----------------------------------------------------------------------------