mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-09 03:18:41 -05:00
Fix for macos alternative chat room notify
This commit is contained in:
parent
267ffc99af
commit
4982e4b664
@ -146,6 +146,46 @@ QString ChatLobbyUserNotify::getNotifyMessage(bool plural)
|
|||||||
|
|
||||||
void ChatLobbyUserNotify::iconClicked()
|
void ChatLobbyUserNotify::iconClicked()
|
||||||
{
|
{
|
||||||
|
#if defined(Q_OS_DARWIN)
|
||||||
|
std::list<ChatLobbyId> lobbies;
|
||||||
|
rsMsgs->getChatLobbyList(lobbies);
|
||||||
|
bool doUpdate=false;
|
||||||
|
|
||||||
|
for (lobby_map::iterator itCL=_listMsg.begin(); itCL!=_listMsg.end();)
|
||||||
|
{
|
||||||
|
bool bFound=false;
|
||||||
|
QString strLobbyName=tr("Unknown Lobby");
|
||||||
|
QIcon icoLobby=QIcon();
|
||||||
|
std::list<ChatLobbyId>::const_iterator lobbyIt;
|
||||||
|
for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) {
|
||||||
|
ChatLobbyId clId = *lobbyIt;
|
||||||
|
if (clId==itCL->first) {
|
||||||
|
ChatLobbyInfo clInfo;
|
||||||
|
if (rsMsgs->getChatLobbyInfo(clId,clInfo))
|
||||||
|
strLobbyName=QString::fromUtf8(clInfo.lobby_name.c_str()) ;
|
||||||
|
bFound=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bFound)
|
||||||
|
{
|
||||||
|
MainWindow::showWindow(MainWindow::ChatLobby);
|
||||||
|
ChatLobbyWidget *chatLobbyWidget = dynamic_cast<ChatLobbyWidget*>(MainWindow::getPage(MainWindow::ChatLobby));
|
||||||
|
if (chatLobbyWidget) chatLobbyWidget->showLobbyAnchor(itCL->first,strLobbyName);
|
||||||
|
++itCL ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lobby_map::iterator ittmp(itCL);
|
||||||
|
++ittmp ;
|
||||||
|
_listMsg.erase(itCL);
|
||||||
|
itCL=ittmp ;
|
||||||
|
doUpdate=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
|
||||||
/// Tray icon Menu ///
|
/// Tray icon Menu ///
|
||||||
QMenu* trayMenu = new QMenu(MainWindow::getInstance());
|
QMenu* trayMenu = new QMenu(MainWindow::getInstance());
|
||||||
std::list<ChatLobbyId> lobbies;
|
std::list<ChatLobbyId> lobbies;
|
||||||
@ -207,6 +247,7 @@ void ChatLobbyUserNotify::iconClicked()
|
|||||||
trayMenu->exec(QCursor::pos());
|
trayMenu->exec(QCursor::pos());
|
||||||
if (doUpdate) updateIcon();
|
if (doUpdate) updateIcon();
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatLobbyUserNotify::makeSubMenu(QMenu* parentMenu, QIcon icoLobby, QString strLobbyName, ChatLobbyId id)
|
void ChatLobbyUserNotify::makeSubMenu(QMenu* parentMenu, QIcon icoLobby, QString strLobbyName, ChatLobbyId id)
|
||||||
@ -251,7 +292,6 @@ void ChatLobbyUserNotify::iconHovered()
|
|||||||
iconClicked();
|
iconClicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ChatLobbyUserNotify::chatLobbyNewMessage(ChatLobbyId lobby_id, QDateTime time, QString senderName, QString msg)
|
void ChatLobbyUserNotify::chatLobbyNewMessage(ChatLobbyId lobby_id, QDateTime time, QString senderName, QString msg)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user