mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 17:09:34 -05:00
Set the focus the subject input when creating a new forum/channel or channel message.
Set the forum/channel message to read when expanding the message feed. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4891 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
549fdf9daa
commit
3b1c26de35
@ -742,6 +742,8 @@ void ForumsDialog::fillThreadFinished()
|
|||||||
#ifdef DEBUG_FORUMS
|
#ifdef DEBUG_FORUMS
|
||||||
std::cerr << "ForumsDialog::fillThreadFinished Add messages" << std::endl;
|
std::cerr << "ForumsDialog::fillThreadFinished Add messages" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
ui.threadTreeWidget->setSortingEnabled(false);
|
||||||
|
|
||||||
/* add all messages in! */
|
/* add all messages in! */
|
||||||
if (lastViewType != thread->viewType || lastForumID != mCurrForumId) {
|
if (lastViewType != thread->viewType || lastForumID != mCurrForumId) {
|
||||||
ui.threadTreeWidget->clear();
|
ui.threadTreeWidget->clear();
|
||||||
@ -758,6 +760,8 @@ void ForumsDialog::fillThreadFinished()
|
|||||||
CleanupItems (thread->items);
|
CleanupItems (thread->items);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui.threadTreeWidget->setSortingEnabled(true);
|
||||||
|
|
||||||
if (thread->focusMsgId.empty() == false) {
|
if (thread->focusMsgId.empty() == false) {
|
||||||
/* Search exisiting item */
|
/* Search exisiting item */
|
||||||
QTreeWidgetItemIterator itemIterator(ui.threadTreeWidget);
|
QTreeWidgetItemIterator itemIterator(ui.threadTreeWidget);
|
||||||
|
@ -82,6 +82,8 @@ void CreateChannel::newChannel()
|
|||||||
ui.msgAnon->setChecked(true);
|
ui.msgAnon->setChecked(true);
|
||||||
ui.msgAuth->setEnabled(false);
|
ui.msgAuth->setEnabled(false);
|
||||||
ui.msgGroupBox->hide();
|
ui.msgGroupBox->hide();
|
||||||
|
|
||||||
|
ui.channelName->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateChannel::createChannel()
|
void CreateChannel::createChannel()
|
||||||
|
@ -529,7 +529,6 @@ void CreateChannelMsg::cancelMsg()
|
|||||||
|
|
||||||
void CreateChannelMsg::newChannelMsg()
|
void CreateChannelMsg::newChannelMsg()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!rsChannels)
|
if (!rsChannels)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -541,9 +540,9 @@ void CreateChannelMsg::newChannelMsg()
|
|||||||
}
|
}
|
||||||
|
|
||||||
channelName->setText(QString::fromStdWString(ci.channelName));
|
channelName->setText(QString::fromStdWString(ci.channelName));
|
||||||
|
subjectEdit->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CreateChannelMsg::sendMsg()
|
void CreateChannelMsg::sendMsg()
|
||||||
{
|
{
|
||||||
std::cerr << "CreateChannelMsg::sendMsg()";
|
std::cerr << "CreateChannelMsg::sendMsg()";
|
||||||
|
@ -44,38 +44,38 @@ ChanMsgItem::ChanMsgItem(FeedHolder *parent, uint32_t feedId, const std::string
|
|||||||
:QWidget(NULL), mParent(parent), mFeedId(feedId),
|
:QWidget(NULL), mParent(parent), mFeedId(feedId),
|
||||||
mChanId(chanId), mMsgId(msgId), mIsHome(isHome)
|
mChanId(chanId), mMsgId(msgId), mIsHome(isHome)
|
||||||
{
|
{
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||||
|
|
||||||
m_inUpdateItemStatic = false;
|
m_inUpdateItemStatic = false;
|
||||||
|
|
||||||
/* general ones */
|
/* general ones */
|
||||||
connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
|
connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
|
||||||
connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) );
|
connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) );
|
||||||
|
|
||||||
/* specific */
|
/* specific */
|
||||||
connect( unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeChannel ( void ) ) );
|
connect( unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeChannel ( void ) ) );
|
||||||
connect( downloadButton, SIGNAL( clicked( void ) ), this, SLOT( download ( void ) ) );
|
connect( downloadButton, SIGNAL( clicked( void ) ), this, SLOT( download ( void ) ) );
|
||||||
connect( playButton, SIGNAL( clicked( void ) ), this, SLOT( play ( void ) ) );
|
connect( playButton, SIGNAL( clicked( void ) ), this, SLOT( play ( void ) ) );
|
||||||
connect( copyLinkButton, SIGNAL( clicked( void ) ), this, SLOT( copyLink ( void ) ) );
|
connect( copyLinkButton, SIGNAL( clicked( void ) ), this, SLOT( copyLink ( void ) ) );
|
||||||
|
|
||||||
connect( readButton, SIGNAL( toggled(bool) ), this, SLOT( readToggled(bool) ) );
|
connect( readButton, SIGNAL( toggled(bool) ), this, SLOT( readToggled(bool) ) );
|
||||||
connect( NotifyQt::getInstance(), SIGNAL(channelMsgReadSatusChanged(QString,QString,int)), this, SLOT(channelMsgReadSatusChanged(QString,QString,int)), Qt::QueuedConnection);
|
connect( NotifyQt::getInstance(), SIGNAL(channelMsgReadSatusChanged(QString,QString,int)), this, SLOT(channelMsgReadSatusChanged(QString,QString,int)), Qt::QueuedConnection);
|
||||||
|
|
||||||
downloadButton->hide();
|
downloadButton->hide();
|
||||||
playButton->hide();
|
playButton->hide();
|
||||||
warn_image_label->hide();
|
warn_image_label->hide();
|
||||||
warning_label->hide();
|
warning_label->hide();
|
||||||
|
|
||||||
titleLabel->setMinimumWidth(100);
|
titleLabel->setMinimumWidth(100);
|
||||||
subjectLabel->setMinimumWidth(100);
|
subjectLabel->setMinimumWidth(100);
|
||||||
warning_label->setMinimumWidth(100);
|
warning_label->setMinimumWidth(100);
|
||||||
|
|
||||||
small();
|
small();
|
||||||
updateItemStatic();
|
updateItemStatic();
|
||||||
updateItem();
|
updateItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChanMsgItem::updateItemStatic()
|
void ChanMsgItem::updateItemStatic()
|
||||||
@ -311,6 +311,10 @@ void ChanMsgItem::toggle()
|
|||||||
expandFrame->show();
|
expandFrame->show();
|
||||||
expandButton->setIcon(QIcon(QString(":/images/edit_remove24.png")));
|
expandButton->setIcon(QIcon(QString(":/images/edit_remove24.png")));
|
||||||
expandButton->setToolTip(tr("Hide"));
|
expandButton->setToolTip(tr("Hide"));
|
||||||
|
|
||||||
|
if (!mIsHome) {
|
||||||
|
readToggled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -374,27 +378,27 @@ void ChanMsgItem::play()
|
|||||||
|
|
||||||
void ChanMsgItem::readToggled(bool checked)
|
void ChanMsgItem::readToggled(bool checked)
|
||||||
{
|
{
|
||||||
if (m_inUpdateItemStatic) {
|
if (m_inUpdateItemStatic) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set always as read ... */
|
/* set always as read ... */
|
||||||
uint32_t statusNew = CHANNEL_MSG_STATUS_READ;
|
uint32_t statusNew = CHANNEL_MSG_STATUS_READ;
|
||||||
if (checked) {
|
if (checked) {
|
||||||
/* ... and as unread by user */
|
/* ... and as unread by user */
|
||||||
statusNew |= CHANNEL_MSG_STATUS_UNREAD_BY_USER;
|
statusNew |= CHANNEL_MSG_STATUS_UNREAD_BY_USER;
|
||||||
} else {
|
} else {
|
||||||
/* ... and as read by user */
|
/* ... and as read by user */
|
||||||
statusNew &= ~CHANNEL_MSG_STATUS_UNREAD_BY_USER;
|
statusNew &= ~CHANNEL_MSG_STATUS_UNREAD_BY_USER;
|
||||||
}
|
}
|
||||||
rsChannels->setMessageStatus(mChanId, mMsgId, statusNew, CHANNEL_MSG_STATUS_READ | CHANNEL_MSG_STATUS_UNREAD_BY_USER);
|
rsChannels->setMessageStatus(mChanId, mMsgId, statusNew, CHANNEL_MSG_STATUS_READ | CHANNEL_MSG_STATUS_UNREAD_BY_USER);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChanMsgItem::channelMsgReadSatusChanged(const QString& channelId, const QString& msgId, int /*status*/)
|
void ChanMsgItem::channelMsgReadSatusChanged(const QString& channelId, const QString& msgId, int /*status*/)
|
||||||
{
|
{
|
||||||
if (channelId.toStdString() == mChanId && msgId.toStdString() == mMsgId) {
|
if (channelId.toStdString() == mChanId && msgId.toStdString() == mMsgId) {
|
||||||
updateItemStatic();
|
updateItemStatic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChanMsgItem::copyLink()
|
void ChanMsgItem::copyLink()
|
||||||
|
@ -30,13 +30,10 @@
|
|||||||
#include <retroshare/rsmsgs.h>
|
#include <retroshare/rsmsgs.h>
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
|
|
||||||
#include "gui/notifyqt.h"
|
|
||||||
|
|
||||||
#include "gui/forums/CreateForumMsg.h"
|
#include "gui/forums/CreateForumMsg.h"
|
||||||
#include "gui/chat/HandleRichText.h"
|
#include "gui/chat/HandleRichText.h"
|
||||||
#include "gui/common/AvatarDefs.h"
|
#include "gui/common/AvatarDefs.h"
|
||||||
|
//#include "gui/settings/rsharesettings.h"
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
/****
|
/****
|
||||||
* #define DEBUG_ITEM 1
|
* #define DEBUG_ITEM 1
|
||||||
@ -46,31 +43,30 @@
|
|||||||
ForumMsgItem::ForumMsgItem(FeedHolder *parent, uint32_t feedId, const std::string &forumId, const std::string &postId, bool isHome)
|
ForumMsgItem::ForumMsgItem(FeedHolder *parent, uint32_t feedId, const std::string &forumId, const std::string &postId, bool isHome)
|
||||||
:QWidget(NULL), mParent(parent), mFeedId(feedId), mForumId(forumId), mPostId(postId), mIsHome(isHome), mIsTop(false)
|
:QWidget(NULL), mParent(parent), mFeedId(feedId), mForumId(forumId), mPostId(postId), mIsHome(isHome), mIsTop(false)
|
||||||
{
|
{
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||||
|
|
||||||
/* general ones */
|
/* general ones */
|
||||||
connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
|
connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
|
||||||
connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) );
|
connect( clearButton, SIGNAL( clicked( void ) ), this, SLOT( removeItem ( void ) ) );
|
||||||
|
|
||||||
/* specific ones */
|
/* specific ones */
|
||||||
connect( unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeForum ( void ) ) );
|
connect( unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeForum ( void ) ) );
|
||||||
connect( replyButton, SIGNAL( clicked( void ) ), this, SLOT( replyToPost ( void ) ) );
|
connect( replyButton, SIGNAL( clicked( void ) ), this, SLOT( replyToPost ( void ) ) );
|
||||||
connect( sendButton, SIGNAL( clicked( ) ), this, SLOT( sendMsg() ) );
|
connect( sendButton, SIGNAL( clicked( ) ), this, SLOT( sendMsg() ) );
|
||||||
|
|
||||||
subjectLabel->setMinimumWidth(20);
|
subjectLabel->setMinimumWidth(20);
|
||||||
|
|
||||||
small();
|
small();
|
||||||
updateItemStatic();
|
updateItemStatic();
|
||||||
updateItem();
|
updateItem();
|
||||||
textEdit->hide();
|
textEdit->hide();
|
||||||
sendButton->hide();
|
sendButton->hide();
|
||||||
signedcheckBox->hide();
|
signedcheckBox->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ForumMsgItem::updateItemStatic()
|
void ForumMsgItem::updateItemStatic()
|
||||||
{
|
{
|
||||||
if (!rsForums)
|
if (!rsForums)
|
||||||
@ -157,10 +153,10 @@ void ForumMsgItem::updateItemStatic()
|
|||||||
prevSubLabel->setText(link.toHtml());
|
prevSubLabel->setText(link.toHtml());
|
||||||
prevMsgLabel->setText(RsHtml::formatText(QString::fromStdWString(msg.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
prevMsgLabel->setText(RsHtml::formatText(QString::fromStdWString(msg.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
||||||
|
|
||||||
QDateTime qtime;
|
QDateTime qtime;
|
||||||
qtime.setTime_t(msg.ts);
|
qtime.setTime_t(msg.ts);
|
||||||
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
|
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
|
||||||
timestamplabel->setText(timestamp);
|
timestamplabel->setText(timestamp);
|
||||||
|
|
||||||
nextFrame->hide();
|
nextFrame->hide();
|
||||||
}
|
}
|
||||||
@ -183,9 +179,9 @@ void ForumMsgItem::updateItemStatic()
|
|||||||
nextMsgLabel->setText(RsHtml::formatText(QString::fromStdWString(msg.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
nextMsgLabel->setText(RsHtml::formatText(QString::fromStdWString(msg.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
||||||
|
|
||||||
QDateTime qtime;
|
QDateTime qtime;
|
||||||
qtime.setTime_t(msg.ts);
|
qtime.setTime_t(msg.ts);
|
||||||
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
|
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
|
||||||
timestamplabel->setText(timestamp);
|
timestamplabel->setText(timestamp);
|
||||||
|
|
||||||
prevSHLabel->setText(tr("In Reply to") + ": ");
|
prevSHLabel->setText(tr("In Reply to") + ": ");
|
||||||
|
|
||||||
@ -234,7 +230,6 @@ void ForumMsgItem::updateItemStatic()
|
|||||||
unsubscribeButton->hide();
|
unsubscribeButton->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ForumMsgItem::updateItem()
|
void ForumMsgItem::updateItem()
|
||||||
{
|
{
|
||||||
/* fill in */
|
/* fill in */
|
||||||
@ -242,10 +237,8 @@ void ForumMsgItem::updateItem()
|
|||||||
std::cerr << "ForumMsgItem::updateItem()";
|
std::cerr << "ForumMsgItem::updateItem()";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ForumMsgItem::small()
|
void ForumMsgItem::small()
|
||||||
{
|
{
|
||||||
nextFrame->hide();
|
nextFrame->hide();
|
||||||
@ -261,11 +254,32 @@ void ForumMsgItem::toggle()
|
|||||||
sendButton->setVisible(canReply);
|
sendButton->setVisible(canReply);
|
||||||
signedcheckBox->setVisible(canReply);
|
signedcheckBox->setVisible(canReply);
|
||||||
expandButton->setIcon(QIcon(QString(":/images/edit_remove24.png")));
|
expandButton->setIcon(QIcon(QString(":/images/edit_remove24.png")));
|
||||||
expandButton->setToolTip("Hide");
|
expandButton->setToolTip("Hide");
|
||||||
if (!mIsTop)
|
if (!mIsTop)
|
||||||
{
|
{
|
||||||
nextFrame->show();
|
nextFrame->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t status;
|
||||||
|
rsForums->getMessageStatus(mForumId, mPostId, status);
|
||||||
|
|
||||||
|
if (canReply) {
|
||||||
|
/* set always to read ... */
|
||||||
|
uint32_t statusNew = status | FORUM_MSG_STATUS_READ;
|
||||||
|
|
||||||
|
// bool setToReadOnActive = Settings->getForumMsgSetToReadOnActivate();
|
||||||
|
// if (setToReadOnActive) {
|
||||||
|
/* ... and to read by user */
|
||||||
|
statusNew &= ~FORUM_MSG_STATUS_UNREAD_BY_USER;
|
||||||
|
// } else {
|
||||||
|
// /* ... and to unread by user */
|
||||||
|
// statusNew |= FORUM_MSG_STATUS_UNREAD_BY_USER;
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (status != statusNew) {
|
||||||
|
rsForums->setMessageStatus(mForumId, mPostId, statusNew, FORUM_MSG_STATUS_READ | FORUM_MSG_STATUS_UNREAD_BY_USER);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -275,11 +289,10 @@ void ForumMsgItem::toggle()
|
|||||||
sendButton->hide();
|
sendButton->hide();
|
||||||
signedcheckBox->hide();
|
signedcheckBox->hide();
|
||||||
expandButton->setIcon(QIcon(QString(":/images/edit_add24.png")));
|
expandButton->setIcon(QIcon(QString(":/images/edit_add24.png")));
|
||||||
expandButton->setToolTip("Expand");
|
expandButton->setToolTip("Expand");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ForumMsgItem::removeItem()
|
void ForumMsgItem::removeItem()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_ITEM
|
#ifdef DEBUG_ITEM
|
||||||
@ -295,7 +308,6 @@ void ForumMsgItem::removeItem()
|
|||||||
|
|
||||||
/*********** SPECIFIC FUNCTIOSN ***********************/
|
/*********** SPECIFIC FUNCTIOSN ***********************/
|
||||||
|
|
||||||
|
|
||||||
void ForumMsgItem::unsubscribeForum()
|
void ForumMsgItem::unsubscribeForum()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_ITEM
|
#ifdef DEBUG_ITEM
|
||||||
@ -309,7 +321,6 @@ void ForumMsgItem::unsubscribeForum()
|
|||||||
updateItemStatic();
|
updateItemStatic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ForumMsgItem::subscribeForum()
|
void ForumMsgItem::subscribeForum()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_ITEM
|
#ifdef DEBUG_ITEM
|
||||||
@ -338,7 +349,6 @@ void ForumMsgItem::replyToPost()
|
|||||||
CreateForumMsg *cfm = new CreateForumMsg(mForumId, mPostId);
|
CreateForumMsg *cfm = new CreateForumMsg(mForumId, mPostId);
|
||||||
cfm->show();
|
cfm->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ForumMsgItem::sendMsg()
|
void ForumMsgItem::sendMsg()
|
||||||
|
@ -359,6 +359,9 @@ border-radius: 10px}</string>
|
|||||||
<property name="openExternalLinks">
|
<property name="openExternalLinks">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -520,6 +523,9 @@ border-radius: 10px}</string>
|
|||||||
<property name="openExternalLinks">
|
<property name="openExternalLinks">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -73,6 +73,8 @@ void CreateForum::newForum()
|
|||||||
|
|
||||||
ui.forumName->clear();
|
ui.forumName->clear();
|
||||||
ui.forumDesc->clear();
|
ui.forumDesc->clear();
|
||||||
|
|
||||||
|
ui.forumName->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateForum::createForum()
|
void CreateForum::createForum()
|
||||||
|
Loading…
Reference in New Issue
Block a user