Restore ScrollMessageBox

Signed-off-by: kumquat-ir <66188216+kumquat-ir@users.noreply.github.com>
This commit is contained in:
kumquat-ir 2022-07-17 02:40:27 -04:00
parent 33e34ebb83
commit 6a1d611fd1
4 changed files with 122 additions and 0 deletions

View File

@ -834,6 +834,8 @@ SET(LAUNCHER_SOURCES
ui/dialogs/SkinUploadDialog.h
ui/dialogs/ModDownloadDialog.cpp
ui/dialogs/ModDownloadDialog.h
ui/dialogs/ScrollMessageBox.cpp
ui/dialogs/ScrollMessageBox.h
ui/dialogs/BlockedModsDialog.cpp
ui/dialogs/BlockedModsDialog.h
@ -940,6 +942,7 @@ qt_wrap_ui(LAUNCHER_UI
ui/dialogs/LoginDialog.ui
ui/dialogs/EditAccountDialog.ui
ui/dialogs/ReviewMessageBox.ui
ui/dialogs/ScrollMessageBox.ui
ui/dialogs/BlockedModsDialog.ui
)

View File

@ -0,0 +1,15 @@
#include "ScrollMessageBox.h"
#include "ui_ScrollMessageBox.h"
ScrollMessageBox::ScrollMessageBox(QWidget *parent, const QString &title, const QString &text, const QString &body) :
QDialog(parent), ui(new Ui::ScrollMessageBox) {
ui->setupUi(this);
this->setWindowTitle(title);
ui->label->setText(text);
ui->textBrowser->setText(body);
}
ScrollMessageBox::~ScrollMessageBox() {
delete ui;
}

View File

@ -0,0 +1,20 @@
#pragma once
#include <QDialog>
QT_BEGIN_NAMESPACE
namespace Ui { class ScrollMessageBox; }
QT_END_NAMESPACE
class ScrollMessageBox : public QDialog {
Q_OBJECT
public:
ScrollMessageBox(QWidget *parent, const QString &title, const QString &text, const QString &body);
~ScrollMessageBox() override;
private:
Ui::ScrollMessageBox *ui;
};

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ScrollMessageBox</class>
<widget class="QDialog" name="ScrollMessageBox">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>455</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">ScrollMessageBox</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string notr="true"/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QTextBrowser" name="textBrowser">
<property name="acceptRichText">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ScrollMessageBox</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>199</x>
<y>425</y>
</hint>
<hint type="destinationlabel">
<x>199</x>
<y>227</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ScrollMessageBox</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>199</x>
<y>425</y>
</hint>
<hint type="destinationlabel">
<x>199</x>
<y>227</y>
</hint>
</hints>
</connection>
</connections>
</ui>