GH-1322 fix mod description ... button popping up multiple dialogs

This commit is contained in:
Petr Mrázek 2015-11-13 00:50:38 +01:00
parent 384c03c9c5
commit 11afc61426
2 changed files with 21 additions and 3 deletions

View File

@ -110,7 +110,22 @@ void MCModInfoFrame::setModDescription(QString text)
}
ui->label_ModDescription->setText(labeltext);
}
void MCModInfoFrame::modDescEllipsisHandler(const QString &link)
{
CustomMessageBox::selectable(this, tr(""), desc)->show();
if(!currentBox)
{
currentBox = CustomMessageBox::selectable(this, tr(""), desc);
connect(currentBox, &QMessageBox::finished, this, &MCModInfoFrame::boxClosed);
currentBox->show();
}
else
{
currentBox->setText(desc);
}
}
void MCModInfoFrame::boxClosed(int result)
{
currentBox = nullptr;
}

View File

@ -39,8 +39,11 @@ public:
public slots:
void modDescEllipsisHandler(const QString& link );
void boxClosed(int result);
private:
Ui::MCModInfoFrame *ui;
QString desc;
class QMessageBox * currentBox = nullptr;
};