Merge pull request #1455 from defnax/master

*Improved Display of Moderator selection box on a useable place
*Restored back changes from circles & profile gen dialog
This commit is contained in:
defnax 2019-01-09 23:41:09 +01:00 committed by GitHub
commit 993f1e8ada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 206 additions and 121 deletions

View File

@ -149,6 +149,7 @@ private:
QTreeWidgetItem *ownItem;
QTreeWidgetItem *mExternalBelongingCircleItem;
QTreeWidgetItem *mExternalOtherCircleItem;
QTreeWidgetItem *mMyCircleItem;
RsGxsUpdateBroadcastBase *mCirclesBroadcastBase ;
std::map<uint32_t, CircleUpdateOrder> mCircleUpdates ;

View File

@ -24,6 +24,7 @@
#include "util/DateTime.h"
#include "GxsGroupDialog.h"
#include "gui/common/PeerDefs.h"
#include "gui/RetroShareLink.h"
#include "retroshare/rsgxsflags.h"
#include <algorithm>
@ -35,6 +36,7 @@
#include <iostream>
// Control of Publish Signatures.
//
// These are now defined in rsgxsflags.h
@ -99,6 +101,8 @@ void GxsGroupDialog::init()
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(cancelDialog()));
connect(ui.pubKeyShare_cb, SIGNAL(clicked()), this, SLOT(setShareList()));
connect(ui.addAdmins_cb, SIGNAL(clicked()), this, SLOT(setAdminsList()));
connect(ui.filtercomboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(filterComboBoxChanged(int)));
connect(ui.groupLogo, SIGNAL(clicked() ), this , SLOT(addGroupLogo()));
connect(ui.addLogoButton, SIGNAL(clicked() ), this , SLOT(addGroupLogo()));
@ -119,8 +123,14 @@ void GxsGroupDialog::init()
if (!ui.addAdmins_cb->isChecked())
{
ui.adminsList->hide();
ui.filtercomboBox->hide();
//this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height());
}
/* Add filter types */
ui.filtercomboBox->addItem(tr("All People"));
ui.filtercomboBox->addItem(tr("My Contacts"));
ui.filtercomboBox->setCurrentIndex(0);
/* initialize key share list */
ui.shareKeyList->setHeaderText(tr("Contacts:"));
@ -132,6 +142,7 @@ void GxsGroupDialog::init()
ui.adminsList->setModus(FriendSelectionWidget::MODUS_CHECK);
ui.adminsList->setShowType(FriendSelectionWidget::SHOW_GXS);
ui.adminsList->start();
/* Setup Reasonable Defaults */
@ -442,6 +453,8 @@ void GxsGroupDialog::updateFromExistingMeta(const QString &description)
setupReadonly();
clearForm();
setGroupSignFlags(mGrpMeta.mSignFlags) ;
RetroShareLink link;
/* setup name */
ui.groupName->setText(QString::fromUtf8(mGrpMeta.mGroupName.c_str()));
@ -455,6 +468,10 @@ void GxsGroupDialog::updateFromExistingMeta(const QString &description)
else
ui.lastpostline->setText(DateTime::formatLongDateTime(mGrpMeta.mLastPost));
ui.authorLabel->setId(mGrpMeta.mAuthorId);
link = RetroShareLink::createMessage(mGrpMeta.mAuthorId, "");
ui.authorLabel->setText(link.toHtml());
ui.IDline->setText(QString::fromStdString(mGrpMeta.mGroupId.toStdString()));
ui.descriptiontextEdit->setPlainText(description);
@ -869,6 +886,7 @@ void GxsGroupDialog::setSelectedModerators(const std::set<RsGxsId>& ids)
QString moderatorsListString ;
RsIdentityDetails det;
RetroShareLink link;
for(auto it(ids.begin());it!=ids.end();++it)
{
@ -877,9 +895,15 @@ void GxsGroupDialog::setSelectedModerators(const std::set<RsGxsId>& ids)
if(!moderatorsListString.isNull())
moderatorsListString += ", " ;
moderatorsListString += det.mNickname.empty()?("[Unknown]"):QString::fromStdString(det.mNickname) ;
}
if(det.mNickname.empty())
moderatorsListString += "[Unknown]";
link = RetroShareLink::createMessage(det.mId, "");
if (link.valid())
moderatorsListString += link.toHtml() + " ";
}
//ui.moderatorsLabel->setId(det.mId);
ui.moderatorsLabel->setText(moderatorsListString);
}
@ -898,10 +922,12 @@ void GxsGroupDialog::setAdminsList()
{
//this->resize(this->size().width() + ui.contactsdockWidget->size().width(), this->size().height());
ui.adminsList->show();
ui.filtercomboBox->show();
}
else
{ // hide share widget
ui.adminsList->hide();
ui.filtercomboBox->hide();
//this->resize(this->size().width() - ui.contactsdockWidget->size().width(), this->size().height());
}
}
@ -921,6 +947,21 @@ void GxsGroupDialog::setShareList()
// }
}
void GxsGroupDialog::filterComboBoxChanged(int i)
{
switch(i)
{
default:
case 0:
ui.adminsList->setShowType(FriendSelectionWidget::SHOW_GXS);
break;
case 1:
ui.adminsList->setShowType(FriendSelectionWidget::SHOW_CONTACTS);
break;
}
}
/***********************************************************************************
Loading Group.
***********************************************************************************/

View File

