mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-27 07:47:03 -05:00
improved layout
This commit is contained in:
parent
a38d5aba14
commit
e0cf9768fc
@ -49,6 +49,10 @@
|
|||||||
* #define DEBUG_CHANNEL
|
* #define DEBUG_CHANNEL
|
||||||
***/
|
***/
|
||||||
|
|
||||||
|
static const int mTokenTypeGroupData = 1;
|
||||||
|
static const int CHANNEL_TABS_DETAILS= 0;
|
||||||
|
static const int CHANNEL_TABS_POSTS = 1;
|
||||||
|
|
||||||
/* View mode */
|
/* View mode */
|
||||||
#define VIEW_MODE_FEEDS 1
|
#define VIEW_MODE_FEEDS 1
|
||||||
#define VIEW_MODE_FILES 2
|
#define VIEW_MODE_FILES 2
|
||||||
@ -255,9 +259,18 @@ void GxsChannelPostsWidgetWithModel::handleEvent_main_thread(std::shared_ptr<con
|
|||||||
|
|
||||||
void GxsChannelPostsWidgetWithModel::showPostDetails()
|
void GxsChannelPostsWidgetWithModel::showPostDetails()
|
||||||
{
|
{
|
||||||
QModelIndex selected_index = ui->postsTree->selectionModel()->currentIndex();
|
QModelIndex index = ui->postsTree->selectionModel()->currentIndex();
|
||||||
|
|
||||||
std::cerr << "Showing details about selected index : "<< selected_index.row() << "," << selected_index.column() << std::endl;
|
if(!index.isValid())
|
||||||
|
{
|
||||||
|
ui->postDetails_TE->clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
RsGxsChannelPost post = index.data(Qt::UserRole).value<RsGxsChannelPost>() ;
|
||||||
|
|
||||||
|
std::cerr << "Showing details about selected index : "<< index.row() << "," << index.column() << std::endl;
|
||||||
|
|
||||||
|
ui->postDetails_TE->setText(RsHtml().formatText(NULL, QString::fromUtf8(post.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsChannelPostsWidgetWithModel::updateGroupData()
|
void GxsChannelPostsWidgetWithModel::updateGroupData()
|
||||||
@ -285,6 +298,7 @@ void GxsChannelPostsWidgetWithModel::updateGroupData()
|
|||||||
{
|
{
|
||||||
mGroup = groups[0];
|
mGroup = groups[0];
|
||||||
mThreadModel->updateChannel(groupId());
|
mThreadModel->updateChannel(groupId());
|
||||||
|
insertChannelDetails(mGroup);
|
||||||
} );
|
} );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -427,19 +441,13 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
|
|||||||
} else {
|
} else {
|
||||||
chanImage = QPixmap(CHAN_DEFAULT_IMAGE);
|
chanImage = QPixmap(CHAN_DEFAULT_IMAGE);
|
||||||
}
|
}
|
||||||
//ui->logoLabel->setPixmap(chanImage);
|
ui->logoLabel->setPixmap(chanImage);
|
||||||
|
ui->logoLabel->setFixedSize(QSize(ui->logoLabel->height()*chanImage.width()/(float)chanImage.height(),ui->logoLabel->height())); // make the logo have the same aspect ratio than the original image
|
||||||
|
|
||||||
if (group.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH)
|
ui->postButton->setEnabled(bool(group.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH));
|
||||||
{
|
|
||||||
mStateHelper->setWidgetEnabled(ui->postButton, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mStateHelper->setWidgetEnabled(ui->postButton, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags));
|
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags));
|
||||||
mStateHelper->setWidgetEnabled(ui->subscribeToolButton, true);
|
ui->subscribeToolButton->setEnabled(true);
|
||||||
|
|
||||||
|
|
||||||
bool autoDownload ;
|
bool autoDownload ;
|
||||||
@ -448,19 +456,21 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
|
|||||||
|
|
||||||
RetroShareLink link;
|
RetroShareLink link;
|
||||||
|
|
||||||
if (IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags)) {
|
if (IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags))
|
||||||
ui->feedToolButton->setEnabled(true);
|
{
|
||||||
|
|
||||||
ui->fileToolButton->setEnabled(true);
|
|
||||||
//ui->infoWidget->hide();
|
|
||||||
setViewMode(viewMode());
|
|
||||||
|
|
||||||
ui->subscribeToolButton->setText(tr("Subscribed") + " " + QString::number(group.mMeta.mPop) );
|
ui->subscribeToolButton->setText(tr("Subscribed") + " " + QString::number(group.mMeta.mPop) );
|
||||||
|
ui->feedToolButton->setEnabled(true);
|
||||||
|
ui->fileToolButton->setEnabled(true);
|
||||||
|
ui->channel_TW->setTabEnabled(CHANNEL_TABS_POSTS,true);
|
||||||
|
ui->details_TW->setEnabled(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->details_TW->setEnabled(false);
|
||||||
|
ui->channel_TW->setTabEnabled(CHANNEL_TABS_POSTS,false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ui->infoPosts->clear();
|
|
||||||
ui->infoDescription->clear();
|
|
||||||
} else {
|
|
||||||
ui->infoPosts->setText(QString::number(group.mMeta.mVisibleMsgCount));
|
ui->infoPosts->setText(QString::number(group.mMeta.mVisibleMsgCount));
|
||||||
if(group.mMeta.mLastPost==0)
|
if(group.mMeta.mLastPost==0)
|
||||||
ui->infoLastPost->setText(tr("Never"));
|
ui->infoLastPost->setText(tr("Never"));
|
||||||
@ -524,8 +534,6 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
|
|||||||
ui->fileToolButton->setEnabled(false);
|
ui->fileToolButton->setEnabled(false);
|
||||||
|
|
||||||
ui->subscribeToolButton->setText(tr("Subscribe ") + " " + QString::number(group.mMeta.mPop) );
|
ui->subscribeToolButton->setText(tr("Subscribe ") + " " + QString::number(group.mMeta.mPop) );
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int GxsChannelPostsWidgetWithModel::viewMode()
|
int GxsChannelPostsWidgetWithModel::viewMode()
|
||||||
@ -870,8 +878,8 @@ void GxsChannelPostsWidget::clearPosts()
|
|||||||
|
|
||||||
void GxsChannelPostsWidgetWithModel::blank()
|
void GxsChannelPostsWidgetWithModel::blank()
|
||||||
{
|
{
|
||||||
//mStateHelper->setWidgetEnabled(ui->postButton, false);
|
mStateHelper->setWidgetEnabled(ui->postButton, false);
|
||||||
//mStateHelper->setWidgetEnabled(ui->subscribeToolButton, false);
|
mStateHelper->setWidgetEnabled(ui->subscribeToolButton, false);
|
||||||
|
|
||||||
mThreadModel->clear();
|
mThreadModel->clear();
|
||||||
groupNameChanged(QString());
|
groupNameChanged(QString());
|
||||||
|
@ -222,34 +222,109 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="channel_TW">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab_3">
|
<widget class="QWidget" name="tab_3">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Channel details</string>
|
<string>Channel details</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QLabel" name="logoLabel">
|
||||||
<property name="title">
|
<property name="text">
|
||||||
<string>Channel details</string>
|
<string>TextLabel</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="scaledContents">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="leftMargin">
|
<item row="2" column="3">
|
||||||
<number>9</number>
|
<widget class="GxsIdLabel" name="infoAdministrator">
|
||||||
|
<property name="text">
|
||||||
|
<string>unknown</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="openExternalLinks">
|
||||||
<number>9</number>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
</widget>
|
||||||
<number>9</number>
|
</item>
|
||||||
|
<item row="3" column="3">
|
||||||
|
<widget class="QLabel" name="infoDistribution">
|
||||||
|
<property name="text">
|
||||||
|
<string>unknown</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
</widget>
|
||||||
<number>9</number>
|
</item>
|
||||||
|
<item row="4" column="1" colspan="2">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="0">
|
<property name="text">
|
||||||
|
<string>Created:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="3">
|
||||||
|
<widget class="QLabel" name="infoCreated">
|
||||||
|
<property name="text">
|
||||||
|
<string>unknown</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="infoPostsLabel">
|
||||||
|
<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>Posts:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</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="0" column="3">
|
||||||
|
<widget class="QLabel" name="infoPosts">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">0</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1" colspan="2">
|
||||||
<widget class="QLabel" name="infoLastPostLabel">
|
<widget class="QLabel" name="infoLastPostLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
@ -268,7 +343,44 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0" colspan="3">
|
<item row="1" column="3">
|
||||||
|
<widget class="QLabel" name="infoLastPost">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">unknown</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1" colspan="2">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Administrator:</string>
|
||||||
|
</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>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QTextBrowser" name="infoDescription">
|
<widget class="QTextBrowser" name="infoDescription">
|
||||||
<property name="html">
|
<property name="html">
|
||||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
@ -288,126 +400,18 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QLabel" name="infoDescriptionLabel">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Description:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Created:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Administrator:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="infoPostsLabel">
|
|
||||||
<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>Posts:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<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="4" column="1" colspan="2">
|
|
||||||
<widget class="QLabel" name="infoCreated">
|
|
||||||
<property name="text">
|
|
||||||
<string>unknown</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1" colspan="2">
|
|
||||||
<widget class="QLabel" name="infoDistribution">
|
|
||||||
<property name="text">
|
|
||||||
<string>unknown</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1" colspan="2">
|
|
||||||
<widget class="GxsIdLabel" name="infoAdministrator">
|
|
||||||
<property name="text">
|
|
||||||
<string>unknown</string>
|
|
||||||
</property>
|
|
||||||
<property name="openExternalLinks">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" colspan="2">
|
|
||||||
<widget class="QLabel" name="infoLastPost">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">unknown</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" colspan="2">
|
|
||||||
<widget class="QLabel" name="infoPosts">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">0</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_4">
|
<widget class="QWidget" name="tab_4">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Posts</string>
|
<string>Posts</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
|
<widget class="QSplitter" name="splitter">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
<widget class="QTreeView" name="postsTree">
|
<widget class="QTreeView" name="postsTree">
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectItems</enum>
|
<enum>QAbstractItemView::SelectItems</enum>
|
||||||
@ -416,25 +420,29 @@ p, li { white-space: pre-wrap; }
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QTabWidget" name="details_TW">
|
<widget class="QTabWidget" name="details_TW">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Details</string>
|
<string>Details</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<widget class="QTextEdit" name="postDetails_TE">
|
||||||
<item>
|
<property name="geometry">
|
||||||
<widget class="QTextEdit" name="textEdit"/>
|
<rect>
|
||||||
</item>
|
<x>9</x>
|
||||||
</layout>
|
<y>9</y>
|
||||||
|
<width>955</width>
|
||||||
|
<height>181</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="tab_5">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Files</string>
|
||||||
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="tab_2">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -442,6 +450,11 @@ p, li { white-space: pre-wrap; }
|
|||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
<action name="actionFeeds">
|
<action name="actionFeeds">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user