improved display in GxsGroupDialog

This commit is contained in:
csoler 2022-03-29 22:02:56 +02:00
parent 2b4e571332
commit 065e6946c7
4 changed files with 85 additions and 72 deletions

View File

@ -410,11 +410,8 @@ void GxsGroupDialog::setupReadonly()
{ {
ui.publishGroupBox->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_PUBLISHSIGN)); ui.publishGroupBox->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_PUBLISHSIGN));
ui.pubKeyShare_cb->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_SHAREKEYS)); ui.pubKeyShare_cb->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_SHAREKEYS));
ui.personalGroupBox->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_PERSONALSIGN)); ui.personalGroupBox->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_PERSONALSIGN));
ui.idChooser->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_PERSONALSIGN)); ui.idChooser->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_PERSONALSIGN));
//ui.distribGroupBox_2->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_DISTRIBUTION)); //ui.distribGroupBox_2->setEnabled(!(mReadonlyFlags & GXS_GROUP_FLAGS_DISTRIBUTION));
@ -470,6 +467,8 @@ void GxsGroupDialog::updateFromExistingMeta(const QString &description)
ui.createdline->setText(DateTime::formatLongDateTime(mGrpMeta.mPublishTs)); ui.createdline->setText(DateTime::formatLongDateTime(mGrpMeta.mPublishTs));
link = RetroShareLink::createMessage(mGrpMeta.mAuthorId, ""); link = RetroShareLink::createMessage(mGrpMeta.mAuthorId, "");
if(!mGrpMeta.mAuthorId.isNull())
ui.authorValueLabel->setText(link.toHtml()); ui.authorValueLabel->setText(link.toHtml());
ui.IDline->setText(QString::fromStdString(mGrpMeta.mGroupId.toStdString())); ui.IDline->setText(QString::fromStdString(mGrpMeta.mGroupId.toStdString()));
@ -721,15 +720,15 @@ uint32_t GxsGroupDialog::getGroupSignFlags()
void GxsGroupDialog::setGroupSignFlags(uint32_t signFlags) void GxsGroupDialog::setGroupSignFlags(uint32_t signFlags)
{ {
if (signFlags & GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_ENCRYPTED) { if (signFlags & GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_ENCRYPTED)
ui.publish_encrypt->setChecked(true); ui.publish_encrypt->setChecked(true);
} else if (signFlags & GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_ALLSIGNED) { else if (signFlags & GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_ALLSIGNED)
ui.publish_required->setChecked(true); ui.publish_required->setChecked(true);
} else if (signFlags & GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_THREADHEAD) { else if (signFlags & GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_THREADHEAD)
ui.publish_threads->setChecked(true); ui.publish_threads->setChecked(true);
} else if (signFlags & GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_NONEREQ) { else if (signFlags & GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_NONEREQ)
ui.publish_open->setChecked(true); ui.publish_open->setChecked(true);
}
if (signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_REQUIRED) if (signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_REQUIRED)
ui.personal_required->setChecked(true); ui.personal_required->setChecked(true);
@ -747,8 +746,10 @@ void GxsGroupDialog::setGroupSignFlags(uint32_t signFlags)
QString antispam_string ; QString antispam_string ;
if(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES) antispam_string += tr("Message tracking") ; if(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES) antispam_string += tr("Message tracking") ;
if(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG_KNOWN) antispam_string += (antispam_string.isNull()?"":" and ")+tr("PGP signature from known ID required") ; if(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG_KNOWN) antispam_string += (antispam_string.isNull()?"":" and ")+tr("PGP signature from known ID required") ;
else else if(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG) antispam_string += (antispam_string.isNull()?"":" and ")+tr("PGP signature required") ;
if(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG) antispam_string += (antispam_string.isNull()?"":" and ")+tr("PGP signature required") ;
if(antispam_string.isNull())
antispam_string = tr("[None]");
ui.antiSpamValueLabel->setText(antispam_string) ; ui.antiSpamValueLabel->setText(antispam_string) ;
//ui.antiSpam_trackMessages_2->setChecked((bool)(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES) ); //ui.antiSpam_trackMessages_2->setChecked((bool)(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES) );
@ -915,7 +916,10 @@ void GxsGroupDialog::setSelectedModerators(const std::set<RsGxsId>& ids)
moderatorsListString += link.toHtml() + " "; moderatorsListString += link.toHtml() + " ";
} }
//ui.moderatorsValueLabel->setId(det.mId);
if(moderatorsListString.isNull())
moderatorsListString = tr("[None]");
ui.moderatorsValueLabel->setText(moderatorsListString); ui.moderatorsValueLabel->setText(moderatorsListString);
} }

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>701</width> <width>746</width>
<height>529</height> <height>590</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -44,7 +44,7 @@
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="createmode"> <widget class="QWidget" name="createmode">
<layout class="QGridLayout" name="createmode_GL"> <layout class="QGridLayout" name="createmode_GL">
@ -575,7 +575,7 @@
<item row="10" column="0"> <item row="10" column="0">
<widget class="QLabel" name="authorLabel"> <widget class="QLabel" name="authorLabel">
<property name="text"> <property name="text">
<string>Author</string> <string>Author:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -739,7 +739,11 @@
</widget> </widget>
</item> </item>
<item row="4" column="2"> <item row="4" column="2">
<widget class="QLineEdit" name="createdline"/> <widget class="QLineEdit" name="createdline">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="createdlineLabel"> <widget class="QLabel" name="createdlineLabel">
@ -820,6 +824,16 @@
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>GxsIdLabel</class>
<extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
<customwidget>
<class>RSComboBox</class>
<extends>QComboBox</extends>
<header>gui/common/RSComboBox.h</header>
</customwidget>
<customwidget> <customwidget>
<class>ClickableLabel</class> <class>ClickableLabel</class>
<extends>QLabel</extends> <extends>QLabel</extends>
@ -846,11 +860,6 @@
<extends>QComboBox</extends> <extends>QComboBox</extends>
<header>gui/gxs/GxsIdChooser.h</header> <header>gui/gxs/GxsIdChooser.h</header>
</customwidget> </customwidget>
<customwidget>
<class>GxsIdLabel</class>
<extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
<customwidget> <customwidget>
<class>HeaderFrame</class> <class>HeaderFrame</class>
<extends>QFrame</extends> <extends>QFrame</extends>
@ -862,11 +871,6 @@
<extends>QTextEdit</extends> <extends>QTextEdit</extends>
<header location="global">gui/common/MimeTextEdit.h</header> <header location="global">gui/common/MimeTextEdit.h</header>
</customwidget> </customwidget>
<customwidget>
<class>RSComboBox</class>
<extends>QComboBox</extends>
<header>gui/common/RSComboBox.h</header>
</customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../icons.qrc"/> <include location="../icons.qrc"/>

View File

@ -1073,10 +1073,12 @@ bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, QLi
QString GxsIdDetails::getName(const RsIdentityDetails &details) QString GxsIdDetails::getName(const RsIdentityDetails &details)
{ {
if( details.mReputation.mOverallReputationLevel == if( details.mReputation.mOverallReputationLevel == RsReputationLevel::LOCALLY_NEGATIVE )
RsReputationLevel::LOCALLY_NEGATIVE )
return tr("[Banned]"); return tr("[Banned]");
if( details.mId.isNull() )
return tr("[Nobody]");
QString name = QString::fromUtf8(details.mNickname.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE); QString name = QString::fromUtf8(details.mNickname.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE);
std::list<RsRecognTag>::const_iterator it; std::list<RsRecognTag>::const_iterator it;

View File

@ -60,6 +60,9 @@ void GxsIdLabel::setId(const RsGxsId &id)
{ {
mId = id; mId = id;
if(id.isNull())
setText(tr("[Nobody]"));
else
GxsIdDetails::process(mId, fillLabelCallback, this); GxsIdDetails::process(mId, fillLabelCallback, this);
} }