diff --git a/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp b/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp
index 7f42add03..88e4c454a 100644
--- a/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp
+++ b/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp
@@ -50,6 +50,8 @@ ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId
messageframe->setVisible(false);
sendButton->hide();
+ cancelButton->hide();
+ sendButton->setEnabled(false);
/* general ones */
connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) );
@@ -58,6 +60,7 @@ ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId
connect( chatButton, SIGNAL( clicked( void ) ), this, SLOT( openChat ( void ) ) );
connect( msgButton, SIGNAL( clicked( void ) ), this, SLOT( sendMsg ( void ) ) );
connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
+ connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
connect( sendButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
@@ -251,11 +254,13 @@ void ChatMsgItem::togglequickmessage()
{
messageframe->setVisible(true);
sendButton->show();
+ cancelButton->show();
}
else
{
messageframe->setVisible(false);
sendButton->hide();
+ cancelButton->hide();
}
}
@@ -274,6 +279,7 @@ void ChatMsgItem::sendMessage()
quickmsgText->clear();
messageframe->setVisible(false);
sendButton->hide();
+ cancelButton->hide();
}
void ChatMsgItem::on_quickmsgText_textChanged()
diff --git a/retroshare-gui/src/gui/feeds/ChatMsgItem.ui b/retroshare-gui/src/gui/feeds/ChatMsgItem.ui
index 8f0eca41d..ea9bca7c1 100644
--- a/retroshare-gui/src/gui/feeds/ChatMsgItem.ui
+++ b/retroshare-gui/src/gui/feeds/ChatMsgItem.ui
@@ -6,7 +6,7 @@
0
0
- 513
+ 543
213
@@ -193,7 +193,7 @@ border-radius: 10px}
0
- -
+
-
QFrame::StyledPanel
@@ -306,11 +306,21 @@ border-radius: 10px}
- -
+
-
Send
+
+ true
+
+
+
+ -
+
+
+ Cancel
+
diff --git a/retroshare-gui/src/gui/feeds/PeerItem.cpp b/retroshare-gui/src/gui/feeds/PeerItem.cpp
index fc6060aa6..b9e0cb251 100644
--- a/retroshare-gui/src/gui/feeds/PeerItem.cpp
+++ b/retroshare-gui/src/gui/feeds/PeerItem.cpp
@@ -47,6 +47,7 @@ PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, std::string peerId, uint
setupUi(this);
messageframe->setVisible(false);
+ sendmsgButton->setEnabled(false);
/* general ones */
connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
@@ -57,6 +58,8 @@ PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, std::string peerId, uint
connect( msgButton, SIGNAL( clicked( void ) ), this, SLOT( sendMsg ( void ) ) );
connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
+ connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
+
connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
@@ -378,3 +381,14 @@ void PeerItem::sendMessage()
messageframe->setVisible(false);
}
+void PeerItem::on_quickmsgText_textChanged()
+{
+ if (quickmsgText->toPlainText().isEmpty())
+ {
+ sendmsgButton->setEnabled(false);
+ }
+ else
+ {
+ sendmsgButton->setEnabled(true);
+ }
+}
diff --git a/retroshare-gui/src/gui/feeds/PeerItem.h b/retroshare-gui/src/gui/feeds/PeerItem.h
index e94e01457..551659fec 100644
--- a/retroshare-gui/src/gui/feeds/PeerItem.h
+++ b/retroshare-gui/src/gui/feeds/PeerItem.h
@@ -62,6 +62,9 @@ private slots:
void togglequickmessage();
void sendMessage();
+
+ void on_quickmsgText_textChanged();
+
private:
FeedHolder *mParent;
diff --git a/retroshare-gui/src/gui/feeds/PeerItem.ui b/retroshare-gui/src/gui/feeds/PeerItem.ui
index 25ecd1d6d..0b684bab5 100644
--- a/retroshare-gui/src/gui/feeds/PeerItem.ui
+++ b/retroshare-gui/src/gui/feeds/PeerItem.ui
@@ -6,8 +6,8 @@
0
0
- 589
- 370
+ 632
+ 354
@@ -37,244 +37,262 @@ border-radius: 10px}
QFrame::Raised
-
- -
-
-
-
-
-
-
- 70
- 70
-
-
-
-
- 70
- 70
-
-
-
- QLabel#avatar_label{border: 2px solid green;
+
+
+ 0
+
+
-
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+ 0
+
+
-
+
+
-
+
+
+
+ 70
+ 70
+
+
+
+
+ 70
+ 70
+
+
+
+ QLabel#avatar_label{border: 2px solid green;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #BDDF7D, stop: 1 #49881F);
}
-
-
-
-
-
- 0
-
-
-
- -
-
-
-
-
-
- Peer Name
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 75
- true
- true
-
-
-
- Connected
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
-
-
+
+
+
+
+
+ 0
+
+
+
+ -
+
+
+
+
+
+ Peer Name
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 75
+ true
+ true
+
+
+
+ Connected
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
+
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 190
+ 13
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 75
+ true
+
+
+
+ TextLabel
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Expand
+
+
+
+
+
+
+ :/images/edit_add24.png:/images/edit_add24.png
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Remove Item
+
+
+
+
+
+
+ :/images/close_normal.png:/images/close_normal.png
+
+
+
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Preferred
+
+
+
+ 388
+ 21
+
+
+
+
+ -
+
+
+ Write a quick Message
+
+
+
+ :/images/message-mail.png:/images/message-mail.png
+
+
+ Qt::ToolButtonTextBesideIcon
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Send Mail
+
+
+ Write Message
+
+
+
+ :/images/mail_send.png:/images/mail_send.png
+
+
+ Qt::ToolButtonTextBesideIcon
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Chat
+
+
+ Start Chat
+
+
+
+ :/images/chat.png:/images/chat.png
+
+
+ Qt::ToolButtonTextBesideIcon
+
+
+ true
+
+
+
+
+
+
+
- -
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 190
- 13
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 75
- true
-
-
-
- TextLabel
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Expand
-
-
-
-
-
-
- :/images/edit_add24.png:/images/edit_add24.png
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Remove Item
-
-
-
-
-
-
- :/images/close_normal.png:/images/close_normal.png
-
-
-
-
-
- -
-
-
-
-
-
- Qt::Horizontal
-
-
- QSizePolicy::Preferred
-
-
-
- 388
- 21
-
-
-
-
- -
-
-
- Write a quick Message
-
-
-
- :/images/message-mail.png:/images/message-mail.png
-
-
- Qt::ToolButtonTextBesideIcon
-
-
- true
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Send Mail
-
-
- Write Message
-
-
-
- :/images/mail_send.png:/images/mail_send.png
-
-
- Qt::ToolButtonTextBesideIcon
-
-
- true
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Chat
-
-
- Start Chat
-
-
-
- :/images/chat.png:/images/chat.png
-
-
- Qt::ToolButtonTextBesideIcon
-
-
- true
-
-
-
-
-
- -
+
-
@@ -295,7 +313,7 @@ border-radius: 10px}
0
-
-
+
-
-
@@ -311,17 +329,30 @@ border-radius: 10px}
- -
+
-
Send
+
+ false
+
+
+ true
+
+
+
+ -
+
+
+ Cancel
+
- -
+
-
QFrame::StyledPanel
@@ -536,8 +567,8 @@ p, li { white-space: pre-wrap; }
- 20
- 40
+ 578
+ 78
@@ -548,19 +579,6 @@ p, li { white-space: pre-wrap; }
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-