diff --git a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp index 490b6dd19..ddacd4895 100644 --- a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp +++ b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp @@ -50,7 +50,7 @@ PostedCreatePostDialog::PostedCreatePostDialog(TokenQueue* tokenQ, RsPosted *pos connect(ui->submitButton, SIGNAL(clicked()), this, SLOT(createPost())); connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close())); - connect(ui->pushButton, SIGNAL(clicked() ), this , SLOT(addPicture())); + connect(ui->addPicButton, SIGNAL(clicked() ), this , SLOT(addPicture())); ui->headerFrame->setHeaderImage(QPixmap(":/icons/png/postedlinks.png")); ui->headerFrame->setHeaderText(tr("Create a new Post")); @@ -169,7 +169,7 @@ void PostedCreatePostDialog::fileHashingFinished(QList hashedFiles) ui->linkEdit->setText(link.toString()); } ui->submitButton->setEnabled(true); - ui->pushButton->setEnabled(true); + ui->addPicButton->setEnabled(true); } void PostedCreatePostDialog::addPicture() @@ -192,6 +192,8 @@ void PostedCreatePostDialog::addPicture() QImage opt; if(ImageUtil::optimizeSizeBytes(imagebytes, image, opt, 640*480, MAXMESSAGESIZE - 2000)) { //Leave space for other stuff ui->imageLabel->setPixmap(QPixmap::fromImage(opt)); + ui->stackedWidgetPicture->setCurrentIndex(1); + ui->removeButton->show(); } else { imagefilename = ""; imagebytes.clear(); @@ -211,13 +213,13 @@ void PostedCreatePostDialog::addPicture() //If still yes then link it if(answer == QMessageBox::Yes) { ui->submitButton->setEnabled(false); - ui->pushButton->setEnabled(false); + ui->addPicButton->setEnabled(false); QStringList files; files.append(imagefilename); ui->hashBox->addAttachments(files,RS_FILE_REQ_ANONYMOUS_ROUTING); } - ui->removeButton->show(); + } void PostedCreatePostDialog::on_postButton_clicked() @@ -242,4 +244,5 @@ void PostedCreatePostDialog::on_removeButton_clicked() QPixmap empty; ui->imageLabel->setPixmap(empty); ui->removeButton->hide(); + ui->stackedWidgetPicture->setCurrentIndex(0); } diff --git a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.ui b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.ui index a4ecfbb6c..50abd48a2 100644 --- a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.ui +++ b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.ui @@ -7,7 +7,7 @@ 0 0 575 - 529 + 518 @@ -77,19 +77,44 @@ 0 + + 0 + 0 0 - + + + + + 0 + 0 + + + + true + + + + Preview - - + + + 0 + + + 0 + + + 0 + + Qt::Horizontal @@ -102,29 +127,7 @@ - - - - - 250 - 200 - - - - - 800 - 200 - - - - - - - true - - - - + Qt::Horizontal @@ -137,82 +140,168 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Remove image - - - - :/images/trashcan.png:/images/trashcan.png - - - - 24 - 24 - - - - true + + + + 0 + + + + + + 9 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Add Picture + + + + :/icons/png/add-image.png:/icons/png/add-image.png + + + + 24 + 24 + + + + + + + + Post size is limited to 32 KB, pictures will be downscaled. + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 267 + 138 + + + + + + + + + + 2 + + + 2 + + + 0 + + + 2 + + + + + + 800 + 200 + + + + + + + true + + + + + + + Qt::Horizontal + + + + 188 + 17 + + + + + + + + Remove image + + + + :/images/trashcan.png:/images/trashcan.png + + + + 24 + 24 + + + + true + + + + + - - - - Qt::Horizontal - - - - 447 - 20 - - - - - - - - Post size is limited to 32 KB, pictures will be downscaled. - - - - - - - Add Picture - - - - - - - - 0 - 0 - - - - true - - - @@ -536,6 +625,7 @@ +