Ejemplo n.º 1
0
KviStringListSelector * KviOptionsWidget::addStringListSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled)
{
	m_iResetFlags |= (g_stringlistOptionsTable[optId].flags & KviOption_resetMask);
	KviStringListSelector * d = addStringListSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_STRINGLIST(optId)),bEnabled);
	QString tmp = m_szBasicTipStart;
	tmp += g_stringlistOptionsTable[optId].name;
	tmp += m_szBasicTipEnd;
	KviTalToolTip::add(d,tmp);
	return d;
}
OptionsWidget_highlighting::OptionsWidget_highlighting(QWidget * parent)
    : KviOptionsWidget(parent)
{
    setObjectName("highlighting_options_widget");

    createLayout();

    KviBoolSelector * b = addBoolSelector(0,0,0,0,__tr2qs_ctx("Enable word highlighting","options"),KviOption_boolUseWordHighlighting);
    KviStringListSelector * sl = addStringListSelector(0,1,0,1,__tr2qs_ctx("Words to highlight:","options"),KviOption_stringlistHighlightWords,KVI_OPTION_BOOL(KviOption_boolUseWordHighlighting));

    connect(b,SIGNAL(toggled(bool)),sl,SLOT(setEnabled(bool)));

    // This can be used even without Word highlighting
    b = addBoolSelector(0,2,0,2,__tr2qs_ctx("Highlight messages containing my nickname","options"),KviOption_boolAlwaysHighlightNick);
    mergeTip(b,__tr2qs_ctx("<center>If this option is enabled, KVIrc will highlight any user message containing your current nickname</center>","options"));

    b = addBoolSelector(0,3,0,3,__tr2qs_ctx("Words/Nick matching is case sensitive ","options"),KviOption_boolCaseSensitiveHighlighting);
    mergeTip(b,__tr2qs_ctx("<center>If this option is enabled, KVIrc will match your nick and/or the words you specified in a case sensitive manner</center>","options"));

    KviTalGroupBox * gbox = addGroupBox(0,4,0,4,Qt::Horizontal,__tr2qs_ctx("Highlighting Method","options"));

    // note: KviTalGroupBox automatically deletes its previous layout on setLayout()
    // note2: every QWidget will take ownership of its layout.
    QGridLayout * g = new QGridLayout();
    gbox->setLayout(g);

    m_pHighlightAllOccurencesRadioButton = new QRadioButton(__tr2qs_ctx("Highlight every occurence of a word inside text","options"),gbox);
    g->addWidget(m_pHighlightAllOccurencesRadioButton,0,0,1,2);
    m_pHighlightAllOccurencesRadioButton->setChecked(KVI_OPTION_BOOL(KviOption_boolUseFullWordHighlighting));
    KviTalToolTip::add(m_pHighlightAllOccurencesRadioButton,__tr2qs_ctx("<center>This selection will cause KVIrc to search for the highlighted words or nicknames inside the whole text. This will also highlight parts of words (eg. if your nickname is Mark then Markus will be highlighted too).</center>","options"));

    m_pHighlightWholeWordsOnlyRadioButton = new QRadioButton(__tr2qs_ctx("Highlight only whole words splitting on space and on:","options"),gbox);
    g->addWidget(m_pHighlightWholeWordsOnlyRadioButton,1,0,1,1);
    m_pHighlightWholeWordsOnlyRadioButton->setChecked(!KVI_OPTION_BOOL(KviOption_boolUseFullWordHighlighting));
    KviTalToolTip::add(m_pHighlightWholeWordsOnlyRadioButton,__tr2qs_ctx("<center>This selection will first split the string on the specified boundaries (including space) and then will compare all the parts with the highlighted words.</center>","options"));

    m_pWordSplitterCharactersEdit = new QLineEdit(gbox);
    m_pWordSplitterCharactersEdit->setText(KVI_OPTION_STRING(KviOption_stringWordSplitters));
    m_pWordSplitterCharactersEdit->setEnabled(!KVI_OPTION_BOOL(KviOption_boolUseFullWordHighlighting));
    g->addWidget(m_pWordSplitterCharactersEdit,1,1,1,1);

    connect(m_pHighlightWholeWordsOnlyRadioButton,SIGNAL(toggled(bool)),m_pWordSplitterCharactersEdit,SLOT(setEnabled(bool)));

    gbox = addGroupBox(0,5,0,5,Qt::Horizontal,__tr2qs_ctx("Alert Options","options"));

    b = addBoolSelector(gbox,__tr2qs_ctx("Flash the system taskbar entry on highlighted messages","options"),KviOption_boolFlashWindowOnHighlightedMessages);
    mergeTip(b,__tr2qs_ctx("<center>If this option is enabled, KVIrc will (attempt to) flash the system taskbar entry when a highlighted message is printed and KVIrc is not the active window</center>","options"));
    b = addBoolSelector(gbox,__tr2qs_ctx("Popup the notifier window on highlighted messages","options"),KviOption_boolPopupNotifierOnHighlightedMessages);
    mergeTip(b,__tr2qs_ctx("<center>If this option is enabled, KVIrc will popup a little notifier window in the low right corner of your desktop when a highlighted message is printed and KVIrc is not the active window</center>","options"));

    addRowSpacer(0,6,0,6);
}
Ejemplo n.º 3
0
OptionsWidget_antispam::OptionsWidget_antispam(QWidget * parent)
    : KviOptionsWidget(parent)
{
	setObjectName("antispam_options_widget");
	createLayout();

	KviTalGroupBox * g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Enable Anti-spam for", "options"));
	m_b1 = addBoolSelector(g, __tr2qs_ctx("Private messages", "options"), KviOption_boolUseAntiSpamOnPrivmsg);
	connect(m_b1, SIGNAL(toggled(bool)), this, SLOT(reenableStuff(bool)));
	m_b2 = addBoolSelector(g, __tr2qs_ctx("Private notices", "options"), KviOption_boolUseAntiSpamOnNotice);
	connect(m_b2, SIGNAL(toggled(bool)), this, SLOT(reenableStuff(bool)));

	m_b3 = addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Silent anti-spam (no warnings)", "options"), KviOption_boolSilentAntiSpam);
	m_sl = addStringListSelector(0, 2, 0, 2, __tr2qs_ctx("Words considered spam:", "options"), KviOption_stringlistSpamWords);

	reenableStuff(true);

	layout()->setRowStretch(2, 1);
}