mirror of
				https://github.com/RetroShare/RetroShare.git
				synced 2025-10-31 14:49:14 -04:00 
			
		
		
		
	Show forum description as post text when no thread is selected.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6480 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
		
							parent
							
								
									c1dddadb91
								
							
						
					
					
						commit
						393e799e5f
					
				
					 4 changed files with 66 additions and 2 deletions
				
			
		|  | @ -1111,7 +1111,7 @@ QString ForumsDialog::messageFromInfo(ForumMsgInfo &msgInfo) | |||
| 
 | ||||
| void ForumsDialog::insertPost() | ||||
| { | ||||
|     if ((mCurrForumId == "") || (mCurrThreadId == "")) | ||||
|     if (mCurrForumId.empty()) | ||||
|     { | ||||
|         ui.postText->setText(""); | ||||
|         ui.threadTitle->setText(""); | ||||
|  | @ -1121,6 +1121,23 @@ void ForumsDialog::insertPost() | |||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     if (mCurrThreadId.empty()) | ||||
|     { | ||||
|         ui.previousButton->setEnabled(false); | ||||
|         ui.nextButton->setEnabled(false); | ||||
|         ui.newmessageButton->setEnabled (false); | ||||
| 
 | ||||
|         ForumInfo fi; | ||||
|         if (!rsForums->getForumInfo(mCurrForumId, fi)) { | ||||
|             ui.postText->setText(""); | ||||
|             ui.threadTitle->setText(""); | ||||
|             return; | ||||
|         } | ||||
|         ui.threadTitle->setText(tr("Forum Description")); | ||||
|         ui.postText->setText(QString::fromStdWString(fi.forumDesc)); | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     QTreeWidgetItem *curr = ui.threadTreeWidget->currentItem(); | ||||
|     if (curr) { | ||||
|         QTreeWidgetItem *Parent = curr->parent (); | ||||
|  |  | |||
|  | @ -903,6 +903,7 @@ void GxsForumThreadWidget::insertThreads() | |||
| 	} | ||||
| 
 | ||||
| 	mSubscribeFlags = 0; | ||||
| 	mForumDescription.clear(); | ||||
| 
 | ||||
| 	ui->newmessageButton->setEnabled(false); | ||||
| 	ui->newthreadButton->setEnabled(false); | ||||
|  | @ -938,6 +939,7 @@ void GxsForumThreadWidget::insertForumThreads(const RsGroupMetaData &fi) | |||
| { | ||||
| 	mSubscribeFlags = fi.mSubscribeFlags; | ||||
| 	ui->forumName->setText(QString::fromUtf8(fi.mGroupName.c_str())); | ||||
| //	mForumDescription = QString::fromUtf8(fi.mDescription); // not available
 | ||||
| 
 | ||||
| 	ui->progressBarLayout->setEnabled(true); | ||||
| 
 | ||||
|  | @ -1156,7 +1158,7 @@ void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidget | |||
| 
 | ||||
| void GxsForumThreadWidget::insertPost() | ||||
| { | ||||
| 	if (mForumId.empty() || mThreadId.empty()) | ||||
| 	if (mForumId.empty()) | ||||
| 	{ | ||||
| 		ui->postText->setText(""); | ||||
| 		ui->threadTitle->setText(""); | ||||
|  | @ -1166,6 +1168,17 @@ void GxsForumThreadWidget::insertPost() | |||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	if (mThreadId.empty()) | ||||
| 	{ | ||||
| 		ui->previousButton->setEnabled(false); | ||||
| 		ui->nextButton->setEnabled(false); | ||||
| 		ui->newmessageButton->setEnabled (false); | ||||
| 
 | ||||
| 		ui->threadTitle->setText(tr("Forum Description")); | ||||
| 		ui->postText->setText(mForumDescription); | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); | ||||
| 	if (item) { | ||||
| 		QTreeWidgetItem *parentItem = item->parent(); | ||||
|  |  | |||
|  | @ -137,6 +137,7 @@ private: | |||
| 	std::string mForumId; | ||||
| 	std::string mLastForumID; | ||||
| 	std::string mThreadId; | ||||
| 	QString mForumDescription; | ||||
| 	int mSubscribeFlags; | ||||
| 	bool mInProcessSettings; | ||||
| 	bool mInMsgAsReadUnread; | ||||
|  |  | |||
|  | @ -4969,6 +4969,10 @@ p, li { white-space: pre-wrap; } | |||
|         <source>You can't reply an Anonymous Author</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <source>Forum Description</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
| </context> | ||||
| <context> | ||||
|     <name>ForumsFillThread</name> | ||||
|  | @ -5207,6 +5211,18 @@ p, li { white-space: pre-wrap; } | |||
|         <source>Sort by</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <source>IP</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <source>Sort by IP</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <source>Show IP Column</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
| </context> | ||||
| <context> | ||||
|     <name>FriendRecommendDialog</name> | ||||
|  | @ -6767,6 +6783,10 @@ before you can comment</source> | |||
|         <source>You cant reply to an Anonymous Author</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <source>Forum Description</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
| </context> | ||||
| <context> | ||||
|     <name>GxsForumsDialog</name> | ||||
|  | @ -12761,6 +12781,19 @@ Try to be patient!</source> | |||
|         <source>Please enter a new--and valid--filename</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <source>Last Time Seen</source> | ||||
|         <comment>i.e: Last Time Receiced Data</comment> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <source>UserID</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
|     <message> | ||||
|         <source>File Never Seen</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
| </context> | ||||
| <context> | ||||
|     <name>TreeStyle_RDM</name> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 thunder2
						thunder2