mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Fix #72
This commit is contained in:
parent
0a41c0d712
commit
365b5f6d59
2
core.h
2
core.h
|
@ -273,7 +273,7 @@ private:
|
|||
private:
|
||||
Tox* tox;
|
||||
ToxAv* toxav;
|
||||
QTimer *toxTimer, *saveTimer, *fileTimer, *bootstrapTimer;
|
||||
QTimer *toxTimer, *fileTimer, *bootstrapTimer; //, *saveTimer;
|
||||
Camera* camera;
|
||||
QList<DhtServer> dhtServerList;
|
||||
int dhtServerId;
|
||||
|
|
|
@ -68,7 +68,7 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
|
|||
{
|
||||
QPoint pos = event->globalPos();
|
||||
QMenu menu;
|
||||
menu.addAction(tr("Copy friend ID","Menu to copy the Tox ID of that friend"));
|
||||
QAction* copyId = menu.addAction(tr("Copy friend ID","Menu to copy the Tox ID of that friend"));
|
||||
QMenu* inviteMenu = menu.addMenu(tr("Invite in group","Menu to invite a friend in a groupchat"));
|
||||
QMap<QAction*, Group*> groupActions;
|
||||
for (Group* group : GroupList::groupList)
|
||||
|
@ -79,17 +79,17 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
|
|||
if (groupActions.isEmpty())
|
||||
inviteMenu->setEnabled(false);
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Remove friend", "Menu to remove the friend from our friendlist"));
|
||||
QAction* removeFriendAction = menu.addAction(tr("Remove friend", "Menu to remove the friend from our friendlist"));
|
||||
|
||||
QAction* selectedItem = menu.exec(pos);
|
||||
if (selectedItem)
|
||||
{
|
||||
if (selectedItem->text() == "Copy friend ID")
|
||||
if (selectedItem == copyId)
|
||||
{
|
||||
emit copyFriendIdToClipboard(friendId);
|
||||
return;
|
||||
}
|
||||
else if (selectedItem->text() == "Remove friend")
|
||||
else if (selectedItem == removeFriendAction)
|
||||
{
|
||||
hide();
|
||||
emit removeFriend(friendId);
|
||||
|
|
|
@ -70,17 +70,14 @@ void GroupWidget::contextMenuEvent(QContextMenuEvent * event)
|
|||
{
|
||||
QPoint pos = event->globalPos();
|
||||
QMenu menu;
|
||||
menu.addAction(tr("Quit group","Menu to quit a groupchat"));
|
||||
QAction* quitGroup = menu.addAction(tr("Quit group","Menu to quit a groupchat"));
|
||||
|
||||
QAction* selectedItem = menu.exec(pos);
|
||||
if (selectedItem)
|
||||
if (selectedItem == quitGroup)
|
||||
{
|
||||
if (selectedItem->text() == "Quit group")
|
||||
{
|
||||
hide();
|
||||
emit removeGroup(groupId);
|
||||
return;
|
||||
}
|
||||
hide();
|
||||
emit removeGroup(groupId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1146,19 +1146,16 @@ void Widget::minimizeBtnClicked()
|
|||
void Widget::onStatusImgClicked()
|
||||
{
|
||||
QMenu menu;
|
||||
menu.addAction(tr("Online","Button to set your status to 'Online'"));
|
||||
menu.addAction(tr("Away","Button to set your status to 'Away'"));
|
||||
menu.addAction(tr("Busy","Button to set your status to 'Busy'"));
|
||||
QAction* online = menu.addAction(tr("Online","Button to set your status to 'Online'"));
|
||||
QAction* away = menu.addAction(tr("Away","Button to set your status to 'Away'"));
|
||||
QAction* busy = menu.addAction(tr("Busy","Button to set your status to 'Busy'"));
|
||||
|
||||
QPoint pos = QCursor::pos();
|
||||
QAction* selectedItem = menu.exec(pos);
|
||||
if (selectedItem)
|
||||
{
|
||||
if (selectedItem->text() == "Online")
|
||||
core->setStatus(Status::Online);
|
||||
else if (selectedItem->text() == "Away")
|
||||
core->setStatus(Status::Away);
|
||||
else if (selectedItem->text() == "Busy")
|
||||
core->setStatus(Status::Busy);
|
||||
}
|
||||
if (selectedItem == online)
|
||||
core->setStatus(Status::Online);
|
||||
else if (selectedItem == away)
|
||||
core->setStatus(Status::Away);
|
||||
else if (selectedItem == busy)
|
||||
core->setStatus(Status::Busy);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user