@ -163,6 +163,7 @@ private:
protected slots:
void submitGroup();
void addGroupLogo();
void filterComboBoxChanged(int);
protected:
virtual void showEvent(QShowEvent*);

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1237</width>
<height>1206</height>
<width>600</width>
<height>736</height>
</rect>
</property>
<property name="windowTitle">
@ -48,7 +48,10 @@
</property>
<widget class="QWidget" name="createmode">
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
<property name="topMargin">
<number>0</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBoxLogo">
<property name="title">
<string/>
@ -187,6 +190,10 @@
<property name="text">
<string>Add moderators</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/settings/permissions.svg</normaloff>:/icons/settings/permissions.svg</iconset>
</property>
</widget>
</item>
<item>
@ -349,7 +356,20 @@
</layout>
</widget>
</item>
<item row="4" column="0">
<item row="1" column="1" rowspan="3">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QComboBox" name="filtercomboBox"/>
</item>
<item>
<widget class="FriendSelectionWidget" name="adminsList" native="true"/>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="FriendSelectionWidget" name="shareKeyList" native="true"/>
</item>
<item row="3" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Description</string>
@ -361,7 +381,7 @@
</layout>
</widget>
</item>
<item row="5" column="0">
<item row="4" column="0" colspan="2">
<widget class="QGroupBox" name="publishGroupBox">
<property name="title">
<string>Publish Signatures</string>
@ -399,7 +419,7 @@
<item>
<widget class="QRadioButton" name="publish_required">
<property name="text">
<string>Re&amp;quired</string>
<string>Required</string>
</property>
</widget>
</item>
@ -426,7 +446,7 @@
</layout>
</widget>
</item>
<item row="6" column="0">
<item row="5" column="0" colspan="2">
<widget class="QGroupBox" name="personalGroupBox">
<property name="title">
<string>Personal Signatures</string>
@ -469,7 +489,7 @@
</layout>
</widget>
</item>
<item row="7" column="0">
<item row="6" column="0" colspan="2">
<widget class="QGroupBox" name="commentGroupBox">
<property name="title">
<string>Comments</string>
@ -520,7 +540,7 @@
</layout>
</widget>
</item>
<item row="8" column="0">
<item row="7" column="0" colspan="2">
<widget class="QGroupBox" name="spamProtection_GB">
<property name="title">
<string>Spam-protection</string>
@ -571,7 +591,7 @@
</layout>
</widget>
</item>
<item row="9" column="0" colspan="2">
<item row="8" column="0" colspan="2">
<widget class="QFrame" name="extraFrame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
@ -581,16 +601,13 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="FriendSelectionWidget" name="adminsList" native="true"/>
</item>
<item row="3" column="0">
<widget class="FriendSelectionWidget" name="shareKeyList" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="showmode">
<layout class="QGridLayout" name="gridLayout_6">
<property name="topMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
@ -599,14 +616,111 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="9" column="0">
<item row="6" column="0">
<widget class="QLabel" name="distributionLabel">
<property name="text">
<string>Distribution:</string>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="GxsIdLabel" name="moderatorsLabel">
<property name="text">
<string>TextLabel</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Last Post</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Popularity</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="postsline">
<property name="text">
<string/>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="nameline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Posts</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Moderators:</string>
</property>
</widget>
</item>
<item row="7" column="2">
<item row="1" column="2">
<widget class="QLineEdit" name="popline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="lastpostline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>ID</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="commentsLabel">
<property name="text">
<string>Comments:</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="antiSpamLabel">
<property name="text">
<string>Anti Spam:</string>
</property>
</widget>
</item>
<item row="6" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="distributionValueLabel">
@ -627,132 +741,44 @@
</item>
</layout>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="postsline">
<property name="text">
<string/>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="popline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Posts</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="GxsIdLabel" name="authorLabel">
<property name="text">
<string>GxsIdLabel</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>ID</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="lastpostline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Author</string>
</property>
</widget>
</item>
<item row="8" column="2">
<item row="7" column="2">
<widget class="QLabel" name="antiSpamValueLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="5" column="2">
<item row="4" column="2">
<widget class="QLineEdit" name="IDline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="commentsLabel">
<property name="text">
<string>Comments:</string>
</property>
</widget>
</item>
<item row="6" column="2">
<item row="5" column="2">
<widget class="QLabel" name="commentsValueLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="distributionLabel">
<property name="text">
<string>Distribution:</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="antiSpamLabel">
<property name="text">
<string>Anti Spam:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Last Post</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Popularity</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="nameline">
<property name="readOnly">
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QLabel" name="moderatorsLabel">
<widget class="GxsIdLabel" name="authorLabel">
<property name="text">
<string>TextLabel</string>
<string>GxsIdLabel</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
@ -855,8 +881,8 @@
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc"/>
<include location="../icons.qrc"/>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -94,6 +94,22 @@ CreateChannelMsg QFrame#fileFrame {
background: white;
}
GxsCreateCommentDialog QTextEdit#commentTextEdit {
border: 2px solid #0099cc;
border-radius: 6px;
background: white;
}
GxsCreateCommentDialog QLabel#titleLabel {
font-size: 12px;
font-weight: 600;
color: black;
}
GxsCreateCommentDialog QLabel#replaytolabel {
font-weight: bold;
color: gray;
}
/* Forums */
@ -351,13 +367,13 @@ ChanNewItem QLabel#logoLabel {
border-radius: 2px;
}
GxsChannelPostItem > QFrame#frame[new=false] {
GxsChannelPostItem > QFrame#mainFrame[new=false] {
border: 3px solid #D3D3D3;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFFF, stop:1 #F2F2F2);
border-radius: 10px;
}
GxsChannelPostItem > QFrame#frame[new=true] {
GxsChannelPostItem > QFrame#mainFrame[new=true] {
border: 3px solid #82B9F4;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #F0F8FD, stop:0.8 #E6F2FD, stop: 0.81 #E6F2FD, stop: 1 #D2E7FD);
border-radius: 10px;