Upgraded pack changelog
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
		| @@ -3,6 +3,9 @@ | |||||||
| // SPDX-License-Identifier: GPL-3.0-only | // SPDX-License-Identifier: GPL-3.0-only | ||||||
|  |  | ||||||
| #include "ManagedPackPage.h" | #include "ManagedPackPage.h" | ||||||
|  | #include <QDesktopServices> | ||||||
|  | #include <QUrl> | ||||||
|  | #include <QUrlQuery> | ||||||
| #include "ui_ManagedPackPage.h" | #include "ui_ManagedPackPage.h" | ||||||
|  |  | ||||||
| #include <QListView> | #include <QListView> | ||||||
| @@ -103,6 +106,19 @@ ManagedPackPage::ManagedPackPage(BaseInstance* inst, InstanceWindow* instance_wi | |||||||
|         // Pretend we're opening the page again |         // Pretend we're opening the page again | ||||||
|         openedImpl(); |         openedImpl(); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|  |     connect(ui->changelogTextBrowser, &QTextBrowser::anchorClicked, this, [](const QUrl url) { | ||||||
|  |         if (url.scheme().isEmpty()) { | ||||||
|  |             auto querry = | ||||||
|  |                 QUrlQuery(url.query()).queryItemValue("remoteUrl", QUrl::FullyDecoded);  // curseforge workaround for linkout?remoteUrl= | ||||||
|  |             auto decoded = QUrl::fromPercentEncoding(querry.toUtf8()); | ||||||
|  |             auto newUrl = QUrl(decoded); | ||||||
|  |             if (newUrl.isValid() && (newUrl.scheme() == "http" || newUrl.scheme() == "https")) | ||||||
|  |                 QDesktopServices ::openUrl(newUrl); | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |         QDesktopServices::openUrl(url); | ||||||
|  |     }); | ||||||
| } | } | ||||||
|  |  | ||||||
| ManagedPackPage::~ManagedPackPage() | ManagedPackPage::~ManagedPackPage() | ||||||
|   | |||||||
| @@ -168,10 +168,13 @@ | |||||||
|        </property> |        </property> | ||||||
|        <layout class="QVBoxLayout" name="verticalLayout_3"> |        <layout class="QVBoxLayout" name="verticalLayout_3"> | ||||||
|         <item> |         <item> | ||||||
|          <widget class="QTextBrowser" name="changelogTextBrowser"> |          <widget class="ProjectDescriptionPage" name="changelogTextBrowser"> | ||||||
|           <property name="placeholderText"> |           <property name="placeholderText"> | ||||||
|            <string>No changelog available for this version!</string> |            <string>No changelog available for this version!</string> | ||||||
|           </property> |           </property> | ||||||
|  |           <property name="openLinks"> | ||||||
|  |            <bool>false</bool> | ||||||
|  |           </property> | ||||||
|          </widget> |          </widget> | ||||||
|         </item> |         </item> | ||||||
|        </layout> |        </layout> | ||||||
| @@ -188,6 +191,13 @@ | |||||||
|    </item> |    </item> | ||||||
|   </layout> |   </layout> | ||||||
|  </widget> |  </widget> | ||||||
|  |  <customwidgets> | ||||||
|  |   <customwidget> | ||||||
|  |    <class>ProjectDescriptionPage</class> | ||||||
|  |    <extends>QTextBrowser</extends> | ||||||
|  |    <header>ui/widgets/ProjectDescriptionPage.h</header> | ||||||
|  |   </customwidget> | ||||||
|  |  </customwidgets> | ||||||
|  <resources/> |  <resources/> | ||||||
|  <connections/> |  <connections/> | ||||||
| </ui> | </ui> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Trial97
					Trial97