Removed redundant title inputbox

This commit is contained in:
hunbernd 2019-12-29 14:19:19 +01:00
parent 0dcaa90820
commit 419a9a520c
2 changed files with 41 additions and 48 deletions

View File

@ -90,14 +90,7 @@ void PostedCreatePostDialog::createPost()
post.mNotes = std::string(text.toUtf8());
post.mMeta.mAuthorId = authorId;
if(!ui->titleEdit->text().isEmpty())
{
post.mMeta.mMsgName = std::string(ui->titleEdit->text().toUtf8());
}else
{
post.mMeta.mMsgName = std::string(ui->titleEditLink->text().toUtf8());
}
post.mMeta.mMsgName = std::string(ui->titleEdit->text().toUtf8());
QByteArray ba;
QBuffer buffer(&ba);
@ -111,7 +104,7 @@ void PostedCreatePostDialog::createPost()
post.mImage.copy((uint8_t *) ba.data(), ba.size());
}
if(ui->titleEdit->text().isEmpty()&& ui->titleEditLink->text().isEmpty()) {
if(ui->titleEdit->text().isEmpty()) {
/* error message */
QMessageBox::warning(this, "RetroShare", tr("Please add a Title"), QMessageBox::Ok, QMessageBox::Ok);
return; //Don't add a empty title!!

View File

@ -128,6 +128,22 @@
</property>
</widget>
</item>
<item row="5" column="0">
<spacer name="buttonHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
@ -199,7 +215,7 @@
</item>
</layout>
</item>
<item row="3" column="0" colspan="3">
<item row="4" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="signedLabel">
@ -226,23 +242,7 @@
</item>
</layout>
</item>
<item row="4" column="0">
<spacer name="buttonHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="2">
<item row="5" column="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -258,7 +258,7 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<item row="3" column="0" colspan="3">
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>0</number>
@ -277,16 +277,9 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="1" column="0">
<item row="2" column="0">
<widget class="RichTextEdit" name="RichTextEditWidget" native="true"/>
</item>
<item row="0" column="0">
<widget class="QLineEdit" name="titleEdit">
<property name="placeholderText">
<string>Title</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="stackedWidgetPage2">
@ -397,14 +390,14 @@
<property name="rightMargin">
<number>0</number>
</property>
<item row="1" column="0">
<item row="0" column="0">
<widget class="QLineEdit" name="linkEdit">
<property name="placeholderText">
<string>Url</string>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -417,18 +410,11 @@
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLineEdit" name="titleEditLink">
<property name="placeholderText">
<string>Title</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="QPushButton" name="submitButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -444,6 +430,22 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QLineEdit" name="titleEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="placeholderText">
<string>Title</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -475,8 +477,6 @@
</customwidgets>
<resources>
<include location="Posted_images.qrc"/>
<include location="../images.qrc"/>
<include location="../icons.qrc"/>
</resources>
<connections>
<connection>