mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 06:02:41 -04:00
Added Cancel Buttons for Chat and Peer feed Items, and disable the Send Buttons by default, added for PeerItem to check if TextEdit is empty or not too.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3462 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a66816ff33
commit
87d2cec44c
5 changed files with 308 additions and 257 deletions
|
@ -50,6 +50,8 @@ ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId
|
||||||
|
|
||||||
messageframe->setVisible(false);
|
messageframe->setVisible(false);
|
||||||
sendButton->hide();
|
sendButton->hide();
|
||||||
|
cancelButton->hide();
|
||||||
|
sendButton->setEnabled(false);
|
||||||
|
|
||||||
/* general ones */
|
/* general ones */
|
||||||
connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) );
|
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( chatButton, SIGNAL( clicked( void ) ), this, SLOT( openChat ( void ) ) );
|
||||||
connect( msgButton, SIGNAL( clicked( void ) ), this, SLOT( sendMsg ( void ) ) );
|
connect( msgButton, SIGNAL( clicked( void ) ), this, SLOT( sendMsg ( void ) ) );
|
||||||
connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
|
connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
|
||||||
|
connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
|
||||||
connect( sendButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
|
connect( sendButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
|
||||||
|
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
|
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
|
||||||
|
@ -251,11 +254,13 @@ void ChatMsgItem::togglequickmessage()
|
||||||
{
|
{
|
||||||
messageframe->setVisible(true);
|
messageframe->setVisible(true);
|
||||||
sendButton->show();
|
sendButton->show();
|
||||||
|
cancelButton->show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
messageframe->setVisible(false);
|
messageframe->setVisible(false);
|
||||||
sendButton->hide();
|
sendButton->hide();
|
||||||
|
cancelButton->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -274,6 +279,7 @@ void ChatMsgItem::sendMessage()
|
||||||
quickmsgText->clear();
|
quickmsgText->clear();
|
||||||
messageframe->setVisible(false);
|
messageframe->setVisible(false);
|
||||||
sendButton->hide();
|
sendButton->hide();
|
||||||
|
cancelButton->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatMsgItem::on_quickmsgText_textChanged()
|
void ChatMsgItem::on_quickmsgText_textChanged()
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>513</width>
|
<width>543</width>
|
||||||
<height>213</height>
|
<height>213</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -193,7 +193,7 @@ border-radius: 10px}</string>
|
||||||
<property name="margin">
|
<property name="margin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" colspan="5">
|
<item row="0" column="0" colspan="6">
|
||||||
<widget class="QFrame" name="messageframe">
|
<widget class="QFrame" name="messageframe">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
@ -306,11 +306,21 @@ border-radius: 10px}</string>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="4">
|
<item row="1" column="5">
|
||||||
<widget class="QPushButton" name="sendButton">
|
<widget class="QPushButton" name="sendButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Send</string>
|
<string>Send</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="default">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="4">
|
||||||
|
<widget class="QPushButton" name="cancelButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Cancel</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -47,6 +47,7 @@ PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, std::string peerId, uint
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
messageframe->setVisible(false);
|
messageframe->setVisible(false);
|
||||||
|
sendmsgButton->setEnabled(false);
|
||||||
|
|
||||||
/* general ones */
|
/* general ones */
|
||||||
connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
|
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( msgButton, SIGNAL( clicked( void ) ), this, SLOT( sendMsg ( void ) ) );
|
||||||
|
|
||||||
connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
|
connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
|
||||||
|
connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
|
||||||
|
|
||||||
connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
|
connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
|
||||||
|
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
|
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
|
||||||
|
@ -378,3 +381,14 @@ void PeerItem::sendMessage()
|
||||||
messageframe->setVisible(false);
|
messageframe->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PeerItem::on_quickmsgText_textChanged()
|
||||||
|
{
|
||||||
|
if (quickmsgText->toPlainText().isEmpty())
|
||||||
|
{
|
||||||
|
sendmsgButton->setEnabled(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sendmsgButton->setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -63,6 +63,9 @@ private slots:
|
||||||
void togglequickmessage();
|
void togglequickmessage();
|
||||||
void sendMessage();
|
void sendMessage();
|
||||||
|
|
||||||
|
void on_quickmsgText_textChanged();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FeedHolder *mParent;
|
FeedHolder *mParent;
|
||||||
uint32_t mFeedId;
|
uint32_t mFeedId;
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>589</width>
|
<width>632</width>
|
||||||
<height>370</height>
|
<height>354</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -31,6 +31,18 @@
|
||||||
stop: 0 #BDDF7D, stop: 1 #649C35);
|
stop: 0 #BDDF7D, stop: 1 #649C35);
|
||||||
border-radius: 10px}</string>
|
border-radius: 10px}</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
|
<property name="verticalSpacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QFrame" name="frame_2">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
</property>
|
</property>
|
||||||
|
@ -38,6 +50,9 @@ border-radius: 10px}</string>
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item row="0" column="0" rowspan="2">
|
<item row="0" column="0" rowspan="2">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0" rowspan="2">
|
<item row="0" column="0" rowspan="2">
|
||||||
|
@ -274,7 +289,10 @@ border-radius: 10px}</string>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
<widget class="QFrame" name="messageframe">
|
<widget class="QFrame" name="messageframe">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
|
@ -295,7 +313,7 @@ border-radius: 10px}</string>
|
||||||
<property name="margin">
|
<property name="margin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="3">
|
||||||
<widget class="QTextEdit" name="quickmsgText"/>
|
<widget class="QTextEdit" name="quickmsgText"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
|
@ -311,17 +329,30 @@ border-radius: 10px}</string>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="2">
|
||||||
<widget class="QPushButton" name="sendmsgButton">
|
<widget class="QPushButton" name="sendmsgButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Send</string>
|
<string>Send</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="autoDefault">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="default">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QPushButton" name="cancelButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Cancel</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item row="2" column="0">
|
||||||
<widget class="QFrame" name="expandFrame">
|
<widget class="QFrame" name="expandFrame">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
@ -536,8 +567,8 @@ p, li { white-space: pre-wrap; }
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>578</width>
|
||||||
<height>40</height>
|
<height>78</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
|
@ -548,19 +579,6 @@ p, li { white-space: pre-wrap; }
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
|
||||||
<spacer name="verticalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue