mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-20 14:48:56 +02:00
[bcat/news/web/am] Implement news applet, proper TLV return, external web browser URL and qlaunch app sorting (#3308)
This pulls eden releases changelog & text from our github releases. We don't store the msgpack file but rather generate them in-memory for the News Applet. Uses cache folder. Files generated are: - cache/news/github_releases.json - cache/news/eden_logo.jpg - cache/news/news_read Additional changes: - Proper TLV returning for online web applet, to open external URL - Add applet type `LHub` to properly close, as it also uses TLV return - qlaunch app sorting, adds another cached .json to track last launched app timestamps and sort them accordingly Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: DraVee <dravee@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3308 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: Lizzie <lizzie@eden-emu.dev> Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
parent
b7417f68ce
commit
ae501e256e
35 changed files with 2978 additions and 315 deletions
|
|
@ -4,6 +4,11 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include "common/logging/log.h"
|
||||
|
||||
#ifdef YUZU_USE_QT_WEB_ENGINE
|
||||
#include <bit>
|
||||
|
||||
|
|
@ -429,15 +434,17 @@ void QtWebBrowser::OpenLocalWebPage(const std::string& local_url,
|
|||
|
||||
void QtWebBrowser::OpenExternalWebPage(const std::string& external_url,
|
||||
OpenWebPageCallback callback_) const {
|
||||
callback = std::move(callback_);
|
||||
LOG_INFO(Service_AM, "Opening external URL in host browser: {}", external_url);
|
||||
|
||||
const auto index = external_url.find('?');
|
||||
const QUrl url(QString::fromStdString(external_url));
|
||||
const bool success = QDesktopServices::openUrl(url);
|
||||
|
||||
if (index == std::string::npos) {
|
||||
emit MainWindowOpenWebPage(external_url, "", false);
|
||||
if (success) {
|
||||
LOG_INFO(Service_AM, "Successfully opened URL in host browser");
|
||||
callback_(Service::AM::Frontend::WebExitReason::EndButtonPressed, external_url);
|
||||
} else {
|
||||
emit MainWindowOpenWebPage(external_url.substr(0, index), external_url.substr(index),
|
||||
false);
|
||||
LOG_ERROR(Service_AM, "Failed to open URL in host browser");
|
||||
callback_(Service::AM::Frontend::WebExitReason::WindowClosed, external_url);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -400,6 +400,11 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa
|
|||
if (res2 == Loader::ResultStatus::Success && program_ids.size() > 1 &&
|
||||
(file_type == Loader::FileType::XCI || file_type == Loader::FileType::NSP)) {
|
||||
for (const auto id : program_ids) {
|
||||
// dravee suggested this, only viable way to
|
||||
// not show sub-games in qlaunch for now.
|
||||
if ((id & 0xFFF) != 0) {
|
||||
continue;
|
||||
}
|
||||
loader = Loader::GetLoader(system, file, id);
|
||||
if (!loader) {
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue