• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 3 4 5 6 7 ... 116 Next »

Create a dropdown menu that references .ini file
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Create a dropdown menu that references .ini file
09-11-2021, 11:06 AM (This post was last modified: 09-12-2021, 03:56 AM by LittleCoaks.)
#1
LittleCoaks Offline
Junior Member
**
Posts: 22
Threads: 16
Joined: Dec 2020
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:

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!
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode