MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / MemoryCardConvertDialog

Method MemoryCardConvertDialog

pcsx2-qt/Settings/MemoryCardConvertDialog.cpp:15–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include "common/StringUtil.h"
14
15MemoryCardConvertDialog::MemoryCardConvertDialog(QWidget* parent, QString selectedCard)
16 : QDialog(parent)
17{
18 m_ui.setupUi(this);
19
20 // For some reason, setting these in the .ui doesn't work..
21 m_ui.conversionTypeDescription->setFrameStyle(QFrame::Sunken);
22 m_ui.conversionTypeDescription->setFrameShape(QFrame::WinPanel);
23 m_ui.note->setFrameStyle(QFrame::Sunken);
24 m_ui.note->setFrameShape(QFrame::WinPanel);
25
26 m_selectedCard = selectedCard;
27 std::optional<AvailableMcdInfo> srcCardInfo = FileMcd_GetCardInfo(m_selectedCard.toStdString());
28
29 if (srcCardInfo.has_value())
30 {
31 m_srcCardInfo = srcCardInfo.value();
32 }
33
34 isSetup = SetupPicklist();
35 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
36
37 m_ui.progressBar->setRange(0, 100);
38 m_ui.progressBar->setValue(0);
39
40 connect(m_ui.conversionTypeSelect, &QComboBox::currentIndexChanged, this, [this]() {
41 switch (m_srcCardInfo.type)
42 {
43 case MemoryCardType::File:
44 SetType(MemoryCardType::Folder, MemoryCardFileType::Unknown, tr("Uses a folder on your PC filesystem, instead of a file. Infinite capacity, while keeping the same compatibility as an 8 MB Memory Card."));
45 break;
46 case MemoryCardType::Folder:
47 switch (m_ui.conversionTypeSelect->currentData().toInt())
48 {
49 case 8:
50 SetType(MemoryCardType::File, MemoryCardFileType::PS2_8MB, tr("A standard, 8 MB Memory Card. Most compatible, but smallest capacity."));
51 break;
52 case 16:
53 SetType(MemoryCardType::File, MemoryCardFileType::PS2_16MB, tr("2x larger than a standard Memory Card. May have some compatibility issues."));
54 break;
55 case 32:
56 SetType(MemoryCardType::File, MemoryCardFileType::PS2_32MB, tr("4x larger than a standard Memory Card. Likely to have compatibility issues."));
57 break;
58 case 64:
59 SetType(MemoryCardType::File, MemoryCardFileType::PS2_64MB, tr("8x larger than a standard Memory Card. Likely to have compatibility issues."));
60 break;
61 default:
62 //: MemoryCardType should be left as-is.
63 QMessageBox::critical(this, tr("Convert Memory Card Failed"), tr("Invalid MemoryCardType"));
64 return;
65 }
66 break;
67 default:
68 //: MemoryCardType should be left as-is.
69 QMessageBox::critical(this, tr("Convert Memory Card Failed"), tr("Invalid MemoryCardType"));
70 return;
71 }
72 });

Callers

nothing calls this directly

Calls 3

FileMcd_GetCardInfoFunction · 0.85
setupUiMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected