mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
* Fixing the Post buttons to get disabled when the limit has been exceeded
This commit is contained in:
parent
30956f8de5
commit
11d3583233
@ -56,8 +56,9 @@ PostedCreatePostDialog::PostedCreatePostDialog(RsPosted *posted, const RsGxsGrou
|
||||
connect(ui->submitButton, SIGNAL(clicked()), this, SLOT(createPost()));
|
||||
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
||||
connect(ui->addPicButton, SIGNAL(clicked() ), this , SLOT(addPicture()));
|
||||
|
||||
ui->headerFrame->setHeaderImage(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/postedlinks.png"));
|
||||
connect(ui->RichTextEditWidget, SIGNAL(textSizeOk(bool)),ui->submitButton, SLOT(setEnabled(bool)));
|
||||
|
||||
ui->headerFrame->setHeaderImage(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/postedlinks.png"));
|
||||
ui->headerFrame->setHeaderText(tr("Create a new Post"));
|
||||
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
|
@ -58,10 +58,12 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
|
||||
|
||||
headerFrame->setHeaderImage(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/channel.png"));
|
||||
|
||||
if(!existing_post.isNull())
|
||||
if(!existing_post.isNull()){
|
||||
headerFrame->setHeaderText(tr("Edit Channel Post"));
|
||||
else
|
||||
postButton->setText(tr("Update"));
|
||||
}else{
|
||||
headerFrame->setHeaderText(tr("New Channel Post"));
|
||||
}
|
||||
|
||||
setAttribute ( Qt::WA_DeleteOnClose, true );
|
||||
|
||||
@ -77,6 +79,7 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
|
||||
connect(stackedWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenu(QPoint)));
|
||||
connect(generateCheckBox, SIGNAL(toggled(bool)), generateSpinBox, SLOT(setEnabled(bool)));
|
||||
connect(aspectRatio_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(changeAspectRatio(int)));
|
||||
connect(RichTextEditWidget, SIGNAL(textSizeOk(bool)),postButton, SLOT(setEnabled(bool)));
|
||||
|
||||
channelpostButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/comment.png"));
|
||||
attachmentsButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/attachements.png"));
|
||||
|
@ -187,7 +187,8 @@ ShareManager QPushButton#addButton:hover {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#postButton:disabled {
|
||||
CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled,
|
||||
CreateGxsChannelMsg QPushButton#postButton:disabled {
|
||||
font: bold;
|
||||
font-size: 15px;
|
||||
color: white;
|
||||
|
@ -2109,7 +2109,8 @@ GxsCreateCommentDialog QPushButton#postButton:hover, , GxsGroupDialog QPushButto
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
CreateGxsForumMsg QPushButton#postButton:disabled {
|
||||
CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled,
|
||||
CreateGxsChannelMsg QPushButton#postButton:disabled {
|
||||
font: bold;
|
||||
font-size: 15px;
|
||||
color: white;
|
||||
|
@ -1262,7 +1262,8 @@ ShareManager QPushButton#closeButton {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
CreateGxsForumMsg QPushButton#postButton:disabled {
|
||||
CreateGxsForumMsg QPushButton#postButton:disabled, PostedCreatePostDialog QPushButton#submitButton:disabled,
|
||||
CreateGxsChannelMsg QPushButton#postButton:disabled {
|
||||
font: bold;
|
||||
font-size: 15px;
|
||||
color: white;
|
||||
|
@ -602,15 +602,15 @@ void RichTextEdit::checkLength(){
|
||||
if(charRemains >= 0) {
|
||||
text = tr("It remains %1 characters after HTML conversion.").arg(charRemains);
|
||||
f_info->setStyleSheet("QLabel#f_info { }");
|
||||
emit textSizeOk(true);
|
||||
}else{
|
||||
text = tr("Warning: This message is too big of %1 characters after HTML conversion.").arg((0-charRemains));
|
||||
f_info->setStyleSheet("QLabel#f_info {color: red; font: bold; }");
|
||||
f_info->setStyleSheet("QLabel#f_info {color: red; font: bold; }");
|
||||
emit textSizeOk(false);
|
||||
}
|
||||
//buttonBox->button(QDialogButtonBox::Ok)->setEnabled(charRemains>=0);
|
||||
f_info->setText(text);
|
||||
}
|
||||
|
||||
|
||||
void RichTextEdit::setPlaceHolderTextPosted() {
|
||||
f_textedit->setPlaceholderText(tr("Text (optional)"));
|
||||
}
|
||||
|
@ -38,11 +38,13 @@ class RichTextEdit : public QWidget, protected Ui::RichTextEdit {
|
||||
QTextCursor textCursor() const { return f_textedit->textCursor(); }
|
||||
void setTextCursor(const QTextCursor& cursor) { f_textedit->setTextCursor(cursor); }
|
||||
|
||||
signals:
|
||||
void textSizeOk(bool);
|
||||
|
||||
public slots:
|
||||
void setText(const QString &text);
|
||||
void setPlaceHolderTextPosted();
|
||||
|
||||
|
||||
protected slots:
|
||||
void setPlainText(const QString &text) { f_textedit->setPlainText(text); }
|
||||
void setHtml(const QString &text) { f_textedit->setHtml(text); }
|
||||
|
Loading…
Reference in New Issue
Block a user