summaryrefslogtreecommitdiff
path: root/src/yuzu
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu')
-rw-r--r--src/yuzu/applets/qt_controller.cpp3
-rw-r--r--src/yuzu/applets/qt_error.cpp3
-rw-r--r--src/yuzu/applets/qt_profile_select.cpp3
-rw-r--r--src/yuzu/applets/qt_software_keyboard.cpp23
-rw-r--r--src/yuzu/configuration/config.cpp2
-rw-r--r--src/yuzu/debugger/profiler.cpp2
-rw-r--r--src/yuzu/game_list.cpp19
-rw-r--r--src/yuzu/main.cpp23
-rw-r--r--src/yuzu/uisettings.h3
9 files changed, 48 insertions, 33 deletions
diff --git a/src/yuzu/applets/qt_controller.cpp b/src/yuzu/applets/qt_controller.cpp
index c5685db2e..c6222b571 100644
--- a/src/yuzu/applets/qt_controller.cpp
+++ b/src/yuzu/applets/qt_controller.cpp
@@ -12,7 +12,6 @@
#include "core/hid/emulated_controller.h"
#include "core/hid/hid_core.h"
#include "core/hid/hid_types.h"
-#include "core/hle/lock.h"
#include "core/hle/service/hid/controllers/npad.h"
#include "core/hle/service/hid/hid.h"
#include "core/hle/service/sm/sm.h"
@@ -664,7 +663,5 @@ void QtControllerSelector::ReconfigureControllers(
}
void QtControllerSelector::MainWindowReconfigureFinished() {
- // Acquire the HLE mutex
- std::lock_guard lock(HLE::g_hle_lock);
callback();
}
diff --git a/src/yuzu/applets/qt_error.cpp b/src/yuzu/applets/qt_error.cpp
index 45cf64603..879e73660 100644
--- a/src/yuzu/applets/qt_error.cpp
+++ b/src/yuzu/applets/qt_error.cpp
@@ -3,7 +3,6 @@
// Refer to the license.txt file included.
#include <QDateTime>
-#include "core/hle/lock.h"
#include "yuzu/applets/qt_error.h"
#include "yuzu/main.h"
@@ -57,7 +56,5 @@ void QtErrorDisplay::ShowCustomErrorText(ResultCode error, std::string dialog_te
}
void QtErrorDisplay::MainWindowFinishedError() {
- // Acquire the HLE mutex
- std::lock_guard lock{HLE::g_hle_lock};
callback();
}
diff --git a/src/yuzu/applets/qt_profile_select.cpp b/src/yuzu/applets/qt_profile_select.cpp
index 7b19f1f8d..5b32da923 100644
--- a/src/yuzu/applets/qt_profile_select.cpp
+++ b/src/yuzu/applets/qt_profile_select.cpp
@@ -14,7 +14,6 @@
#include "common/fs/path_util.h"
#include "common/string_util.h"
#include "core/constants.h"
-#include "core/hle/lock.h"
#include "yuzu/applets/qt_profile_select.h"
#include "yuzu/main.h"
#include "yuzu/util/controller_navigation.h"
@@ -170,7 +169,5 @@ void QtProfileSelector::SelectProfile(
}
void QtProfileSelector::MainWindowFinishedSelection(std::optional<Common::UUID> uuid) {
- // Acquire the HLE mutex
- std::lock_guard lock{HLE::g_hle_lock};
callback(uuid);
}
diff --git a/src/yuzu/applets/qt_software_keyboard.cpp b/src/yuzu/applets/qt_software_keyboard.cpp
index de7f98c4f..c3857fc98 100644
--- a/src/yuzu/applets/qt_software_keyboard.cpp
+++ b/src/yuzu/applets/qt_software_keyboard.cpp
@@ -475,11 +475,26 @@ void QtSoftwareKeyboardDialog::open() {
row = 0;
column = 0;
- const auto* const curr_button =
- keyboard_buttons[static_cast<int>(bottom_osk_index)][row][column];
+ switch (bottom_osk_index) {
+ case BottomOSKIndex::LowerCase:
+ case BottomOSKIndex::UpperCase: {
+ const auto* const curr_button =
+ keyboard_buttons[static_cast<std::size_t>(bottom_osk_index)][row][column];
+
+ // This is a workaround for setFocus() randomly not showing focus in the UI
+ QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center()));
+ break;
+ }
+ case BottomOSKIndex::NumberPad: {
+ const auto* const curr_button = numberpad_buttons[row][column];
- // This is a workaround for setFocus() randomly not showing focus in the UI
- QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center()));
+ // This is a workaround for setFocus() randomly not showing focus in the UI
+ QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center()));
+ break;
+ }
+ default:
+ break;
+ }
StartInputThread();
}
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 463d500c2..0f679c37e 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -776,6 +776,7 @@ void Config::ReadUIGamelistValues() {
ReadBasicSetting(UISettings::values.row_1_text_id);
ReadBasicSetting(UISettings::values.row_2_text_id);
ReadBasicSetting(UISettings::values.cache_game_list);
+ ReadBasicSetting(UISettings::values.favorites_expanded);
const int favorites_size = qt_config->beginReadArray(QStringLiteral("favorites"));
for (int i = 0; i < favorites_size; i++) {
qt_config->setArrayIndex(i);
@@ -1300,6 +1301,7 @@ void Config::SaveUIGamelistValues() {
WriteBasicSetting(UISettings::values.row_1_text_id);
WriteBasicSetting(UISettings::values.row_2_text_id);
WriteBasicSetting(UISettings::values.cache_game_list);
+ WriteBasicSetting(UISettings::values.favorites_expanded);
qt_config->beginWriteArray(QStringLiteral("favorites"));
for (int i = 0; i < UISettings::values.favorited_ids.size(); i++) {
qt_config->setArrayIndex(i);
diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp
index a8b254199..33110685a 100644
--- a/src/yuzu/debugger/profiler.cpp
+++ b/src/yuzu/debugger/profiler.cpp
@@ -163,7 +163,7 @@ void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) {
}
void MicroProfileWidget::wheelEvent(QWheelEvent* ev) {
- const auto wheel_position = ev->pos();
+ const auto wheel_position = ev->position().toPoint();
MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale,
ev->angleDelta().y() / 120);
ev->accept();
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 1a5e41588..8b5c4a10a 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -173,13 +173,17 @@ void GameList::OnItemExpanded(const QModelIndex& item) {
const bool is_dir = type == GameListItemType::CustomDir || type == GameListItemType::SdmcDir ||
type == GameListItemType::UserNandDir ||
type == GameListItemType::SysNandDir;
-
- if (!is_dir) {
+ const bool is_fave = type == GameListItemType::Favorites;
+ if (!is_dir && !is_fave) {
return;
}
-
- UISettings::values.game_dirs[item.data(GameListDir::GameDirRole).toInt()].expanded =
- tree_view->isExpanded(item);
+ const bool is_expanded = tree_view->isExpanded(item);
+ if (is_fave) {
+ UISettings::values.favorites_expanded = is_expanded;
+ return;
+ }
+ const int item_dir_index = item.data(GameListDir::GameDirRole).toInt();
+ UISettings::values.game_dirs[item_dir_index].expanded = is_expanded;
}
// Event in order to filter the gamelist after editing the searchfield
@@ -458,10 +462,13 @@ void GameList::DonePopulating(const QStringList& watch_list) {
emit ShowList(!IsEmpty());
item_model->invisibleRootItem()->appendRow(new GameListAddDir());
+
+ // Add favorites row
item_model->invisibleRootItem()->insertRow(0, new GameListFavorites());
tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(),
UISettings::values.favorited_ids.size() == 0);
- tree_view->expand(item_model->invisibleRootItem()->child(0)->index());
+ tree_view->setExpanded(item_model->invisibleRootItem()->child(0)->index(),
+ UISettings::values.favorites_expanded.GetValue());
for (const auto id : UISettings::values.favorited_ids) {
AddFavorite(id);
}
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index cc84ea11c..b7bb43348 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -77,6 +77,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
#include "common/fs/fs.h"
#include "common/fs/fs_paths.h"
#include "common/fs/path_util.h"
+#include "common/literals.h"
#include "common/logging/backend.h"
#include "common/logging/filter.h"
#include "common/logging/log.h"
@@ -134,6 +135,8 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
#include "yuzu/main.h"
#include "yuzu/uisettings.h"
+using namespace Common::Literals;
+
#ifdef USE_DISCORD_PRESENCE
#include "yuzu/discord_impl.h"
#endif
@@ -259,10 +262,9 @@ GMainWindow::GMainWindow()
LOG_INFO(Frontend, "Host CPU: {}", cpu_string);
#endif
LOG_INFO(Frontend, "Host OS: {}", QSysInfo::prettyProductName().toStdString());
- LOG_INFO(Frontend, "Host RAM: {:.2f} GB",
- Common::GetMemInfo().TotalPhysicalMemory / 1024.0f / 1024 / 1024);
- LOG_INFO(Frontend, "Host Swap: {:.2f} GB",
- Common::GetMemInfo().TotalSwapMemory / 1024.0f / 1024 / 1024);
+ LOG_INFO(Frontend, "Host RAM: {:.2f} GiB",
+ Common::GetMemInfo().TotalPhysicalMemory / f64{1_GiB});
+ LOG_INFO(Frontend, "Host Swap: {:.2f} GiB", Common::GetMemInfo().TotalSwapMemory / f64{1_GiB});
UpdateWindowTitle();
show();
@@ -1302,16 +1304,13 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p
case Core::SystemResultStatus::ErrorVideoCore:
QMessageBox::critical(
this, tr("An error occurred initializing the video core."),
- tr("yuzu has encountered an error while running the video core, please see the "
- "log for more details."
+ tr("yuzu has encountered an error while running the video core. "
+ "This is usually caused by outdated GPU drivers, including integrated ones. "
+ "Please see the log for more details. "
"For more information on accessing the log, please see the following page: "
- "<a href='https://community.citra-emu.org/t/how-to-upload-the-log-file/296'>How "
- "to "
- "Upload the Log File</a>."
- "Ensure that you have the latest graphics drivers for your GPU."));
-
+ "<a href='https://yuzu-emu.org/help/reference/log-files/'>"
+ "How to Upload the Log File</a>. "));
break;
-
default:
if (result > Core::SystemResultStatus::ErrorLoader) {
const u16 loader_id = static_cast<u16>(Core::SystemResultStatus::ErrorLoader);
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h
index 936914ef3..a610e7e25 100644
--- a/src/yuzu/uisettings.h
+++ b/src/yuzu/uisettings.h
@@ -74,7 +74,6 @@ struct Values {
QString game_dir_deprecated;
bool game_dir_deprecated_deepscan;
QVector<UISettings::GameDir> game_dirs;
- QVector<u64> favorited_ids;
QStringList recent_files;
QString language;
@@ -96,6 +95,8 @@ struct Values {
Settings::BasicSetting<uint8_t> row_2_text_id{2, "row_2_text_id"};
std::atomic_bool is_game_list_reload_pending{false};
Settings::BasicSetting<bool> cache_game_list{true, "cache_game_list"};
+ Settings::BasicSetting<bool> favorites_expanded{true, "favorites_expanded"};
+ QVector<u64> favorited_ids;
bool configuration_applied;
bool reset_to_defaults;