So i'm trying to add in a dropdown menu (QComboBox) which would reference specific strings stored in an .ini file. I saw the system used in InterfacePane.cpp, which looks like this:
So i understand how this works, but it's not exactly what i'm looking for. This system obtains the names of files in the Themes folder directory, rather than parsing an .ini which is what i'm trying to do.
The values i have stored are in a file called "LocalPlayers.ini" (in dolphin, it's stored as "F_LOCALPLAYERSCONFIG_IDX" in FileUtil.h) and the format of that file is as follows:
Basically, "+" indicates the start of a new username, and the brackets [] are for user ID's (which is for something else not related to this). I just want the dropdown menu to reference usernames, which would be stored between "+" and "["
An important thing to note is that i want the dropdown to reference the .ini because i already made a system where players can add in users themselves (otherwise i could just hard-code the dropdown menu).
But i'm stuck there, since i'm not sure exactly how to go about this. If someone could just point me in the right direction, that would be highly appreciated. I'm still fairly new to programming as a whole. Thank you!
Code:
// Theme Combobox
m_combobox_theme = new QComboBox;
combobox_layout->addRow(tr("&Theme:"), m_combobox_theme);
// List avalable themes
auto theme_search_results =
Common::DoFileSearch({File::GetUserPath(D_THEMES_IDX), File::GetSysDirectory() + THEMES_DIR});
for (const std::string& path : theme_search_results)
{
const QString qt_name = QString::fromStdString(PathToFileName(path));
m_combobox_theme->addItem(qt_name);
So i understand how this works, but it's not exactly what i'm looking for. This system obtains the names of files in the Themes folder directory, rather than parsing an .ini which is what i'm trying to do.
The values i have stored are in a file called "LocalPlayers.ini" (in dolphin, it's stored as "F_LOCALPLAYERSCONFIG_IDX" in FileUtil.h) and the format of that file is as follows:
Code:
[Local_Players_List]
+exampleUsername[userID]
+anotherExample[userID]
Basically, "+" indicates the start of a new username, and the brackets [] are for user ID's (which is for something else not related to this). I just want the dropdown menu to reference usernames, which would be stored between "+" and "["
An important thing to note is that i want the dropdown to reference the .ini because i already made a system where players can add in users themselves (otherwise i could just hard-code the dropdown menu).
But i'm stuck there, since i'm not sure exactly how to go about this. If someone could just point me in the right direction, that would be highly appreciated. I'm still fairly new to programming as a whole. Thank you!