• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ KVI_OPTION_BOOL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中KVI_OPTION_BOOL函数的典型用法代码示例。如果您正苦于以下问题:C++ KVI_OPTION_BOOL函数的具体用法?C++ KVI_OPTION_BOOL怎么用?C++ KVI_OPTION_BOOL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了KVI_OPTION_BOOL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
		}
	}
}
开发者ID:philouvb,项目名称:KVIrc,代码行数:60,代码来源:KviInput.cpp


示例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);
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:60,代码来源:OptionsWidget_connection.cpp


示例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();
		}
	}
	*/
}
开发者ID:Cizzle,项目名称:KVIrc,代码行数:30,代码来源:KviWindow.cpp


示例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);
}
开发者ID:Cizzle,项目名称:KVIrc,代码行数:27,代码来源:OptionsWidget_userList.cpp


示例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;
		}
	}
}
开发者ID:beigexperience,项目名称:KVIrc,代码行数:60,代码来源:KviInput.cpp


示例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;
}
开发者ID:un1versal,项目名称:KVIrc,代码行数:58,代码来源:KviMainWindow.cpp


示例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());
}
开发者ID:wodim,项目名称:kronos,代码行数:56,代码来源:KviWindow.cpp


示例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();
	}
}
开发者ID:namikaze90,项目名称:KVIrc,代码行数:10,代码来源:KviMdiManager.cpp


示例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;
		}
	}
}
开发者ID:netrunner-debian-kde-extras,项目名称:kvirc,代码行数:58,代码来源:libkvisetup.cpp


示例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 {
开发者ID:DINKIN,项目名称:KVIrc,代码行数:53,代码来源:OptionsWidget_theme.cpp


示例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();
}
开发者ID:Dessa,项目名称:KVIrc,代码行数:52,代码来源:KviQueryWindow.cpp


示例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);
}
开发者ID:namikaze90,项目名称:KVIrc-old,代码行数:52,代码来源:OptionsWidget_alertsAndHighlighting.cpp


示例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());
	}
}
开发者ID:Cizzle,项目名称:KVIrc,代码行数:14,代码来源:requests.cpp


示例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);
}
开发者ID:IceN9ne,项目名称:KVIrc,代码行数:48,代码来源:OptionsWidget_connection.cpp


示例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);
}
开发者ID:un1versal,项目名称:KVIrc,代码行数:35,代码来源:libkviurl.cpp


示例16: p

void KviMdiManager::paintEvent(QPaintEvent * e)
{
	QPainter p(viewport());

#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_uintGlobalTransparencyParentFadeFactor) / (float)100));
		p.fillRect(e->rect(), col);
		p.restore();
		return;
	} else if(g_pShadedParentGlobalDesktopBackground)
	{
		QPoint pnt = viewport()->mapTo(g_pMainWindow, e->rect().topLeft() + scrollBarsOffset());
		p.drawTiledPixmap(e->rect(),*(g_pShadedParentGlobalDesktopBackground), pnt);
		return;
	}
#endif
	if(KVI_OPTION_PIXMAP(KviOption_pixmapMdiBackground).pixmap())
	{
		QPoint pnt = viewport()->mapTo(g_pMainWindow, e->rect().topLeft() + scrollBarsOffset());
		p.drawTiledPixmap(e->rect(),*(KVI_OPTION_PIXMAP(KviOption_pixmapMdiBackground).pixmap()), pnt);
	} else {
		p.fillRect(e->rect(),KVI_OPTION_COLOR(KviOption_colorMdiBackground));
	}
}
开发者ID:namikaze90,项目名称:KVIrc,代码行数:29,代码来源:KviMdiManager.cpp


示例17: KVI_OPTION_BOOL

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


示例18: KviOptionsWidget

OptionsWidget_windowList::OptionsWidget_windowList(QWidget * parent)
    : KviOptionsWidget(parent)
{
	setObjectName("windowlist_options_widget");
	createLayout();

	KviTalHBox * hbox = new KviTalHBox(this);
	QLabel * l = new QLabel(__tr2qs_ctx("Window list type:", "options"), hbox);
	m_pWindowListType = new QComboBox(hbox);
	m_pWindowListType->addItem(__tr2qs_ctx("Tree", "options"));
	m_pWindowListType->addItem(__tr2qs_ctx("Classic", "options"));
	m_pWindowListType->setCurrentIndex(KVI_OPTION_BOOL(KviOption_boolUseTreeWindowList) ? 0 : 1);
	addWidgetToLayout(hbox, 0, 0, 0, 0);

	addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Sort windows by name", "options"), KviOption_boolSortWindowListItemsByName);
	addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Show window icons in window list", "options"), KviOption_boolUseWindowListIcons);
	KviBoolSelector * b = addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Show activity meter in window list", "options"), KviOption_boolUseWindowListActivityMeter);
	mergeTip(b, __tr2qs_ctx("This option enables the usage of the window list activity meter. "
	                        "Each window entry will have a small indicator of the activity that is going on in that window. "
	                        "The indicator is a small square that changes colors, dark colors mean low activity, "
	                        "while bright colors signal high activity. KVIrc also uses some heuristics to determine "
	                        "whether the activity is somewhat \"human\" or it is generated by automated entities (such as bots "
	                        "or IRC servers). \"Human\" activity causes the indicator to be shaded red while automated "
	                        "activity causes the indicator to be shaded blue.", "options"));

	addBoolSelector(0, 4, 0, 4, __tr2qs_ctx("Show IRC context indicator in window list", "options"), KviOption_boolUseWindowListIrcContextIndicator);
	addBoolSelector(0, 5, 0, 5, __tr2qs_ctx("Enable window tooltips", "options"), KviOption_boolShowWindowListToolTips);
	addBoolSelector(0, 6, 0, 6, __tr2qs_ctx("Allow the window list to be moved", "options"), KviOption_boolShowTreeWindowListHandle);
	addBoolSelector(0, 7, 0, 7, __tr2qs_ctx("Show user flag for channels", "options"), KviOption_boolShowUserFlagForChannelsInWindowList);

	addRowSpacer(0, 8, 0, 8);
}
开发者ID:Dessa,项目名称:KVIrc,代码行数:32,代码来源:OptionsWidget_windowList.cpp


示例19: KVI_OPTION_STRING


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ KVI_OPTION_STRING函数代码示例发布时间:2022-05-30
下一篇:
C++ KVI_ASSERT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap