本文整理汇总了C++中KviWindow类的典型用法代码示例。如果您正苦于以下问题:C++ KviWindow类的具体用法?C++ KviWindow怎么用?C++ KviWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KviWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KVI_OPTION_UINT
void KviMainWindow::updatePseudoTransparency()
{
#ifdef COMPILE_PSEUDO_TRANSPARENCY
uint uOpacity = KVI_OPTION_UINT(KviOption_uintGlobalWindowOpacityPercent) < 50 ? 50 : KVI_OPTION_UINT(KviOption_uintGlobalWindowOpacityPercent);
setWindowOpacity((float)uOpacity / 100);
#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
#ifndef Q_WS_EX_LAYERED
#define Q_WS_EX_LAYERED WS_EX_LAYERED
#endif
if(uOpacity < 100)
{
SetWindowLong(reinterpret_cast<HWND>(effectiveWinId()), GWL_EXSTYLE,
GetWindowLong(reinterpret_cast<HWND>(effectiveWinId()), GWL_EXSTYLE) | Q_WS_EX_LAYERED);
}
else
{
SetWindowLong(reinterpret_cast<HWND>(effectiveWinId()), GWL_EXSTYLE,
GetWindowLong(reinterpret_cast<HWND>(effectiveWinId()), GWL_EXSTYLE) & ~Q_WS_EX_LAYERED);
}
#endif
if(g_pShadedParentGlobalDesktopBackground)
m_pWindowStack->update();
if(g_pShadedChildGlobalDesktopBackground)
{
for(KviWindow * wnd = m_pWinList->first(); wnd; wnd = m_pWinList->next())
wnd->updateBackgrounds();
m_pWindowList->updatePseudoTransparency();
}
#endif
}
示例2: window
void KviKvsAsyncDnsOperation::lookupTerminated(KviDnsResolver *)
{
KviWindow * pWnd = window();
if(!g_pApp->windowExists(pWnd))
pWnd = g_pActiveWindow;
if(m_pCallback)
{
KviKvsVariantList params;
params.setAutoDelete(true);
if(m_pDns->state() == KviDnsResolver::Failure)
{
params.append(new KviKvsVariant(m_szQuery));
params.append(new KviKvsVariant((kvs_int_t)0));
params.append(new KviKvsVariant(m_pDns->errorString()));
params.append(new KviKvsVariant());
params.append(new KviKvsVariant(*m_pMagic));
}
else
{
QString szHostName = m_pDns->hostName();
const auto & strL = m_pDns->ipAddressList();
const QString & fi = strL.empty() ? QString("?.?.?.?") : strL.front();
params.append(new KviKvsVariant(m_szQuery));
params.append(new KviKvsVariant((kvs_int_t)1));
params.append(new KviKvsVariant(fi));
params.append(new KviKvsVariant(szHostName.isEmpty() ? QString("?.?") : szHostName));
params.append(new KviKvsVariant(*m_pMagic));
}
m_pCallback->run(pWnd, ¶ms, nullptr, KviKvsScript::PreserveParams);
delete this;
return;
}
// we have no callback : output the results
QString szQuery = m_pDns->query();
pWnd->output(KVI_OUT_HOSTLOOKUP, __tr2qs_ctx("DNS lookup result for query \"%Q\"", "kvs"), &szQuery);
if(m_pDns->state() == KviDnsResolver::Failure)
{
QString strDescription(m_pDns->errorString());
pWnd->output(KVI_OUT_HOSTLOOKUP, __tr2qs_ctx("Error: %Q", "kvs"), &strDescription);
}
else
{
QString szHostName = m_pDns->hostName();
pWnd->output(KVI_OUT_HOSTLOOKUP, __tr2qs_ctx("Hostname: %Q", "kvs"), &szHostName);
int idx = 1;
for(const auto & a : m_pDns->ipAddressList())
{
pWnd->output(KVI_OUT_HOSTLOOKUP, __tr2qs_ctx("IP address %d: %Q", "kvs"), idx, &a);
idx++;
}
}
delete this;
}
示例3: regClicked
void ChannelsJoinDialog::regClicked()
{
QString szTmp = m_pChannelEdit->text();
if(szTmp.isEmpty())
return;
KviQString::escapeKvs(&szTmp);
QString szCmd = "regchan.add ";
szCmd += szTmp;
KviConsoleWindow * c = g_pApp->topmostConnectedConsole();
if(!c)
return; // no connection
KviWindow * w = g_pActiveWindow;
if(w->console() != c)
w = c;
KviKvsScript::run(szCmd,w);
fillListView();
//focus the new item (in reality, the first matching one)
QList<QTreeWidgetItem*> items = m_pTreeWidget->findItems(szTmp, Qt::MatchRecursive | Qt::MatchExactly);
if(!items.empty())
{
m_pTreeWidget->setCurrentItem(items.first());
m_pTreeWidget->scrollToItem(items.first());
}
}
示例4: joinClicked
void ChannelsJoinDialog::joinClicked()
{
QString szPass = m_pPass->text();
QString szTmp = m_pChannelEdit->text();
if(szTmp.isEmpty())
return;
KviQString::escapeKvs(&szTmp);
KviQString::escapeKvs(&szPass);
QString szCmd = "join ";
szCmd += szTmp;
szCmd += " ";
szCmd += szPass;
KviConsoleWindow * c = g_pApp->topmostConnectedConsole();
if(!c)
return; // no connection
KviWindow * w = g_pActiveWindow;
if(w->console() != c)
w = c;
KviKvsScript::run(szCmd,w);
m_pChannelEdit->setText("");
m_pPass->setText("");
}
示例5: transferWindow
void HttpFileTransfer::transferTerminated(bool bSuccess)
{
KviWindow * out = transferWindow();
m_tTransferEndTime = kvi_unixTime();
KviKvsVariantList vParams;
vParams.append(bSuccess);
vParams.append(new KviKvsVariant(m_pHttpRequest->url().url(), true));
vParams.append(new KviKvsVariant(m_pHttpRequest->fileName(), true));
vParams.append(new KviKvsVariant(m_vMagicIdentifier));
if(m_szCompletionCallback.isNull())
{
KVS_TRIGGER_EVENT(KviEvent_OnHTTPGetTerminated,out ? out : (KviWindow *)(g_pApp->activeConsole()),&vParams)
} else {
KviKvsScript::run(m_szCompletionCallback,out ? out : (KviWindow *)(g_pApp->activeConsole()),&vParams);
}
if(bSuccess)
{
m_szStatusString = __tr2qs_ctx("Transfer completed","http");
m_eGeneralStatus = Success;
displayUpdate();
if(out && (!m_bNoOutput))out->output(KVI_OUT_GENERICSUCCESS,__tr2qs_ctx("[HTTP %d]: Transfer completed","http"),id());
g_pApp->fileDownloadTerminated(
true,
m_pHttpRequest->url().url(),
m_pHttpRequest->fileName(),
QString(),
QString(),
!m_bNotifyCompletion
);
} else {
m_szStatusString = __tr2qs_ctx("Transfer failed","http");
m_szStatusString += ": ";
m_szStatusString += m_pHttpRequest->lastError();
m_eGeneralStatus = Failure;
displayUpdate();
if(out && (!m_bNoOutput))out->output(KVI_OUT_GENERICERROR,__tr2qs_ctx("[HTTP %d]: Transfer failed: %Q","http"),id(),&(m_pHttpRequest->lastError()));
g_pApp->fileDownloadTerminated(
false,
m_pHttpRequest->url().url(),
m_pHttpRequest->fileName(),
QString(),
m_pHttpRequest->lastError(),
!m_bNotifyCompletion
);
}
if(m_bAutoClean)
{
if(m_pAutoCleanTimer)delete m_pAutoCleanTimer;
m_pAutoCleanTimer = new QTimer();
connect(m_pAutoCleanTimer,SIGNAL(timeout()),this,SLOT(autoClean()));
m_pAutoCleanTimer->start(100);
m_TimerId=m_pAutoCleanTimer->timerId();
}
}
示例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: consoleCount
unsigned int KviMainWindow::consoleCount()
{
unsigned int count = 0;
for(KviWindow * wnd = m_pWinList->first();wnd;wnd = m_pWinList->next())
{
if (wnd) if(wnd->type() == KviWindow::Console) count++;
}
return count;
}
示例8: count
void KviWindowStack::fillWindowPopup()
{
m_pWindowPopup->clear();
int i = 100;
QString szItem;
QString szCaption;
KviWindow * pWnd;
QAction * pAction;
int idx = 0;
int cnt = count();
while(idx < cnt)
{
QWidget * w = widget(idx);
if(!w->inherits("KviWindow"))
{
idx++;
continue;
}
pWnd = (KviWindow *)w;
szItem.setNum(((uint)idx)+1);
szItem+=". ";
szCaption = pWnd->windowTitle();
if(szCaption.length() > 30)
{
QString trail = szCaption.right(12);
szCaption.truncate(12);
szCaption+="...";
szCaption+=trail;
}
szItem+=szCaption;
const QPixmap * pix = pWnd->myIconPtr();
if (pix && !(pix->isNull()))
pAction = m_pWindowPopup->addAction(*pix, szItem);
else
pAction = m_pWindowPopup->addAction(szItem);
pAction->setData(idx);
if(w == currentWidget())
pAction->setChecked(true);
idx++;
}
}
示例9: 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());
}
示例10: widget
void KviMdiChild::closeEvent(QCloseEvent * e)
{
//we let kviwindow handle the process
KviWindow * pClient = (KviWindow*) widget();
if(pClient)
{
e->ignore();
pClient->delayedClose();
}
}
示例11: applyOptions
void KviMainWindow::applyOptions()
{
m_pMdi->update();
for(KviWindow * wnd = m_pWinList->first();wnd;wnd = m_pWinList->next())
wnd->applyOptions();
m_pWindowList->applyOptions();
g_pTextIconManager->applyOptions();
}
示例12:
KviConsoleWindow * KviMainWindow::firstConsole()
{
for(KviWindow * wnd = m_pWinList->first(); wnd; wnd = m_pWinList->next())
{
if(wnd->type() == KviWindow::Console)
return (KviConsoleWindow *)wnd;
}
// We end up here when we have not console windows.
// This may happen at early startup or late before shutdown.
return nullptr;
}
示例13: KVI_OPTION_BOOL
void KviNotifyListManager::notifyOffLine(const QString & szNick, const QString & szUser, const QString & szHost, const QString & szReason)
{
KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolNotifyListChangesToActiveWindow) ? m_pConsole->activeWindow() : m_pConsole;
if(!KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnNotifyOffLine, pOut, szNick))
{
QString szWho;
if(!(szUser.isEmpty() || szHost.isEmpty()))
szWho = QString("\r!n\r%1\r [%[email protected]\r!h\r%3\r]").arg(szNick, szUser, szHost);
else
szWho = QString("\r!n\r%1\r").arg(szNick);
QString szMsg;
KviPointerHashTable<QString, KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
KviPointerHashTableIterator<QString, KviRegisteredUser> it(*d);
while(KviRegisteredUser * pUser = it.current())
{
QString szProp = pUser->getProperty("notify");
if(!szProp.isEmpty())
{
if(szProp.split(",", QString::SkipEmptyParts).indexOf(szNick) != -1)
{
QString szComment = pUser->getProperty("comment");
if(!szComment.isEmpty())
szMsg = QString("%1 (%2), Group \"%3\" has left IRC as (%4)").arg(pUser->name(), szComment, pUser->group(), szWho);
else
szMsg = QString("%1, Group \"%2\" has left IRC as (%3)").arg(pUser->name(), pUser->group(), szWho);
break;
}
}
++it;
}
if(szMsg.isEmpty())
szMsg = QString(__tr2qs("%1 has left IRC")).arg(szWho);
if((!szReason.isEmpty()) && (_OUTPUT_VERBOSE))
{
szMsg += "(";
szMsg += szReason;
szMsg += ")";
}
pOut->outputNoFmt(KVI_OUT_NOTIFYOFFLINE, szMsg);
}
m_pConsole->notifyListView()->part(szNick);
}
示例14: applyOptions
void KviMainWindow::applyOptions()
{
m_pWindowStack->update();
for(KviWindow * wnd = m_pWinList->first(); wnd; wnd = m_pWinList->next())
wnd->applyOptions();
m_pWindowList->applyOptions();
g_pTextIconManager->applyOptions();
#ifndef COMPILE_ON_MAC
m_pMenuBar->setVisible(KVI_OPTION_BOOL(KviOption_boolMenuBarVisible));
#endif
}
示例15: clearClicked
void ChannelsJoinDialog::clearClicked()
{
QString szCmd = "option stringlistRecentChannels";
KviConsoleWindow * c = g_pApp->topmostConnectedConsole();
if(!c)
return; // no connection
KviWindow * w = g_pActiveWindow;
if(w->console() != c)
w = c;
KviKvsScript::run(szCmd,w);
fillListView();
}