本文整理汇总了C++中KVI_OPTION_BOOL函数的典型用法代码示例。如果您正苦于以下问题:C++ KVI_OPTION_BOOL函数的具体用法?C++ KVI_OPTION_BOOL怎么用?C++ KVI_OPTION_BOOL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了KVI_OPTION_BOOL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void KviInput::keyPressEvent(QKeyEvent * e)
{
if(e->modifiers() & Qt::ControlModifier)
{
switch(e->key())
{
case Qt::Key_Enter:
case Qt::Key_Return:
{
if(m_pMultiLineEditor)
{
QString szText;
m_pMultiLineEditor->getText(szText);
if(szText.isEmpty())return;
if(KVI_OPTION_BOOL(KviOption_boolWarnAboutPastingMultipleLines))
{
if(szText.length() > 256)
{
if(szText[0] != '/')
{
int nLines = szText.count('\n') + 1;
if(nLines > 15)
{
int nRet = QMessageBox::question(
this,
__tr2qs("Confirm Multi-line Message"),
__tr2qs("You're about to send a message with %1 lines of text.<br><br>" \
"There is nothing wrong with it, this warning is<br>" \
"here to prevent you from accidentally sending<br>" \
"a really large message just because you didn't edit it<br>" \
"properly after pasting text from the clipboard.<br><br>" \
"Do you want the message to be sent?").arg(nLines),
__tr2qs("Yes, always"),
__tr2qs("Yes"),
__tr2qs("No"),
1,2);
switch(nRet)
{
case 0:
KVI_OPTION_BOOL(KviOption_boolWarnAboutPastingMultipleLines) = false;
break;
case 2:
return;
break;
default: // also case 1
break;
}
}
}
}
}
szText.replace('\t',QString(KVI_OPTION_UINT(KviOption_uintSpacesToExpandTabulationInput),' ')); //expand tabs to spaces
KviUserInput::parse(szText,m_pWindow,QString(),m_pCommandlineModeButton->isChecked());
m_pMultiLineEditor->setText("");
}
}
break;
}
}
}
示例2: KviOptionsWidget
OptionsWidget_connection::OptionsWidget_connection(QWidget * parent)
: KviOptionsWidget(parent)
{
setObjectName("connection_options_widget");
createLayout();
KviTalGroupBox *gbox = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("On Disconnect","options"));
KviBoolSelector *b1 = addBoolSelector(gbox,__tr2qs_ctx("Keep channels open","options"),KviOption_boolKeepChannelsOpenOnDisconnect,true);
mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to keep channels open after disconnect.","options"));
b1 = addBoolSelector(gbox,__tr2qs_ctx("Keep queries open","options"),KviOption_boolKeepQueriesOpenOnDisconnect,true);
mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to keep queries open after disconnect.","options"));
gbox = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("On Unexpected Disconnect","options"));
b1 = addBoolSelector(gbox,__tr2qs_ctx("Keep channels open","options"),KviOption_boolKeepChannelsOpenOnUnexpectedDisconnect,true);
mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to keep channels open after an unexpected disconnect.","options"));
b1 = addBoolSelector(gbox,__tr2qs_ctx("Keep queries open","options"),KviOption_boolKeepQueriesOpenOnUnexpectedDisconnect,true);
mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to keep queries open after an unexpected disconnect.","options"));
b1 = addBoolSelector(gbox,__tr2qs_ctx("Rejoin channels after reconnect","options"),KviOption_boolRejoinChannelsAfterReconnect,true);
mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to rejoin channels after a successful reconnect attempt.","options"));
b1 = addBoolSelector(gbox,__tr2qs_ctx("Reopen queries after reconnect","options"),KviOption_boolReopenQueriesAfterReconnect,true);
mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to reopen query windows after a successful reconnect attempt.","options"));
// gbox = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("On Unexpected Disconnect","options"));
KviBoolSelector * b = addBoolSelector(gbox,__tr2qs_ctx("Automatically reconnect","options"),KviOption_boolAutoReconnectOnUnexpectedDisconnect);
mergeTip(b,__tr2qs_ctx("This option will enable auto-reconnecting after an unexpected disconnect. " \
"An unexpected disconnect is the <b>termination</b> of a <b>fully connected IRC session</b> " \
"that was <b>not requested by the user</b> by the means of the QUIT message." \
"<p><b>Warning:</b> If you use /RAW to send a QUIT message to the server, " \
"this option will not behave correctly, since does not detect the outgoing " \
"QUIT message and will attempt to reconnect after the server has closed the connection. " \
"For this reason, always use the /QUIT command to close your connections. " \
"This option may also behave incorrectly with bouncers that support " \
"detaching, in this case a solution could be to prepare an alias that sends the " \
"bouncer \"detach\" command immediately before the \"quit\" command.<br>" \
"<tt>alias(bncdetach){ raw bouncer detach; quit; }</tt></p>","options"));
KviUIntSelector * u = addUIntSelector(gbox,__tr2qs_ctx("Maximum attempts (0: unlimited):","options"),
KviOption_uintMaxAutoReconnectAttempts,0,100,5,
KVI_OPTION_BOOL(KviOption_boolAutoReconnectOnUnexpectedDisconnect));
connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool)));
u = addUIntSelector(gbox,__tr2qs_ctx("Delay between attempts:","options"),
KviOption_uintAutoReconnectDelay,0,86400,5,
KVI_OPTION_BOOL(KviOption_boolAutoReconnectOnUnexpectedDisconnect));
u->setSuffix(__tr2qs_ctx(" sec","options"));
connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool)));
mergeTip(u,__tr2qs_ctx("Minimum value: <b>0 sec</b><br>Maximum value: <b>86400 sec</b>","options"));
// This is now handled per-server.
//b = addBoolSelector(this,__tr2qs_ctx("Use the SASL authentication protocol if available","options"),&(KVI_OPTION_BOOL(KviOption_boolUseSaslIfAvailable)),true);
//mergeTip(b,__tr2qs_ctx("When available and enabled of the specific server, KVIrc will try to authenticate the user using the SASL procotol","options"));
//addWidgetToLayout(b,0,2,0,2);
addRowSpacer(0,3,4,3);
}
示例3: setTextEncoding
void KviWindow::loadProperties(KviConfigurationFile * pCfg)
{
QString szCodec = pCfg->readEntry("TextEncoding", KviQString::Empty);
if(szCodec.isEmpty())
{
// try to load kvirc 4.0's entry
QString szKey = "TextEncoding_";
szKey += m_szName;
szCodec = pCfg->readEntry(szKey, KviQString::Empty);
}
setTextEncoding(szCodec.toUtf8().data());
if(m_pInput)
{
m_pInput->setButtonsHidden(pCfg->readBoolEntry("inputToolButtonsHidden", KVI_OPTION_BOOL(KviOption_boolHideInputToolButtons)));
m_pInput->setUserFriendly(pCfg->readBoolEntry("commandLineIsUserFriendly", KVI_OPTION_BOOL(KviOption_boolCommandlineInUserFriendlyModeByDefault)));
}
/*
if(m_pIrcView && m_eType == KviWindow::Channel)
{
bool bEnableLogs = pCfg->readBoolEntry("LoggingEnabled",0);
if(!m_pIrcView->isLogging() && bEnableLogs)
{
QString szTmp;
getBaseLogFileName(szTmp);
m_pIrcView->startLogging();
}
}
*/
}
示例4: KviOptionsWidget
OptionsWidget_userListGrid::OptionsWidget_userListGrid(QWidget * parent)
: KviOptionsWidget(parent)
{
createLayout();
KviBoolSelector * b = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Draw nickname grid", "options"), KviOption_boolUserListViewDrawGrid);
KviColorSelector * s = addColorSelector(0, 1, 0, 1, __tr2qs_ctx("Grid color:", "options"), KviOption_colorUserListViewGrid, KVI_OPTION_BOOL(KviOption_boolUserListViewDrawGrid));
connect(b, SIGNAL(toggled(bool)), s, SLOT(setEnabled(bool)));
KviTalHBox * hb = new KviTalHBox(this);
addWidgetToLayout(hb, 0, 2, 0, 2);
hb->setSpacing(4);
QLabel * l = new QLabel(__tr2qs_ctx("Grid type:", "options"), hb);
l->setEnabled(KVI_OPTION_BOOL(KviOption_boolUserListViewDrawGrid));
connect(b, SIGNAL(toggled(bool)), l, SLOT(setEnabled(bool)));
m_pGridTypeCombo = new QComboBox(hb);
m_pGridTypeCombo->addItem(__tr2qs_ctx("3D Grid", "options"));
m_pGridTypeCombo->addItem(__tr2qs_ctx("3D Buttons", "options"));
m_pGridTypeCombo->addItem(__tr2qs_ctx("Plain Grid", "options"));
m_pGridTypeCombo->addItem(__tr2qs_ctx("Dotted Grid", "options"));
m_pGridTypeCombo->setCurrentIndex(KVI_OPTION_UINT(KviOption_uintUserListViewGridType));
m_pGridTypeCombo->setEnabled(KVI_OPTION_BOOL(KviOption_boolUserListViewDrawGrid));
connect(b, SIGNAL(toggled(bool)), m_pGridTypeCombo, SLOT(setEnabled(bool)));
addRowSpacer(0, 3, 0, 3);
}
示例5: switch
void KviInput::keyPressEvent(QKeyEvent * e)
{
if(e->modifiers() & Qt::ControlModifier)
{
switch(e->key())
{
case Qt::Key_Enter:
case Qt::Key_Return:
{
if(m_pMultiLineEditor)
{
QString szText;
m_pMultiLineEditor->getText(szText);
if(szText.isEmpty())
return;
if(KVI_OPTION_BOOL(KviOption_boolWarnAboutPastingMultipleLines))
{
if(szText.length() > 256)
{
if(szText[0] != '/')
{
int nLines = szText.count('\n') + 1;
if(nLines > 15)
{
QMessageBox pMsgBox;
pMsgBox.setText(__tr2qs("You're about to send a message with %1 lines of text.<br><br>"
"This warning is here to prevent you from accidentally "
"pasting and sending a really large, potentially unedited message from your clipboard.<br><br>"
"Some IRC servers may also consider %1 lines of text a flood, "
"in which case you will be disconnected from said server.<br><br>"
"Do you still want the message to be sent?").arg(nLines));
pMsgBox.setWindowTitle(__tr2qs("Confirm Sending a Large Message - KVIrc"));
pMsgBox.setIcon(QMessageBox::Question);
QAbstractButton * pAlwaysButton = pMsgBox.addButton(__tr2qs("Always"), QMessageBox::YesRole);
/* QAbstractButton *pYesButton = */ pMsgBox.addButton(__tr2qs("Yes"), QMessageBox::YesRole);
QAbstractButton * pNoButton = pMsgBox.addButton(__tr2qs("No"), QMessageBox::NoRole);
pMsgBox.setDefaultButton(qobject_cast<QPushButton *>(pNoButton));
pMsgBox.exec();
if(pMsgBox.clickedButton() == pAlwaysButton)
{
KVI_OPTION_BOOL(KviOption_boolWarnAboutPastingMultipleLines) = false;
}
else if(pMsgBox.clickedButton() == pNoButton || pMsgBox.clickedButton() == nullptr)
{
return;
}
}
}
}
}
szText.replace('\t', QString(KVI_OPTION_UINT(KviOption_uintSpacesToExpandTabulationInput), ' ')); //expand tabs to spaces
KviUserInput::parse(szText, m_pWindow, QString(), m_pCommandlineModeButton->isChecked());
m_pMultiLineEditor->setText("");
}
}
break;
}
}
}
示例6: KVI_OPTION_BOOL
KviMainWindow::~KviMainWindow()
{
KVI_OPTION_BOOL(KviOption_boolFrameIsMaximized) = isMaximized();
KVI_OPTION_RECT(KviOption_rectFrameGeometry) = QRect(pos().x(), pos().y(),
size().width(), size().height());
KVI_OPTION_BOOL(KviOption_boolStatusBarVisible) = m_pStatusBar ? true : false;
KviCustomToolBarManager::instance()->storeVisibilityState();
saveToolBarPositions();
saveModuleExtensionToolBars();
// Call the frame destructor callback AFTER saving the toolbar positions
// This is because the destructor callback kills alls the KVS objects
// and thus the eventual user toolbar objects too and their position
// wouldn't be saved if they are shown at startup.
g_pApp->frameDestructorCallback();
// Now start killing stuff
// Explicitly kill all the module extension toolbars: qt has NOT to delete them: we must call their "die" method
while(KviMexToolBar * t = m_pModuleExtensionToolBarList->first())
t->die();
delete m_pModuleExtensionToolBarList;
KVI_OPTION_BOOL(KviOption_boolShowDockExtension) = m_pTrayIcon != nullptr;
if(m_pTrayIcon)
{
m_pTrayIcon->die();
m_pTrayIcon = nullptr;
}
if(m_pStatusBar)
{
delete m_pStatusBar;
m_pStatusBar = nullptr;
}
//close all not console windows
for(int i = m_pWinList->count() - 1; i >= 0; --i)
{
KviWindow * wnd = m_pWinList->at(i);
if(wnd->type() != KviWindow::Console)
closeWindow(wnd);
}
// close all the remaining windows (consoles)
while(m_pWinList->first())
closeWindow(m_pWinList->first());
delete m_pWinList;
delete m_pAccellerators;
g_pMainWindow = nullptr;
}
示例7: outputProxy
void KviWindow::internalOutput(KviIrcView * pView, int iMsgType, const kvi_wchar_t * pwText, int iFlags)
{
// all roads lead to Rome :)
if(pView)
{
if(!hasAttention())
{
iFlags |= KviIrcView::TriggersNotification;
if(!pView->hasLineMark())
{
iFlags |= KviIrcView::SetLineMark;
}
}
pView->appendText(iMsgType,pwText,iFlags);
} else {
// Redirect to the output proxy
KviWindow * pWnd = outputProxy();
if(pWnd)
pWnd->outputNoFmt(iMsgType,pwText,iFlags);
}
if(!m_pWindowListItem)
return;
// if this option is checked we don't highlight other than channel msg
if(KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsg))
{
if((iMsgType != KVI_OUT_CHANPRIVMSG) && (iMsgType != KVI_OUT_CHANPRIVMSGCRYPTED))
{
if(!(
(
KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsgQueryToo) &&
(
(iMsgType == KVI_OUT_QUERYPRIVMSG) || (iMsgType == KVI_OUT_QUERYTRACE) ||
(iMsgType == KVI_OUT_QUERYPRIVMSGCRYPTED) || (iMsgType == KVI_OUT_QUERYNOTICE) || (iMsgType == KVI_OUT_QUERYNOTICECRYPTED)
)
)
||
(
KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsgHighlightInChanToo) && (iMsgType == KVI_OUT_HIGHLIGHT)
)
)
)
return;
}
}
if(KVI_OPTION_BOOL(KviOption_boolHighlightOnlyAtCostumHighlightLevel) &&
(KVI_OPTION_MSGTYPE(iMsgType).level() < ((int)(KVI_OPTION_UINT(KviOption_uintMinHighlightLevel)))))
{
return;
}
m_pWindowListItem->highlight(KVI_OPTION_MSGTYPE(iMsgType).level());
}
示例8: KVI_OPTION_BOOL
void KviMdiManager::toggleAutoTile()
{
if(KVI_OPTION_BOOL(KviOption_boolAutoTileWindows))
{
KVI_OPTION_BOOL(KviOption_boolAutoTileWindows) = false;
} else {
KVI_OPTION_BOOL(KviOption_boolAutoTileWindows) = true;
tile();
}
}
示例9: 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;
}
}
}
示例10: KviOptionsWidget
OptionsWidget_themeTransparency::OptionsWidget_themeTransparency(QWidget * parent)
: KviOptionsWidget(parent)
{
#ifdef COMPILE_PSEUDO_TRANSPARENCY
createLayout();
KviUIntSelector * u = addUIntSelector(0,0,1,0,__tr2qs_ctx("Global window opacity percent:","options"),KviOption_uintGlobalWindowOpacityPercent,
50,100,100, true);
m_pUseTransparencyBoolSelector = addBoolSelector(0,1,1,1,__tr2qs_ctx("Enable transparency","options"),KviOption_boolUseGlobalPseudoTransparency);
#ifdef COMPILE_X11_SUPPORT
mergeTip(m_pUseTransparencyBoolSelector,
__tr2qs_ctx("This option makes all KVIrc windows look " \
"transparent.<br>You must choose a blending " \
"background image below or check the " \
"\"Use compositing for real transparency\" option.","options"));
#elif defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
mergeTip(m_pUseTransparencyBoolSelector,
__tr2qs_ctx("This option makes all KVIrc windows look " \
"transparent.<br>You must choose a blending " \
"background image below or check the " \
"\"Use desktop background for transparency\" option.","options"));
#else
mergeTip(m_pUseTransparencyBoolSelector,
__tr2qs_ctx("This option makes all KVIrc windows look " \
"like transparent.<br>You must choose a blending " \
"background image below.","options"));
#endif
u = addUIntSelector(0,2,1,2,__tr2qs_ctx("Child window opacity:","options"),KviOption_uintGlobalTransparencyChildFadeFactor,
0,100,35,KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency));
connect(m_pUseTransparencyBoolSelector,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool)));
u = addUIntSelector(0,3,1,3,__tr2qs_ctx("Parent window opacity:","options"),KviOption_uintGlobalTransparencyParentFadeFactor,
0,100,10,KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency));
connect(m_pUseTransparencyBoolSelector,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool)));
KviColorSelector * c = addColorSelector(0,4,1,4,__tr2qs_ctx("Blend color:","options"),KviOption_colorGlobalTransparencyFade,
KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency));
connect(m_pUseTransparencyBoolSelector,SIGNAL(toggled(bool)),c,SLOT(setEnabled(bool)));
#ifdef COMPILE_X11_SUPPORT
m_pUseCompositingForTransparencyBoolSelector = addBoolSelector(0,5,1,5,__tr2qs_ctx("Use compositing for real transparency","options"),KviOption_boolUseCompositingForTransparency, KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency));
m_pGlobalBackgroundPixmapSelector = addPixmapSelector(0,6,1,6,__tr2qs_ctx("Transparency blend image:","options"),KviOption_pixmapGlobalTransparencyBackground, KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency) && !KVI_OPTION_BOOL(KviOption_boolUseCompositingForTransparency));
layout()->setRowStretch(6,1);
if(g_pApp->supportsCompositing())
{
connect(m_pUseTransparencyBoolSelector,SIGNAL(toggled(bool)),m_pUseCompositingForTransparencyBoolSelector,SLOT(setEnabled(bool)));
connect(m_pUseCompositingForTransparencyBoolSelector,SIGNAL(toggled(bool)),this,SLOT(enableGlobalBackgroundPixmapSelector(bool)));
} else {
示例11: KviWindow
KviQueryWindow::KviQueryWindow(KviConsoleWindow * lpConsole, const QString & szNick)
: KviWindow(KviWindow::Query, szNick, lpConsole)
{
m_iFlags = 0;
connection()->registerQuery(this);
//m_pTopSplitter = new KviTalSplitter(QSplitter::Horizontal,this,"top_splitter");
m_pButtonBox = new KviTalHBox(this);
m_pButtonBox->setSpacing(0);
m_pButtonBox->setMargin(0);
m_pLabel = new KviThemedLabel(m_pButtonBox, this, "query_label");
updateLabelText();
m_pButtonBox->setStretchFactor(m_pLabel, 1);
// The button box on the right
//KviTalHBox * box = new KviTalHBox(m_pTopSplitter,"button_box");
m_pButtonGrid = (QFrame *)new KviTalHBox(m_pButtonBox);
createTextEncodingButton(m_pButtonGrid);
m_pSplitter = new KviTalSplitter(Qt::Horizontal, this);
m_pSplitter->setObjectName("query_splitter");
m_pSplitter->setChildrenCollapsible(false);
m_pIrcView = new KviIrcView(m_pSplitter, this);
connect(m_pIrcView, SIGNAL(rightClicked()), this, SLOT(textViewRightClicked()));
//m_pEditorsContainer= new KviToolWindowsContainer(m_pSplitter);
m_pListViewButton = new KviWindowToolPageButton(KviIconManager::HideListView, KviIconManager::ShowListView, __tr2qs("Show user list"), buttonContainer(), true);
m_pListViewButton->setObjectName("list_view_button");
connect(m_pListViewButton, SIGNAL(clicked()), this, SLOT(toggleListView()));
#ifdef COMPILE_CRYPT_SUPPORT
createCryptControllerButton(m_pButtonGrid);
#endif
m_pUserListView = new KviUserListView(m_pSplitter, m_pListViewButton, connection()->userDataBase(), this, 7, __tr2qs("Query targets"), "user_list_view");
m_pInput = new KviInput(this, m_pUserListView);
if(KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnQueryJoin))
pasteLastLog();
if(KVI_OPTION_BOOL(KviOption_boolAutoLogQueries))
m_pIrcView->startLogging();
// FIXME: #warning "Maybe tell the user all that we know about the remote szEnd(s)....channels..."
m_pIrcView->enableDnd(true);
connect(m_pIrcView, SIGNAL(fileDropped(const QString &)), this, SLOT(slotDndEvents(const QString &)));
updateCaption();
}
示例12: 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);
}
示例13: dcc_module_request_error
static void dcc_module_request_error(KviDccRequest * dcc, const QString & errText)
{
dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCERROR,
__tr2qs_ctx("Unable to process the above request: %Q, %Q", "dcc"),
&errText,
KVI_OPTION_BOOL(KviOption_boolNotifyFailedDccHandshakes) ? &(__tr2qs_ctx("Ignoring and notifying failure", "dcc")) : &(__tr2qs_ctx("Ignoring", "dcc")));
if(KVI_OPTION_BOOL(KviOption_boolNotifyFailedDccHandshakes))
{
QString szError = QString("Sorry, your DCC %1 request can't be satisfied: %2").arg(dcc->szType.ptr(), errText);
//since szError contains a user-suppplied string, we simplify it to avoid any kind of injection (bug #858)
dcc_module_reply_errmsg(dcc, szError.simplified());
}
}
示例14: KviOptionsWidget
OptionsWidget_connectionSocket::OptionsWidget_connectionSocket(QWidget * parent)
: KviOptionsWidget(parent)
{
setObjectName("transport_options_widget");
createLayout();
KviUIntSelector * u;
KviTalGroupBox * g;
KviBoolSelector * b;
KviStringSelector * s;
g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Timeout Values", "options"));
u = addUIntSelector(g, __tr2qs_ctx("Connect timeout:", "options"), KviOption_uintIrcSocketTimeout, 5, 6000, 60);
u->setSuffix(__tr2qs_ctx(" sec", "options"));
u = addUIntSelector(g, __tr2qs_ctx("Outgoing data queue flush timeout:", "options"), KviOption_uintSocketQueueFlushTimeout, 100, 2000, 500);
u->setSuffix(__tr2qs_ctx(" msec", "options"));
b = addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Limit outgoing traffic per connection", "options"), KviOption_boolLimitOutgoingTraffic);
u = addUIntSelector(0, 2, 0, 2, __tr2qs_ctx("Limit to 1 message every:", "options"),
KviOption_uintOutgoingTrafficLimitUSeconds, 10000, 2000000, 10000001, KVI_OPTION_BOOL(KviOption_boolLimitOutgoingTraffic));
u->setSuffix(__tr2qs_ctx(" usec", "options"));
mergeTip(u, __tr2qs_ctx("Minimum value: <b>10000 usec</b><br>Maximum value: <b>10000000 usec</b>", "options"));
connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool)));
g = addGroupBox(0, 3, 0, 3, Qt::Horizontal, __tr2qs_ctx("Network Interfaces", "options"));
b = addBoolSelector(g, __tr2qs_ctx("Bind IPv4 connections to:", "options"), KviOption_boolBindIrcIPv4ConnectionsToSpecifiedAddress);
s = addStringSelector(g, "", KviOption_stringIPv4ConnectionBindAddress, KVI_OPTION_BOOL(KviOption_boolBindIrcIPv4ConnectionsToSpecifiedAddress));
connect(b, SIGNAL(toggled(bool)), s, SLOT(setEnabled(bool)));
#ifdef COMPILE_IPV6_SUPPORT
b = addBoolSelector(g, __tr2qs_ctx("Bind IPv6 connections to:", "options"), KviOption_boolBindIrcIPv6ConnectionsToSpecifiedAddress);
s = addStringSelector(g, "", KviOption_stringIPv6ConnectionBindAddress, KVI_OPTION_BOOL(KviOption_boolBindIrcIPv6ConnectionsToSpecifiedAddress));
connect(b, SIGNAL(toggled(bool)), s, SLOT(setEnabled(bool)));
#endif //!COMPILE_IPV6_SUPPORT
b = addBoolSelector(0, 4, 0, 4, __tr2qs_ctx("Pick random IP address for round-robin servers", "options"), KviOption_boolPickRandomIpAddressForRoundRobinServers);
mergeTip(b, __tr2qs_ctx("This option will cause the KVIrc networking stack to pick up "
"a random entry when multiple IP address are retrieved for a server "
"DNS lookup. This is harmless and can fix some problems with caching "
"DNS servers that do not properly rotate the records as the authoritative "
"ones would do. On the other hand, you might want to disable it if "
"you want to rely on the DNS server to provide the best choice.",
"options"));
b = addBoolSelector(0, 5, 0, 5, __tr2qs_ctx("Drop connection on SASL authentication failure", "options"), KviOption_boolDropConnectionOnSaslFailure);
mergeTip(b, __tr2qs_ctx("This option will close the socket if no SASL authentication or any SASL fallback had succeeded.", "options"));
addRowSpacer(0, 6, 0, 6);
}
示例15: QPainter
void UrlDialogTreeWidget::paintEvent(QPaintEvent * event)
{
QPainter * p = new QPainter(viewport());
QStyleOptionViewItem option = viewOptions();
QRect rect = event->rect();
#ifdef COMPILE_PSEUDO_TRANSPARENCY
if(KVI_OPTION_BOOL(KviOption_boolUseCompositingForTransparency) && g_pApp->supportsCompositing())
{
p->save();
p->setCompositionMode(QPainter::CompositionMode_Source);
QColor col = KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade);
col.setAlphaF((float)((float)KVI_OPTION_UINT(KviOption_uintGlobalTransparencyChildFadeFactor) / (float)100));
p->fillRect(rect, col);
p->restore();
}
else if(g_pShadedChildGlobalDesktopBackground)
{
QPoint pnt = ((KviWindow *)parent())->isDocked() ? viewport()->mapTo(g_pMainWindow, rect.topLeft()) : viewport()->mapTo((KviWindow *)parent(), rect.topLeft());
p->drawTiledPixmap(rect, *(g_pShadedChildGlobalDesktopBackground), pnt);
}
else
{
#endif
//FIXME this is not the treewindowlist
p->fillRect(rect, KVI_OPTION_COLOR(KviOption_colorTreeWindowListBackground));
#ifdef COMPILE_PSEUDO_TRANSPARENCY
}
#endif
delete p;
//call paint on all children
QTreeWidget::paintEvent(event);
}