Improving Posted Links, changed some strings, added a info label, not allow blank posts without a title.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7005 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2014-01-10 18:41:08 +00:00
parent 4a87f5d73b
commit 97cd659679
8 changed files with 150 additions and 23 deletions

View File

@ -37,11 +37,11 @@ PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *pos
{
ui->setupUi(this);
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(createPost()));
connect(ui->submitButton, SIGNAL(clicked()), this, SLOT(createPost()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
ui->headerFrame->setHeaderImage(QPixmap(":/images/posted_64.png"));
ui->headerFrame->setHeaderText(tr("Create Post"));
ui->headerFrame->setHeaderText(tr("Submit a new Post"));
/* fill in the available OwnIds for signing */
ui->idChooser->loadIds(IDCHOOSER_ID_REQUIRED, "");
@ -72,6 +72,12 @@ void PostedCreatePostDialog::createPost()
post.mMeta.mMsgName = std::string(ui->titleEdit->text().toUtf8());
post.mMeta.mAuthorId = authorId;
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!!
}
uint32_t token;
mPosted->createPost(token, post);
mTokenQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, TOKEN_USER_TYPE_POST);

View File

@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>593</width>
<width>575</width>
<height>371</height>
</rect>
</property>
<property name="windowTitle">
<string>Create Post</string>
<string>Submit Post</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="margin">
@ -39,7 +39,93 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="info_label">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>246</red>
<green>230</green>
<blue>159</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>246</red>
<green>230</green>
<blue>159</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>246</red>
<green>230</green>
<blue>159</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>246</red>
<green>230</green>
<blue>159</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>11</pointsize>
</font>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string>You are submitting a link. The key to a successful submission is interesting content and a descriptive title.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QLineEdit" name="titleEdit"/>
@ -71,7 +157,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="1" column="0">
<item row="2" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="spacer_2">
@ -101,7 +187,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="2" column="0">
<item row="3" column="0" colspan="3">
<layout class="QVBoxLayout" name="notesLayout">
<item>
<widget class="QLabel" name="notesLabel">
@ -115,13 +201,39 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="3" column="0">
<item row="4" column="0">
<spacer name="horizontalSpacer">
<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">
<widget class="QPushButton" name="submitButton">
<property name="text">
<string>Submit</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Cancel</set>
</property>
</widget>
</item>

View File

@ -88,10 +88,10 @@ void PostedItem::setContent(const RsPostedPost &post)
dateLabel->setText(timestamp);
fromLabel->setId(post.mMeta.mAuthorId);
titleLabel->setText("<a href=" + QString::fromStdString(post.mLink) +
"><span style=\" text-decoration: underline; color:#0000ff;\">" +
"><span style=\" text-decoration: underline; color:#2255AA;\">" +
QString::fromStdString(post.mMeta.mMsgName) + "</span></a>");
siteLabel->setText("<a href=" + QString::fromStdString(post.mLink) +
"><span style=\" text-decoration: underline; color:#0000ff;\">" +
"><span style=\" text-decoration: underline; color:#2255AA;\">" +
QString::fromStdString(post.mLink) + "</span></a>");
//QString score = "Hot" + QString::number(post.mHotScore);

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>754</width>
<height>129</height>
<width>667</width>
<height>119</height>
</rect>
</property>
<property name="font">
@ -108,7 +108,7 @@ border-radius: 10px}</string>
<item row="0" column="1" colspan="8">
<widget class="QLabel" name="titleLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -157,7 +157,7 @@ border-radius: 10px}</string>
</font>
</property>
<property name="text">
<string>Date</string>
<string>Submitted</string>
</property>
</widget>
</item>

View File

@ -72,7 +72,7 @@ PostedListDialog::PostedListDialog(QWidget *parent)
connect(ui.nextButton, SIGNAL(clicked()), this, SLOT(showNext()));
connect(ui.prevButton, SIGNAL(clicked()), this, SLOT(showPrev()));
connect( ui.pushButton, SIGNAL(clicked()), this, SLOT(todo()));
connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(todo()));
// default sort method.
mSortMethod = RsPosted::HotRankType;
@ -179,7 +179,7 @@ void PostedListDialog::groupListCustomPopupMenu(QPoint /*point*/)
//bool isPublisher = IS_GROUP_PUBLISHER(subscribeFlags);
bool isSubscribed = IS_GROUP_SUBSCRIBED(subscribeFlags);
QAction *action = contextMnu.addAction(QIcon(IMAGE_MESSAGE), tr("Create Post"), this, SLOT(newPost()));
QAction *action = contextMnu.addAction(QIcon(IMAGE_MESSAGE), tr("Submit a new Post"), this, SLOT(newPost()));
action->setEnabled(isSubscribed);
action = contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Subscribe"), this, SLOT(subscribeTopic()));
action->setEnabled(!isSubscribed);
@ -1002,8 +1002,8 @@ void PostedListDialog::todo()
{
QMessageBox::information(this, "Todo",
"<b>Open points:</b><ul>"
"<li>Subreddits/tags support"
"<li>Edit Groups"
"<li>Subreddits/tag to posts support"
"<li>Edit Topics"
"<li>Picture Support"
"</ul>");
}

View File

@ -79,6 +79,8 @@ private slots:
void showNext();
void showPrev();
void todo();
protected:
virtual void updateDisplay(bool complete);
@ -131,7 +133,6 @@ private:
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
void todo();
private:
QTreeWidgetItem *yourTopics;

View File

@ -59,7 +59,7 @@
<item>
<widget class="QPushButton" name="submitPostButton">
<property name="text">
<string>Create Post</string>
<string>Submit a new Post</string>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
@ -263,7 +263,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>710</width>
<width>711</width>
<height>16</height>
</rect>
</property>

View File

@ -540,3 +540,11 @@ MessageWidget QFrame#decryptFrame {
background: #CCFFCC;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #CCFFCC, stop:1 #AAFFAA);
}
/* Posted Links */
PostedCreatePostDialog QLabel#info_label {
border: 1px solid #DCDC41;
border-radius: 6px;
background: #FFFFD7;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
}