summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-11-13 00:50:38 +0100
committerPetr Mrázek <peterix@gmail.com>2015-11-13 00:50:38 +0100
commit11afc61426ff648260b54b1982bec2cb3011c3c7 (patch)
tree6d72b9e286cc574b02253e8395aac31f398a64f7 /application
parent384c03c9c536ee805d08f0f83a046a2d5c7e6d62 (diff)
downloadMultiMC-11afc61426ff648260b54b1982bec2cb3011c3c7.tar
MultiMC-11afc61426ff648260b54b1982bec2cb3011c3c7.tar.gz
MultiMC-11afc61426ff648260b54b1982bec2cb3011c3c7.tar.lz
MultiMC-11afc61426ff648260b54b1982bec2cb3011c3c7.tar.xz
MultiMC-11afc61426ff648260b54b1982bec2cb3011c3c7.zip
GH-1322 fix mod description ... button popping up multiple dialogs
Diffstat (limited to 'application')
-rw-r--r--application/widgets/MCModInfoFrame.cpp17
-rw-r--r--application/widgets/MCModInfoFrame.h7
2 files changed, 21 insertions, 3 deletions
diff --git a/application/widgets/MCModInfoFrame.cpp b/application/widgets/MCModInfoFrame.cpp
index 0ec1376d..cdf35be8 100644
--- a/application/widgets/MCModInfoFrame.cpp
+++ b/application/widgets/MCModInfoFrame.cpp
@@ -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;
}
diff --git a/application/widgets/MCModInfoFrame.h b/application/widgets/MCModInfoFrame.h
index 3f75279c..d29a32bd 100644
--- a/application/widgets/MCModInfoFrame.h
+++ b/application/widgets/MCModInfoFrame.h
@@ -38,9 +38,12 @@ public:
void clear();
public slots:
- void modDescEllipsisHandler(const QString& link );
+ void modDescEllipsisHandler(const QString& link );
+ void boxClosed(int result);
private:
Ui::MCModInfoFrame *ui;
- QString desc;
+ QString desc;
+ class QMessageBox * currentBox = nullptr;
};
+