mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 07:16:11 -05:00
Merge pull request #15 from defnax/small-fixes
Clear more fields when blank tree is selected
This commit is contained in:
commit
800a7499d8
@ -413,6 +413,12 @@ void GxsChannelPostsWidgetWithModel::showPostDetails()
|
|||||||
{
|
{
|
||||||
QModelIndex index = ui->postsTree->selectionModel()->currentIndex();
|
QModelIndex index = ui->postsTree->selectionModel()->currentIndex();
|
||||||
RsGxsChannelPost post = index.data(Qt::UserRole).value<RsGxsChannelPost>() ;
|
RsGxsChannelPost post = index.data(Qt::UserRole).value<RsGxsChannelPost>() ;
|
||||||
|
|
||||||
|
QTextDocument doc;
|
||||||
|
doc.setHtml(post.mMsg.c_str());
|
||||||
|
|
||||||
|
if(doc.toPlainText().trimmed().isEmpty())
|
||||||
|
ui->postDetails_TE->setPlaceholderText(tr("No message in this post"));
|
||||||
|
|
||||||
if(post.mMeta.mPublishTs == 0)
|
if(post.mMeta.mPublishTs == 0)
|
||||||
{
|
{
|
||||||
@ -545,7 +551,7 @@ void GxsChannelPostsWidgetWithModel::postChannelPostLoad()
|
|||||||
//ui->channelFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_FILE);
|
//ui->channelFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_FILE);
|
||||||
//ui->channelFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_SIZE);
|
//ui->channelFiles_TV->resizeColumnToContents(RsGxsChannelPostFilesModel::COLUMN_FILES_SIZE);
|
||||||
ui->channelFiles_TV->setAutoSelect(true);
|
ui->channelFiles_TV->setAutoSelect(true);
|
||||||
|
ui->postDetails_TE->setPlaceholderText(tr("No post selected"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1007,7 +1013,7 @@ void GxsChannelPostsWidgetWithModel::blank()
|
|||||||
{
|
{
|
||||||
ui->postButton->setEnabled(false);
|
ui->postButton->setEnabled(false);
|
||||||
ui->subscribeToolButton->setEnabled(false);
|
ui->subscribeToolButton->setEnabled(false);
|
||||||
|
|
||||||
ui->channelName_LB->setText(tr("No Channel Selected"));
|
ui->channelName_LB->setText(tr("No Channel Selected"));
|
||||||
ui->logoLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/channels.png"));
|
ui->logoLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/channels.png"));
|
||||||
ui->infoPosts->setText("");
|
ui->infoPosts->setText("");
|
||||||
@ -1018,6 +1024,12 @@ void GxsChannelPostsWidgetWithModel::blank()
|
|||||||
ui->infoDescription->setText("");
|
ui->infoDescription->setText("");
|
||||||
|
|
||||||
mChannelPostsModel->clear();
|
mChannelPostsModel->clear();
|
||||||
|
mChannelPostFilesModel->clear();
|
||||||
|
ui->postDetails_TE->clear();
|
||||||
|
ui->postDetails_TE->setPlaceholderText(tr("No post selected"));
|
||||||
|
ui->postLogo_LB->hide();
|
||||||
|
ui->postName_LB->hide();
|
||||||
|
ui->postTime_LB->hide();
|
||||||
groupNameChanged(QString());
|
groupNameChanged(QString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -199,19 +199,6 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="3" column="1" colspan="2">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Distribution:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="3">
|
<item row="1" column="3">
|
||||||
<widget class="QLabel" name="infoLastPost">
|
<widget class="QLabel" name="infoLastPost">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -219,19 +206,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="4">
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1" colspan="2">
|
<item row="4" column="1" colspan="2">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@ -245,11 +219,27 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="3">
|
<item row="2" column="3">
|
||||||
<widget class="QLabel" name="infoDistribution">
|
<widget class="GxsIdLabel" name="infoAdministrator">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>unknown</string>
|
<string>unknown</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1" colspan="2">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Distribution:</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="3">
|
<item row="0" column="3">
|
||||||
@ -259,14 +249,30 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="3">
|
<item row="1" column="1" colspan="2">
|
||||||
<widget class="GxsIdLabel" name="infoAdministrator">
|
<widget class="QLabel" name="infoLastPostLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Last Post:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="3">
|
||||||
|
<widget class="QLabel" name="infoDistribution">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>unknown</string>
|
<string>unknown</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="openExternalLinks">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1" colspan="2">
|
<item row="2" column="1" colspan="2">
|
||||||
@ -292,7 +298,7 @@
|
|||||||
<item row="0" column="1" colspan="2">
|
<item row="0" column="1" colspan="2">
|
||||||
<widget class="QLabel" name="infoPostsLabel">
|
<widget class="QLabel" name="infoPostsLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -308,27 +314,21 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1" colspan="2">
|
|
||||||
<widget class="QLabel" name="infoLastPostLabel">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Last Post:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user