mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-19 11:54:22 -04:00
Fix QMessageBox layout addWidget.
This commit is contained in:
parent
f3d1a6c1ec
commit
21bd8cd6df
2 changed files with 20 additions and 3 deletions
|
@ -1076,11 +1076,21 @@ void ChatLobbyWidget::readChatLobbyInvites()
|
||||||
tr("%1 invites you to chat lobby named %2").arg(QString::fromUtf8(rsPeers->getPeerName((*it).peer_id).c_str())).arg(RsHtml::plainText(it->lobby_name)),
|
tr("%1 invites you to chat lobby named %2").arg(QString::fromUtf8(rsPeers->getPeerName((*it).peer_id).c_str())).arg(RsHtml::plainText(it->lobby_name)),
|
||||||
QMessageBox::Question, QMessageBox::Yes,QMessageBox::No, 0);
|
QMessageBox::Question, QMessageBox::Yes,QMessageBox::No, 0);
|
||||||
|
|
||||||
|
|
||||||
|
QLabel *label = new QLabel(tr("Choose an identity for this lobby:"));
|
||||||
GxsIdChooser *idchooser = new GxsIdChooser ;
|
GxsIdChooser *idchooser = new GxsIdChooser ;
|
||||||
idchooser->loadIds(IDCHOOSER_ID_REQUIRED,default_id) ;
|
idchooser->loadIds(IDCHOOSER_ID_REQUIRED,default_id) ;
|
||||||
|
|
||||||
mb.layout()->addWidget(new QLabel(tr("Choose an identity for this lobby:"))) ;
|
|
||||||
|
QGridLayout* layout = qobject_cast<QGridLayout*>(mb.layout());
|
||||||
|
if (layout) {
|
||||||
|
layout->addWidget(label, layout->rowCount(), 0, 1, layout->columnCount(), Qt::AlignHCenter ) ;
|
||||||
|
layout->addWidget(idchooser, layout->rowCount(), 0, 1, layout->columnCount(), Qt::AlignRight ) ;
|
||||||
|
} else {
|
||||||
|
//Not QGridLayout so add at end
|
||||||
|
mb.layout()->addWidget(label) ;
|
||||||
mb.layout()->addWidget(idchooser) ;
|
mb.layout()->addWidget(idchooser) ;
|
||||||
|
}
|
||||||
|
|
||||||
int res = mb.exec() ;
|
int res = mb.exec() ;
|
||||||
|
|
||||||
|
|
|
@ -1410,7 +1410,14 @@ void MainWindow::externalLinkActivated(const QUrl &url)
|
||||||
QMessageBox mb(QObject::tr("Confirmation"), QObject::tr("Do you want this link to be handled by your system?")+"<br/><br/>"+ url.toString()+"<br/><br/>"+tr("Make sure this link has not been forged to drag you to a malicious website."), QMessageBox::Question, QMessageBox::Yes,QMessageBox::No, 0);
|
QMessageBox mb(QObject::tr("Confirmation"), QObject::tr("Do you want this link to be handled by your system?")+"<br/><br/>"+ url.toString()+"<br/><br/>"+tr("Make sure this link has not been forged to drag you to a malicious website."), QMessageBox::Question, QMessageBox::Yes,QMessageBox::No, 0);
|
||||||
|
|
||||||
QCheckBox *checkbox = new QCheckBox(tr("Don't ask me again")) ;
|
QCheckBox *checkbox = new QCheckBox(tr("Don't ask me again")) ;
|
||||||
|
QGridLayout* layout = qobject_cast<QGridLayout*>(mb.layout());
|
||||||
|
if (layout)
|
||||||
|
{
|
||||||
|
layout->addWidget(checkbox,layout->rowCount(),0,1, layout->columnCount(), Qt::AlignLeft);
|
||||||
|
} else {
|
||||||
|
//Not QGridLayout so add at end
|
||||||
mb.layout()->addWidget(checkbox) ;
|
mb.layout()->addWidget(checkbox) ;
|
||||||
|
}
|
||||||
|
|
||||||
int res = mb.exec() ;
|
int res = mb.exec() ;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue