Qt/savedata: use rsx overlays selection_code

This commit is contained in:
Megamouse 2022-07-21 00:58:37 +02:00
parent 984bf67d84
commit 14ca506774
2 changed files with 6 additions and 11 deletions

View File

@ -65,7 +65,7 @@ save_data_list_dialog::save_data_list_dialog(const std::vector<SaveDataEntry>& e
QPushButton *saveNewEntry = new QPushButton(tr("Save New Entry"), this);
connect(saveNewEntry, &QAbstractButton::clicked, this, [&]()
{
m_entry = selection_code::new_save;
m_entry = rsx::overlays::user_interface::selection_code::new_save;
accept();
});
hbox_action->addWidget(saveNewEntry);
@ -135,15 +135,15 @@ s32 save_data_list_dialog::GetSelection() const
{
if (result() == QDialog::Accepted)
{
if (m_entry == selection_code::new_save)
if (m_entry == rsx::overlays::user_interface::selection_code::new_save)
{ // Save new entry
return selection_code::new_save;
return rsx::overlays::user_interface::selection_code::new_save;
}
return m_list->item(m_entry, 0)->data(Qt::UserRole).toInt();
}
// Cancel is pressed. May figure out proper cellsavedata code to use later.
return selection_code::canceled;
return rsx::overlays::user_interface::selection_code::canceled;
}
void save_data_list_dialog::OnSort(int logicalIndex)

View File

@ -3,6 +3,7 @@
#include "util/types.hpp"
#include "Emu/Memory/vm.h"
#include "Emu/Cell/Modules/cellSaveData.h"
#include "Emu/RSX/Overlays/overlays.h"
#include <QTableWidget>
#include <QDialog>
@ -20,12 +21,6 @@ class save_data_list_dialog : public QDialog
{
Q_OBJECT
enum selection_code
{
new_save = -1,
canceled = -2
};
public:
explicit save_data_list_dialog(const std::vector<SaveDataEntry>& entries, s32 focusedEntry, u32 op, vm::ptr<CellSaveDataListSet>, QWidget* parent = nullptr);
@ -37,7 +32,7 @@ private:
void UpdateSelectionLabel();
void UpdateList();
s32 m_entry = selection_code::new_save;
s32 m_entry = rsx::overlays::user_interface::selection_code::new_save;
QLabel* m_entry_label = nullptr;
QTableWidget* m_list = nullptr;