本文整理汇总了C++中KVI_OPTION_STRING函数的典型用法代码示例。如果您正苦于以下问题:C++ KVI_OPTION_STRING函数的具体用法?C++ KVI_OPTION_STRING怎么用?C++ KVI_OPTION_STRING使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了KVI_OPTION_STRING函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: KVI_OPTION_STRING
bool KviApplication::findImageThemeOnlyCompat(QString &szRetPath,const QString &filename)
{
// if we have a theme, look it up as first
if(!KVI_OPTION_STRING(KviOption_stringIconThemeSubdir).isEmpty())
{
QString szTmp = KVI_OPTION_STRING(KviOption_stringIconThemeSubdir);
szTmp.append(KVI_PATH_SEPARATOR_CHAR);
szTmp.append(filename);
getLocalKvircDirectory(szRetPath,KviApplication::Themes,szTmp);
if(KviFileUtils::fileExists(szRetPath))return true;
getGlobalKvircDirectory(szRetPath,KviApplication::Themes,szTmp);
if(KviFileUtils::fileExists(szRetPath))return true;
}
getLocalKvircDirectory(szRetPath,KviApplication::Pics,filename);
if(KviFileUtils::fileExists(szRetPath))return true;
if(findImageInImageSearchPath(szRetPath,filename))return true;
szRetPath = filename;
return false;
}
开发者ID:philouvb,项目名称:KVIrc,代码行数:26,代码来源:KviApplication_filesystem.cpp
示例2: KVI_OPTION_STRING
bool KviApplication::findImage(QString & szRetPath, const QString & filename)
{
// Find a user file...
if(KviFileUtils::isAbsolutePath(filename))
{
szRetPath = filename;
return KviFileUtils::fileExists(filename);
}
// if we have a theme, look it up as first
if(!KVI_OPTION_STRING(KviOption_stringIconThemeSubdir).isEmpty())
{
QString szTmp = KVI_OPTION_STRING(KviOption_stringIconThemeSubdir);
szTmp.append(KVI_PATH_SEPARATOR_CHAR);
szTmp.append(filename);
getLocalKvircDirectory(szRetPath, KviApplication::Themes, szTmp);
if(KviFileUtils::fileExists(szRetPath))
return true;
getGlobalKvircDirectory(szRetPath, KviApplication::Themes, szTmp);
if(KviFileUtils::fileExists(szRetPath))
return true;
}
int i;
for(i = 0; i < 2; i++)
{
getLocalKvircDirectory(szRetPath, pics_localsubdirs[i], filename);
if(KviFileUtils::fileExists(szRetPath))
return true;
}
for(i = 0; i < 2; i++)
{
getGlobalKvircDirectory(szRetPath, pics_globalsubdirs[i], filename);
if(KviFileUtils::fileExists(szRetPath))
return true;
}
if(findImageInImageSearchPath(szRetPath, filename))
return true;
// Last resort
szRetPath = QDir::homePath();
KviQString::ensureLastCharIs(szRetPath, KVI_PATH_SEPARATOR_CHAR);
szRetPath.append(filename);
if(KviFileUtils::fileExists(szRetPath))
return true;
szRetPath = filename;
return false;
}
开发者ID:un1versal,项目名称:KVIrc,代码行数:54,代码来源:KviApplication_filesystem.cpp
示例3: KVI_OPTION_STRING
void OptionsWidget_textEncoding::commit()
{
int idx = m_pTextEncodingCombo->currentIndex();
if(idx <= 0)
{
// guess from locale
KVI_OPTION_STRING(KviOption_stringDefaultTextEncoding) = "";
}
else
{
KVI_OPTION_STRING(KviOption_stringDefaultTextEncoding) = m_pTextEncodingCombo->itemText(idx);
}
idx = m_pSrvEncodingCombo->currentIndex();
if(idx <= 0)
{
// guess from locale
KVI_OPTION_STRING(KviOption_stringDefaultSrvEncoding) = "";
}
else
{
KVI_OPTION_STRING(KviOption_stringDefaultSrvEncoding) = m_pSrvEncodingCombo->itemText(idx);
}
idx = m_pForcedLocaleCombo->currentIndex();
QString szLangFile;
g_pApp->getLocalKvircDirectory(szLangFile, KviApplication::None, KVI_FORCE_LOCALE_FILE_NAME);
if(idx == 0)
{
if(KviFileUtils::fileExists(szLangFile))
KviFileUtils::removeFile(szLangFile);
}
else
{
g_szPrevSetLocale = m_pForcedLocaleCombo->itemText(idx);
if(!KviFileUtils::writeFile(szLangFile, m_pForcedLocaleCombo->itemText(idx)))
{
QMessageBox::critical(this, "Writing to File Failed - KVIrc", __tr2qs_ctx("Unable to write language information to", "options") + "\n" + szLangFile, __tr2qs_ctx("OK", "options"));
}
}
#ifdef COMPILE_ENCHANT_SUPPORT
QStringList wantedDictionaries;
for(int i = 0; i < m_pSpellCheckerDictionaries->rowCount(); ++i)
{
if(m_pSpellCheckerDictionaries->item(i, 0)->checkState() == Qt::Checked)
{
wantedDictionaries << m_pSpellCheckerDictionaries->item(i, 0)->text();
}
}
KVI_OPTION_STRINGLIST(KviOption_stringlistSpellCheckerDictionaries) = wantedDictionaries;
KviKvsScript::run("spellchecker.reloadDictionaries", nullptr);
#endif
}
开发者ID:Dessa,项目名称:KVIrc,代码行数:54,代码来源:OptionsWidget_textEncoding.cpp
示例4: setup_finish
// this is called just after the first startup
// all the subsystems are up and running (we even have a nice console
// to write on if needed).
// all the options are loaded.
KVIMODULEEXPORTFUNC void setup_finish()
{
if(bNeedToApplyDefaults)
{
KVI_OPTION_STRING(KviOption_stringIncomingPath) = g_szChoosenIncomingDirectory;
// Reset the quit message and the real name... if they contain the KVIrc version
// then probably the user hasn't even edited them.
if(KVI_OPTION_STRING(KviOption_stringQuitMessage).indexOf("KVIrc",0,Qt::CaseInsensitive) != -1)
KVI_OPTION_STRING(KviOption_stringQuitMessage) = KVI_DEFAULT_QUIT_MESSAGE;
// We deserve to change the user's part message in something nice :)
KVI_OPTION_STRING(KviOption_stringPartMessage) = KVI_DEFAULT_PART_MESSAGE;
// FIXME: Should we also change these ?
// #define KVI_DEFAULT_CTCP_USERINFO_REPLY "I'm too lazy to edit this field."
// #define KVI_DEFAULT_AWAY_MESSAGE "I'm off to see the wizard."
// Apply the chosen default theme
KviThemeInfo out;
switch(g_iThemeToApply)
{
case THEME_APPLY_HIRES:
KviTheme::load("Aria-1.0.0",out,BUILTIN);
break;
case THEME_APPLY_LORES:
KviTheme::load("MinimalDark-1.0.0",out,BUILTIN);
break;
// default: no theme
}
if(!szMircServers.isEmpty())
{
g_pServerDataBase->importFromMircIni(szMircServers,szMircIni,
KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers));
g_pApp->saveIrcServerDataBase();
}
g_pApp->loadDefaultScript();
if(!szUrl.isEmpty())
{
KviKvsVariantList * pParams = new KviKvsVariantList();
pParams->append(szUrl);
KviKvsScript::run("openurl $0",g_pActiveWindow,pParams);
delete pParams;
KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = TRUE;
} else if(!szHost.isEmpty()) {
KviKvsVariantList * pParams = new KviKvsVariantList();
pParams->append(szHost);
pParams->append((kvs_int_t)uPort);
KviKvsScript::run("server $0 $1",g_pActiveWindow,pParams);
delete pParams;
KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = TRUE;
}
}
}
开发者ID:netrunner-debian-kde-extras,项目名称:kvirc,代码行数:58,代码来源:libkvisetup.cpp
示例5: mediaplayer_get_codec
static QTextCodec * mediaplayer_get_codec()
{
QTextCodec * pCodec = 0;
#if (QT_VERSION < 0x050000)
pCodec = QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toLatin1());
#else
pCodec = QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toUtf8());
#endif
if(!pCodec)
pCodec = QTextCodec::codecForLocale();
return pCodec;
}
开发者ID:philouvb,项目名称:KVIrc,代码行数:14,代码来源:MpAmipInterface.cpp
示例6: KviOptionsWidget
OptionsWidget_identityAvatar::OptionsWidget_identityAvatar(QWidget * parent)
: KviOptionsWidget(parent)
{
createLayout();
layout()->setMargin(10);
m_pLocalAvatar = new KviPixmap(KVI_OPTION_PIXMAP(KviOption_pixmapMyAvatar));
bool bHaveAvatar = (!KVI_OPTION_STRING(KviOption_stringMyAvatar).isEmpty()) && m_pLocalAvatar->pixmap();
QString szTip = __tr2qs_ctx("Here you can choose your avatar image. It will be visible<br>" \
"by other people that request it. Choose a nice image of yourself,<br>" \
"possibly avoiding obscenity and offending images. It is a good idea<br>" \
"to choose a relatively small file (say 150 Kb max) because<br>" \
"most clients have a limit on the size of avatars being downloaded.<br>" \
"The image also should be smaller than 800x600 pixels since<br>" \
"it will have to be viewable in everyone's monitor.","options");
m_pUseAvatarCheck = new QCheckBox(__tr2qs_ctx("Use avatar","options"),this);
addWidgetToLayout(m_pUseAvatarCheck,0,0,0,0);
m_pUseAvatarCheck->setChecked(bHaveAvatar);
mergeTip(m_pUseAvatarCheck,szTip);
m_pAvatarPreview = new KviPixmapPreview(this);
addWidgetToLayout(m_pAvatarPreview,0,1,0,1);
m_pAvatarPreview->setPixmap(m_pLocalAvatar);
m_pAvatarPreview->setEnabled(bHaveAvatar);
connect(m_pUseAvatarCheck,SIGNAL(toggled(bool)),m_pAvatarPreview,SLOT(setEnabled(bool)));
mergeTip(m_pAvatarPreview,szTip);
KviTalHBox * hb = new KviTalHBox(this);
hb->setSpacing(4);
addWidgetToLayout(hb,0,2,0,2);
m_pAvatarNameEdit = new QLineEdit(hb);
m_pAvatarNameEdit->setReadOnly(true);
m_pAvatarNameEdit->setEnabled(bHaveAvatar);
m_pAvatarNameEdit->setText(KVI_OPTION_STRING(KviOption_stringMyAvatar));
connect(m_pUseAvatarCheck,SIGNAL(toggled(bool)),m_pAvatarNameEdit,SLOT(setEnabled(bool)));
m_pChooseAvatarButton = new QPushButton(__tr2qs_ctx("Choose...","options"),hb);
m_pChooseAvatarButton->setEnabled(bHaveAvatar);
connect(m_pUseAvatarCheck,SIGNAL(toggled(bool)),m_pChooseAvatarButton,SLOT(setEnabled(bool)));
connect(m_pChooseAvatarButton,SIGNAL(clicked()),this,SLOT(chooseAvatar()));
layout()->setRowStretch(1,2);
}
开发者ID:wodim,项目名称:KVIrc,代码行数:48,代码来源:OptionsWidget_identity.cpp
示例7: KVI_OPTION_STRING
void OptionsWidget_highlighting::commit()
{
KVI_OPTION_STRING(KviOption_stringWordSplitters) = m_pWordSplitterCharactersEdit->text().trimmed();
KVI_OPTION_BOOL(KviOption_boolUseFullWordHighlighting) = m_pHighlightAllOccurencesRadioButton->isChecked();
KviOptionsWidget::commit();
}
开发者ID:namikaze90,项目名称:KVIrc-old,代码行数:7,代码来源:OptionsWidget_alertsAndHighlighting.cpp
示例8: mediaFillBox
void OptionsWidget_soundGeneral::mediaFillBox()
{
QStringList l;
QStringList::Iterator it;
int cnt;
int i;
KviModule * m = g_pModuleManager->getModule("mediaplayer");
if(!m)goto disable;
if(!m->ctrl("getAvailableMediaPlayers",&l))goto disable;
m_pMediaPlayerBox->clear();
for ( it = l.begin(); it != l.end(); ++it )
{
m_pMediaPlayerBox->addItem(*it);
}
cnt = m_pMediaPlayerBox->count();
for(i=0;i<cnt;i++)
{
QString t = m_pMediaPlayerBox->itemText(i);
if(KviQString::equalCI(t,KVI_OPTION_STRING(KviOption_stringPreferredMediaPlayer)))
{
m_pMediaPlayerBox->setCurrentIndex(i);
break;
}
}
return;
disable:
m_pMediaPlayerBox->clear();
m_pMediaPlayerBox->setEnabled(false);
m_pMediaTestButton->setEnabled(false);
m_pMediaAutoDetectButton->setEnabled(false);
}
开发者ID:namikaze90,项目名称:KVIrc-old,代码行数:34,代码来源:OptionsWidget_sound.cpp
示例9: getMixerVolume
int DccVoiceWindow::getMixerVolume(void) const
{
#ifndef COMPILE_DISABLE_DCC_VOICE
int fd;
int ret;
int left; //, right;
int req;
if((fd = ::open(KVI_OPTION_STRING(KviOption_stringDccVoiceMixerDevice).toUtf8().data(), O_RDONLY)) == -1)
{
return 0;
}
req = KVI_OPTION_BOOL(KviOption_boolDccVoiceVolumeSliderControlsPCM) ? SOUND_MIXER_READ_PCM : SOUND_MIXER_READ_VOLUME;
if(::ioctl(fd,req,&ret))
{
::close(fd);
return 0;
}
left = (ret & 0x00ff);
// right = (ret & 0xff00) >> 8;
::close(fd);
return -left;
#else
return 0;
#endif
}
开发者ID:xeddmc,项目名称:KVIrc,代码行数:31,代码来源:DccVoiceWindow.cpp
示例10: KVI_OPTION_STRING
void OptionsWidget_identityAvatar::commit(void)
{
KviOptionsWidget::commit();
QString szAvatarName = m_pAvatarNameEdit->text();
if(m_pUseAvatarCheck->isChecked() && m_pLocalAvatar->pixmap() && (!szAvatarName.isEmpty()))
{
KVI_OPTION_STRING(KviOption_stringMyAvatar) = szAvatarName;
KVI_OPTION_PIXMAP(KviOption_pixmapMyAvatar) = *m_pLocalAvatar;
} else {
KVI_OPTION_STRING(KviOption_stringMyAvatar) = "";
KVI_OPTION_PIXMAP(KviOption_pixmapMyAvatar) = KviPixmap();
}
g_pApp->setAvatarFromOptions();
}
开发者ID:wodim,项目名称:KVIrc,代码行数:16,代码来源:OptionsWidget_identity.cpp
示例11: mediaplayer_get_codec
static QTextCodec * mediaplayer_get_codec()
{
QTextCodec * c= QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toUtf8().data());
if(!c)c = QTextCodec::codecForLocale();
return c;
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:7,代码来源:MpInterface.cpp
示例12: addStringSelector
KviStringSelector * KviOptionsWidget::addStringSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled)
{
m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask);
KviStringSelector * d = addStringSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_STRING(optId)),bEnabled);
QString tmp = m_szBasicTipStart;
tmp += g_stringOptionsTable[optId].name;
tmp += m_szBasicTipEnd;
KviTalToolTip::add(d,tmp);
return d;
}
开发者ID:kartagis,项目名称:KVIrc,代码行数:10,代码来源:KviOptionsWidget.cpp
示例13: addPasswordSelector
KviPasswordSelector * KviOptionsWidget::addPasswordSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled)
{
m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask);
KviPasswordSelector * d = addPasswordSelector(pParent,txt,&(KVI_OPTION_STRING(optId)),bEnabled);
QString tmp = m_szBasicTipStart;
tmp += g_stringOptionsTable[optId].name;
tmp += m_szBasicTipEnd;
KviTalToolTip::add(d,tmp);
return d;
}
开发者ID:kartagis,项目名称:KVIrc,代码行数:10,代码来源:KviOptionsWidget.cpp
示例14: KVI_OPTION_STRING
void KviWindow::getDefaultLogFileName(QString & szBuffer, QDate date, bool bGzip, unsigned int uDatetimeFormat)
{
QString szLog;
// dynamic log path
QString szDynamicPath = KVI_OPTION_STRING(KviOption_stringLogsDynamicPath).trimmed();
if(!szDynamicPath.isEmpty())
{
KviQString::escapeKvs(&szDynamicPath, KviQString::PermitVariables | KviQString::PermitFunctions);
KviKvsVariant vRet;
if(KviKvsScript::evaluate(szDynamicPath, this, nullptr, &vRet))
vRet.asString(szDynamicPath);
}
g_pApp->getLocalKvircDirectory(szLog, KviApplication::Log, szDynamicPath);
KviQString::ensureLastCharIs(szLog, KVI_PATH_SEPARATOR_CHAR);
//ensure the directory exists
KviFileUtils::makeDir(szLog);
QString szDate;
switch(uDatetimeFormat)
{
case 1:
szDate = date.toString(Qt::ISODate);
break;
case 2:
szDate = date.toString(Qt::SystemLocaleShortDate);
break;
case 0:
default:
szDate = date.toString("yyyy.MM.dd");
break;
}
szDate.replace('_', '-'); // this would confuse the log viewer
KviFileUtils::cleanFileName(szDate);
QString szBase;
getBaseLogFileName(szBase);
KviFileUtils::encodeFileName(szBase);
szBase = szBase.toLower();
szBase.replace("%%2e", "%2e");
QString szTmp;
if(bGzip)
szTmp = "%1_%2_%3.log.gz";
else
szTmp = "%1_%2_%3.log";
szLog.append(QString(szTmp).arg(typeString(), szBase, szDate));
szBuffer = szLog;
}
开发者ID:Cizzle,项目名称:KVIrc,代码行数:55,代码来源:KviWindow.cpp
示例15: KviOptionsWidget
OptionsWidget_connectionSsl::OptionsWidget_connectionSsl(QWidget * parent)
: KviOptionsWidget(parent)
{
setObjectName("ssl_options_widget");
createLayout();
#ifdef COMPILE_SSL_SUPPORT
KviBoolSelector * b;
KviFileSelector * f;
KviPasswordSelector * p;
KviTalGroupBox * gbox = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Certificate", "options"));
b = addBoolSelector(gbox, __tr2qs_ctx("Use SSL certificate (PEM format only)", "options"),
&(KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate)), true);
f = addFileSelector(gbox, __tr2qs_ctx("Certificate location:", "options"), &(KVI_OPTION_STRING(KviOption_stringSSLCertificatePath)),
KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate));
connect(b, SIGNAL(toggled(bool)), f, SLOT(setEnabled(bool)));
p = new KviPasswordSelector(gbox, __tr2qs_ctx("Certificate password:", "options"), &(KVI_OPTION_STRING(KviOption_stringSSLCertificatePass)),
KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate));
connect(b, SIGNAL(toggled(bool)), p, SLOT(setEnabled(bool)));
gbox = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Private Key", "options"));
b = addBoolSelector(gbox, __tr2qs_ctx("Use SSL private key", "options"), &(KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey)), true);
f = addFileSelector(gbox, __tr2qs_ctx("Private key location:", "options"), &(KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath)),
KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey));
connect(b, SIGNAL(toggled(bool)), f, SLOT(setEnabled(bool)));
p = addPasswordSelector(gbox, __tr2qs_ctx("Private key password:", "options"), &(KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPass)),
KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey));
connect(b, SIGNAL(toggled(bool)), p, SLOT(setEnabled(bool)));
addRowSpacer(0, 3, 0, 3);
#else
addLabel(0, 0, 0, 0, __tr2qs_ctx("This executable has no SSL support.", "options"));
#endif
}
开发者ID:IceN9ne,项目名称:KVIrc,代码行数:41,代码来源:OptionsWidget_connection.cpp
示例16: KVI_OPTION_STRING
void OptionsWidget_soundGeneral::commit()
{
// avoid to commit if we've never been shown (and initialized)
if(m_bFirstShow)
return;
KviOptionsWidget::commit();
KVI_OPTION_STRING(KviOption_stringSoundSystem) = m_pSoundSystemBox->currentText();
KVI_OPTION_STRING(KviOption_stringPreferredMediaPlayer) = m_pMediaPlayerBox->currentText();
int idx = m_pTagsEncodingCombo->currentIndex();
if(idx <= 0)
{
// guess from locale
KVI_OPTION_STRING(KviOption_stringMp3TagsEncoding) = "";
} else {
KVI_OPTION_STRING(KviOption_stringMp3TagsEncoding) = m_pTagsEncodingCombo->itemText(idx);
}
#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
idx = m_pWinampEncodingCombo->currentIndex();
if(idx <= 0)
{
// guess from locale
KVI_OPTION_STRING(KviOption_stringWinampTextEncoding) = "";
} else {
KVI_OPTION_STRING(KviOption_stringWinampTextEncoding) = m_pWinampEncodingCombo->itemText(idx);
}
#endif
}
开发者ID:namikaze90,项目名称:KVIrc-old,代码行数:31,代码来源:OptionsWidget_sound.cpp
示例17: KviOptionsWidget
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);
}
开发者ID:namikaze90,项目名称:KVIrc-old,代码行数:52,代码来源:OptionsWidget_alertsAndHighlighting.cpp
示例18: KviOptionsWidget
OptionsWidget_connectionSsl::OptionsWidget_connectionSsl(QWidget * parent)
: KviOptionsWidget(parent)
{
setObjectName("ssl_options_widget");
createLayout();
#ifdef COMPILE_SSL_SUPPORT
KviTalGroupBox * gbox = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Certificate","options"));
KviBoolSelector * b = addBoolSelector(gbox,__tr2qs_ctx("Use SSL certificate (PEM format only)","options"),
&(KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate)),true);
KviFileSelector * f = addFileSelector(gbox,__tr2qs_ctx("Certificate location:","options"),
&(KVI_OPTION_STRING(KviOption_stringSSLCertificatePath)),KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate));
connect(b,SIGNAL(toggled(bool)),f,SLOT(setEnabled(bool)));
KviPasswordSelector * p = new KviPasswordSelector(gbox,__tr2qs_ctx("Certificate password:","options"),
&(KVI_OPTION_STRING(KviOption_stringSSLCertificatePass)),KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate));
connect(b,SIGNAL(toggled(bool)),p,SLOT(setEnabled(bool)));
gbox = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Private Key","options"));
b = addBoolSelector(gbox,__tr2qs_ctx("Use SSL private key","options"),
&(KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey)),true);
f = addFileSelector(gbox,__tr2qs_ctx("Private key location:","options"),
&(KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath)),KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey));
connect(b,SIGNAL(toggled(bool)),f,SLOT(setEnabled(bool)));
p = addPasswordSelector(gbox,__tr2qs_ctx("Private key password:","options"),
&(KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPass)),KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey));
connect(b,SIGNAL(toggled(bool)),p,SLOT(setEnabled(bool)));
// This is now handled per-server.
//b = addBoolSelector(this,__tr2qs_ctx("Use the STARTTLS security protocol if available","options"),&(KVI_OPTION_BOOL(KviOption_boolUseStartTlsIfAvailable)),true);
//mergeTip(b,__tr2qs_ctx("This option will cause KVIrc to try to reconnect to the server using an encrypted connection","options"));
//addWidgetToLayout(b,0,2,0,2);
addRowSpacer(0,3,0,3);
#else
addLabel(0,0,0,0,__tr2qs_ctx("This executable has no SSL support.","options"));
#endif
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:38,代码来源:OptionsWidget_connection.cpp
示例19: setMixerVolume
void DccVoiceWindow::setMixerVolume(int vol)
{
#ifndef COMPILE_DISABLE_DCC_VOICE
int fd;
int val;
int req;
if((fd = ::open(KVI_OPTION_STRING(KviOption_stringDccVoiceMixerDevice).toUtf8().data(), O_WRONLY)) == -1)
return;
req = KVI_OPTION_BOOL(KviOption_boolDccVoiceVolumeSliderControlsPCM) ? SOUND_MIXER_WRITE_PCM : SOUND_MIXER_WRITE_VOLUME;
val = (-vol << 8) | -vol;
::ioctl(fd, req, &val);
::close(fd);
m_pVolumeSlider->setToolTip(__tr2qs_ctx("Volume: %1","dcc").arg(-vol));
#endif
}
开发者ID:xeddmc,项目名称:KVIrc,代码行数:19,代码来源:DccVoiceWindow.cpp
示例20: output
void DccVoiceWindow::connected()
{
output(KVI_OUT_DCCMSG,__tr2qs_ctx("Connected to %Q:%Q","dcc"),
&(m_pMarshal->remoteIp()),&(m_pMarshal->remotePort()));
output(KVI_OUT_DCCMSG,__tr2qs_ctx("Local end is %Q:%Q","dcc"),
&(m_pMarshal->localIp()),&(m_pMarshal->localPort()));
if(!(m_pDescriptor->bActive))
{
m_pDescriptor->szIp = m_pMarshal->remoteIp();
m_pDescriptor->szPort = m_pMarshal->remotePort();
m_pDescriptor->szHost = m_pMarshal->remoteIp();
}
updateCaption();
connect(m_pUpdateTimer,SIGNAL(timeout()),this,SLOT(updateInfo()));
m_pUpdateTimer->start(1000);
KviDccVoiceThreadOptions * opt = new KviDccVoiceThreadOptions;
opt->pCodec = kvi_dcc_voice_get_codec(m_pDescriptor->szCodec.ptr());
output(KVI_OUT_DCCMSG,__tr2qs_ctx("Actual codec used is '%s'","dcc"),opt->pCodec->name());
opt->bForceHalfDuplex = KVI_OPTION_BOOL(KviOption_boolDccVoiceForceHalfDuplex);
// opt->bForceDummyReadTrigger = false;
opt->iPreBufferSize = KVI_OPTION_UINT(KviOption_uintDccVoicePreBufferSize);
opt->szSoundDevice = KVI_OPTION_STRING(KviOption_stringDccVoiceSoundDevice).toUtf8().data();
opt->iSampleRate = m_pDescriptor->iSampleRate;
m_pSlaveThread = new DccVoiceThread(this,m_pMarshal->releaseSocket(),opt);
connect(m_pUpdateTimer,SIGNAL(timeout()),this,SLOT(updateInfo()));
m_pSlaveThread->start();
m_pTalkButton->setEnabled(true);
}
开发者ID:xeddmc,项目名称:KVIrc,代码行数:36,代码来源:DccVoiceWindow.cpp
注:本文中的KVI_OPTION_STRING函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论