本文整理汇总了C++中ChatWidget类的典型用法代码示例。如果您正苦于以下问题:C++ ChatWidget类的具体用法?C++ ChatWidget怎么用?C++ ChatWidget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ChatWidget类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isVisible
SingleWindow::~SingleWindow()
{
KaduWindow *kadu = m_kaduWindowService->kaduWindow();
bool visible = isVisible();
m_configuration->deprecatedApi()->writeEntry("SingleWindow", "KaduWindowWidth", kadu->width());
disconnect(m_chatWidgetManager, 0, this, 0);
disconnect(m_tabs, 0, this, 0);
disconnect(kadu, 0, this, 0);
if (!m_sessionService->isClosing())
{
for (int i = m_tabs->count()-1; i >= 0; --i)
{
ChatWidget *chatWidget = static_cast<ChatWidget *>(m_tabs->widget(i));
const Chat &chat = chatWidget->chat();
m_tabs->removeTab(i);
delete chatWidget;
m_chatWidgetManager->openChat(chat, OpenChatActivation::DoNotActivate);
}
}
kadu->setParent(0);
if (!m_sessionService->isClosing())
kadu->setVisible(visible);
}
示例2: foreach
void PluginGUIHandler::ReceivedVoipData(const QString& peer_id)
{
std::cerr << "****** Plugin GUI handler: received VoipData!" << std::endl;
std::vector<RsVoipDataChunk> chunks ;
if(!rsVoip->getIncomingData(peer_id.toStdString(),chunks))
{
std::cerr << "PluginGUIHandler::ReceivedVoipData(): No data chunks to get. Weird!" << std::endl;
return ;
}
ChatDialog *di = ChatDialog::getExistingChat(peer_id.toStdString()) ;
if (di) {
ChatWidget *cw = di->getChatWidget();
if (cw) {
const QList<ChatWidgetHolder*> &chatWidgetHolderList = cw->chatWidgetHolderList();
foreach (ChatWidgetHolder *chatWidgetHolder, chatWidgetHolderList) {
AudioChatWidgetHolder *acwh = dynamic_cast<AudioChatWidgetHolder*>(chatWidgetHolder) ;
if (acwh) {
for (unsigned int i = 0; i < chunks.size(); ++i) {
for (unsigned int chunkIndex=0; chunkIndex<chunks.size(); chunkIndex++){
QByteArray qb(reinterpret_cast<const char *>(chunks[chunkIndex].data),chunks[chunkIndex].size);
acwh->addAudioData(peer_id,&qb);
}
}
break;
}
}
}
} else {
示例3: getChatWidget
void ChatDialog::addToParent(QWidget *newParent)
{
ChatWidget *cw = getChatWidget();
if (cw) {
cw->addToParent(newParent);
}
}
示例4: chatWidget
TalkableProxyModel * ChatEditBox::talkableProxyModel()
{
ChatWidget *cw = chatWidget();
if (cw && cw->chat().contacts().count() > 1)
return cw->talkableProxyModel();
return 0;
}
示例5: onkaduKeyPressed
void SingleWindow::onkaduKeyPressed(QKeyEvent *e)
{
/* unfortunatelly does not work correctly */
if (HotKey::shortCut(m_configuration, e, "ShortCuts", "FocusOnRosterTab"))
{
ChatWidget *chatWidget = static_cast<ChatWidget *>(m_tabs->currentWidget());
if (chatWidget)
chatWidget->edit()->setFocus();
}
}
示例6: ChatWidget
void BitSharesMainWindow::on_actionCreateMail_triggered()
{
//QMessageBox::information(this,"Create Mail Message","Widget not implemented yet");
//Allow multiple createMailWidgets to be created
//QCreateMailWidget* createMailWidget = new QCreateMailWidget(this);
//createMailWidget->show();
ChatWidget* chatWidget = new ChatWidget(nullptr); //parent is nullptr to make modeless floating window
static int person = 0;
++person;
QString contactName = QString("Person %1").arg(person);
chatWidget->setContact(contactName);
chatWidget->show();
}
示例7: onTabChange
void TabsManager::onTabChange(int index)
{
if (index < 0)
return;
ChatWidget *chatWidget = static_cast<ChatWidget *>(TabDialog->widget(index));
Title->setActiveChatWidget(chatWidget);
const Chat &chat = chatWidget->chat();
if (chat.unreadMessagesCount() > 0)
emit chatWidgetActivated(chatWidget);
//TabDialog->setWindowTitle(chatWidget->title()->title());
//TabDialog->setWindowIcon(chatWidget->title()->icon());
chatWidget->edit()->setFocus();
}
示例8: showDaysMessages
void ShowHistoryAction::showDaysMessages(QAction *action, int days)
{
Action *act = qobject_cast<Action *>(action);
Chat actionChat = act ? act->context()->chat() : Chat::null;
ChatWidget *chatWidget = action->data().value<ChatWidget *>();
if (!chatWidget)
{
m_historyWindowService->show(actionChat);
return;
}
WebkitMessagesView *chatMessagesView = chatWidget->chatMessagesView();
if (!chatMessagesView)
{
m_historyWindowService->show(actionChat);
return;
}
chatMessagesView->setForcePruneDisabled(0 != days);
if (-1 == days)
{
m_historyWindowService->show(chatWidget->chat());
return;
}
const Chat &buddyChat = m_buddyChatManager->buddyChat(chatWidget->chat());
const Chat &messagesChat = buddyChat ? buddyChat : chatWidget->chat();
HistoryStorage *historyStorage = m_history->currentStorage();
if (!historyStorage)
return;
HistoryQuery query;
query.setTalkable(messagesChat);
if (0 == days)
query.setLimit(configuration()->deprecatedApi()->readUnsignedNumEntry("History", "ChatHistoryCitation", 10));
else
query.setFromDate(QDate::currentDate().addDays(-days));
new HistoryMessagesPrepender(historyStorage->messages(query), chatMessagesView);
}
示例9: foreach
void VOIPGUIHandler::ReceivedInvitation(const RsPeerId &peer_id, int flags)
{
#ifdef VOIPGUIHANDLER_DEBUG
std::cerr << "****** VOIPGUIHandler: received Invitation from peer " << peer_id.toStdString() << " with flags==" << flags << std::endl;
#endif
ChatDialog *di = ChatDialog::getChat(ChatId(peer_id), Settings->getChatFlags());
if (di) {
ChatWidget *cw = di->getChatWidget();
if(cw) {
const QList<ChatWidgetHolder*> &chatWidgetHolderList = cw->chatWidgetHolderList();
foreach (ChatWidgetHolder *chatWidgetHolder, chatWidgetHolderList)
{
VOIPChatWidgetHolder *acwh = dynamic_cast<VOIPChatWidgetHolder*>(chatWidgetHolder) ;
if (acwh)
acwh->ReceivedInvitation(peer_id, flags);
}
}
} else {
示例10: foreach
void VOIPGUIHandler::ReceivedVoipData(const RsPeerId &peer_id)
{
std::vector<RsVOIPDataChunk> chunks ;
if(!rsVOIP->getIncomingData(peer_id,chunks))
{
std::cerr << "VOIPGUIHandler::ReceivedVoipData(): No data chunks to get. Weird!" << std::endl;
return ;
}
ChatDialog *di = ChatDialog::getChat(ChatId(peer_id), Settings->getChatFlags());
if (di) {
ChatWidget *cw = di->getChatWidget();
if (cw) {
const QList<ChatWidgetHolder*> &chatWidgetHolderList = cw->chatWidgetHolderList();
foreach (ChatWidgetHolder *chatWidgetHolder, chatWidgetHolderList)
{
VOIPChatWidgetHolder *acwh = dynamic_cast<VOIPChatWidgetHolder*>(chatWidgetHolder) ;
if (acwh) {
for (unsigned int chunkIndex=0; chunkIndex<chunks.size(); chunkIndex++)
{
QByteArray qb(reinterpret_cast<const char *>(chunks[chunkIndex].data),chunks[chunkIndex].size);
if(chunks[chunkIndex].type == RsVOIPDataChunk::RS_VOIP_DATA_TYPE_AUDIO)
acwh->addAudioData(peer_id, &qb);
else if(chunks[chunkIndex].type == RsVOIPDataChunk::RS_VOIP_DATA_TYPE_VIDEO)
acwh->addVideoData(peer_id, &qb);
else
std::cerr << "VOIPGUIHandler: Unknown data type received. type=" << chunks[chunkIndex].type << std::endl;
}
break;
}
}
}
} else {
示例11: m
void NotifyQt::UpdateGUI()
{
if(RsAutoUpdatePage::eventsLocked())
return ;
{
QMutexLocker m(&_mutex) ;
if(!_enabled)
return ;
}
static bool already_updated = false ; // these only update once at start because they may already have been set before
// the gui is running, then they get updated by callbacks.
if(!already_updated)
{
emit messagesChanged() ;
emit neighboursChanged();
emit configChanged();
already_updated = true ;
}
/* Finally Check for PopupMessages / System Error Messages */
if (rsNotify)
{
uint32_t sysid;
uint32_t type;
std::string title, id, msg;
/* You can set timeToShow, timeToLive and timeToHide or can leave the standard */
ToasterItem *toaster = NULL;
if (rsNotify->NotifyPopupMessage(type, id, title, msg))
{
uint popupflags = Settings->getNotifyFlags();
switch(type)
{
case RS_POPUP_ENCRYPTED_MSG:
SoundManager::play(SOUND_MESSAGE_ARRIVED);
if ((popupflags & RS_POPUP_MSG) && !_disableAllToaster)
{
toaster = new ToasterItem(new MessageToaster("", tr("Encrypted message"), QString("[%1]").arg(tr("Encrypted message"))));
}
break;
case RS_POPUP_MSG:
SoundManager::play(SOUND_MESSAGE_ARRIVED);
if ((popupflags & RS_POPUP_MSG) && !_disableAllToaster)
{
toaster = new ToasterItem(new MessageToaster(id, QString::fromUtf8(title.c_str()), QString::fromUtf8(msg.c_str())));
}
break;
case RS_POPUP_CONNECT:
SoundManager::play(SOUND_USER_ONLINE);
if ((popupflags & RS_POPUP_CONNECT) && !_disableAllToaster)
{
toaster = new ToasterItem(new OnlineToaster(RsPeerId(id)));
}
break;
case RS_POPUP_DOWNLOAD:
SoundManager::play(SOUND_DOWNLOAD_COMPLETE);
if ((popupflags & RS_POPUP_DOWNLOAD) && !_disableAllToaster)
{
/* id = file hash */
toaster = new ToasterItem(new DownloadToaster(RsFileHash(id), QString::fromUtf8(title.c_str())));
}
break;
case RS_POPUP_CHAT:
if ((popupflags & RS_POPUP_CHAT) && !_disableAllToaster)
{
// TODO: fix for distant chat, look up if dstant chat uses RS_POPUP_CHAT
ChatDialog *chatDialog = ChatDialog::getChat(ChatId(RsPeerId(id)));
ChatWidget *chatWidget;
if (chatDialog && (chatWidget = chatDialog->getChatWidget()) && chatWidget->isActive()) {
// do not show when active
break;
}
toaster = new ToasterItem(new ChatToaster(RsPeerId(id), QString::fromUtf8(msg.c_str())));
}
break;
case RS_POPUP_GROUPCHAT:
if ((popupflags & RS_POPUP_GROUPCHAT) && !_disableAllToaster)
{
MainWindow *mainWindow = MainWindow::getInstance();
if (mainWindow && mainWindow->isActiveWindow() && !mainWindow->isMinimized()) {
if (MainWindow::getActivatePage() == MainWindow::Friends) {
if (FriendsDialog::isGroupChatActive()) {
// do not show when active
break;
}
}
}
toaster = new ToasterItem(new GroupChatToaster(RsPeerId(id), QString::fromUtf8(msg.c_str())));
}
break;
case RS_POPUP_CHATLOBBY:
//.........这里部分代码省略.........
示例12: GetChannel
void MainClientWindow::AddMessageToChannel(IRCData::MessageData *messageData)
{
ChatWidget *widget = GetChannel(messageData->channelName);
widget->AddMessage(messageData);
}
示例13: do_finish_chat_input
static void do_finish_chat_input(void * arg){
ChatWidget * widget = (ChatWidget *) arg;
widget->endChatLine();
}
示例14: createConsoleWidget
ChatWidget* Protocol::createConsoleWidget()
{
ChatWidget* console = new ChatWidget;
console->setConsoleMode(true);
return console;
}