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:
thunder2 2012-02-05 14:56:27 +00:00
parent 549fdf9daa
commit 3b1c26de35
7 changed files with 107 additions and 80 deletions

View File

@ -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);

View File

@ -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()

View File

@ -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()";

View File

@ -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
{ {

View File

@ -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
@ -70,7 +67,6 @@ ForumMsgItem::ForumMsgItem(FeedHolder *parent, uint32_t feedId, const std::strin
signedcheckBox->hide(); signedcheckBox->hide();
} }
void ForumMsgItem::updateItemStatic() void ForumMsgItem::updateItemStatic()
{ {
if (!rsForums) if (!rsForums)
@ -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();
@ -266,6 +259,27 @@ void ForumMsgItem::toggle()
{ {
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
{ {
@ -279,7 +293,6 @@ void ForumMsgItem::toggle()
} }
} }
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()

View File

@ -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>

View File

@ -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()