Commit ef554911 authored by Rafał Malinowski's avatar Rafał Malinowski

file-transfer: do not show all callback buttons on file-transfer notifications

Signed-off-by: Rafał Malinowski's avatarRafał Przemysław Malinowski <rafal.przemyslaw.malinowski@gmail.com>
parent 491e89b0
......@@ -112,7 +112,7 @@ void NewFileTransferNotification::notifyIncomingFileTransfer(const FileTransfer
}
NewFileTransferNotification::NewFileTransferNotification(Chat chat, const QString &type, FileTransfer transfer, FileTransferStartType startType) :
ChatNotification{chat, type, KaduIcon{}},
ChatNotification{chat, type, KaduIcon{}, false},
m_transfer{transfer}
{
if (startType == FileTransferStartType::Restore)
......
......@@ -28,11 +28,14 @@
#include "chat-notification.h"
ChatNotification::ChatNotification(const Chat &chat, const QString &type, const KaduIcon &icon) :
ChatNotification::ChatNotification(const Chat &chat, const QString &type, const KaduIcon &icon, bool showChatCallbacks) :
AccountNotification(chat.chatAccount(), type, icon), CurrentChat(chat)
{
addCallback(tr("Chat"), SLOT(callbackAccept()), "callbackAccept()");
addCallback(tr("Ignore"), SLOT(callbackDiscard()), "callbackDiscard()");
if (showChatCallbacks)
{
addCallback(tr("Chat"), SLOT(callbackAccept()), "callbackAccept()");
addCallback(tr("Ignore"), SLOT(callbackDiscard()), "callbackDiscard()");
}
}
void ChatNotification::openChat()
......
......@@ -37,7 +37,7 @@ class KADUAPI ChatNotification : public AccountNotification
Chat CurrentChat;
public:
ChatNotification(const Chat &chat, const QString &type, const KaduIcon &icon);
ChatNotification(const Chat &chat, const QString &type, const KaduIcon &icon, bool showChatCallbacks);
virtual ~ChatNotification() {}
Chat chat() { return CurrentChat; }
......
......@@ -66,7 +66,7 @@ void MessageNotification::unregisterEvents()
MessageNotification::MessageNotification(ChatWidgetRepository *chatWidgetRepository, MessageType messageType, const Message &message) :
ChatNotification(message.messageChat(), messageType == NewChat ? "NewChat" : "NewMessage",
KaduIcon("protocols/common/message")), CurrentMessage(message)
KaduIcon("protocols/common/message"), true), CurrentMessage(message)
{
connect(chatWidgetRepository, SIGNAL(chatWidgetAdded(ChatWidget*)), this, SLOT(chatWidgetAdded(ChatWidget*)));
......
......@@ -109,7 +109,7 @@ void StatusChangedNotification::unregisterEvents()
StatusChangedNotification::StatusChangedNotification(const QString &toStatus, const Contact &contact, const QString &statusDisplayName, const QString &description) :
ChatNotification(ChatTypeContact::findChat(contact, ActionCreateAndAdd),
QString("StatusChanged") + toStatus, contact.contactAccount().protocolHandler()->statusIcon(contact.currentStatus().type()))
QString("StatusChanged") + toStatus, contact.contactAccount().protocolHandler()->statusIcon(contact.currentStatus().type()), true)
{
CurrentContact = contact;
Status status = contact.currentStatus();
......
......@@ -48,7 +48,7 @@ void AntistringNotification::notifyStringReceived(const Chat &chat)
}
AntistringNotification::AntistringNotification(const Chat &chat) :
ChatNotification(chat, "Antistring", KaduIcon())
ChatNotification(chat, "Antistring", KaduIcon(), true)
{
}
......
......@@ -56,7 +56,7 @@ void CenzorNotification::notifyCenzored(const Chat &chat)
}
CenzorNotification::CenzorNotification(const Chat &chat) :
ChatNotification(chat, "cenzorNotification", KaduIcon())
ChatNotification(chat, "cenzorNotification", KaduIcon(), true)
{
}
......
......@@ -62,7 +62,7 @@ void FirewallNotification::notify(const Chat &chat, const Contact &sender, const
}
FirewallNotification::FirewallNotification(const Chat &chat) :
ChatNotification(chat, "firewallNotification", KaduIcon("ManageKeysWindowIcon"))
ChatNotification(chat, "firewallNotification", KaduIcon("ManageKeysWindowIcon"), true)
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment