mirror of
https://github.com/coderkei/akmenu-next.git
synced 2025-06-18 08:55:46 -04:00
Fixed INI issues
Fixed INI settings Changed how INI files get written
This commit is contained in:
parent
0129331a0b
commit
e7f1ade105
@ -82,22 +82,23 @@ void cGlobalSettings::loadSettings() {
|
|||||||
homebrewreset = ini.GetInt("system", "homebrewreset", homebrewreset);
|
homebrewreset = ini.GetInt("system", "homebrewreset", homebrewreset);
|
||||||
resetHotKey = ini.GetInt("system", "resethotkey", resetHotKey);
|
resetHotKey = ini.GetInt("system", "resethotkey", resetHotKey);
|
||||||
phatCol = ini.GetInt("system", "phatCol", phatCol);
|
phatCol = ini.GetInt("system", "phatCol", phatCol);
|
||||||
|
|
||||||
temp = ini.GetString("system", "scrollSpeed", "fast");
|
|
||||||
scrollSpeed =
|
|
||||||
(temp == "slow") ? EScrollSlow : ((temp == "medium") ? EScrollMedium : EScrollFast);
|
|
||||||
|
|
||||||
temp = ini.GetString("system", "viewMode", "icon");
|
|
||||||
viewMode = (temp == "list") ? EViewList
|
|
||||||
: (temp == "icon") ? EViewIcon
|
|
||||||
: (temp == "small") ? EViewSmall
|
|
||||||
: EViewInternal;
|
|
||||||
|
|
||||||
temp = ini.GetString("system", "slot2mode", "ask");
|
|
||||||
slot2mode = (temp == "gba") ? ESlot2Gba : ((temp == "nds") ? ESlot2Nds : ESlot2Ask);
|
|
||||||
|
|
||||||
temp = ini.GetString("system", "saveext", ".sav");
|
temp = ini.GetString("system", "saveext", ".sav");
|
||||||
saveExt = (temp == ".sav");
|
saveExt = (temp == ".sav");
|
||||||
|
temp = ini.GetString("system", "scrollSpeed", "fast");
|
||||||
|
scrollSpeed = (temp == "slow") ? EScrollSlow
|
||||||
|
: (temp == "medium") ? EScrollMedium
|
||||||
|
: EScrollFast;
|
||||||
|
temp = ini.GetString("system", "viewMode", "icon");
|
||||||
|
viewMode = (temp == "list") ? EViewList
|
||||||
|
: (temp == "icon") ? EViewIcon
|
||||||
|
: (temp == "small") ? EViewSmall
|
||||||
|
: (temp == "internal") ? EViewInternal
|
||||||
|
: EViewInternal;
|
||||||
|
temp = ini.GetString("system", "slot2mode", "ask");
|
||||||
|
slot2mode = (temp == "gba") ? ESlot2Gba
|
||||||
|
: (temp == "nds") ? ESlot2Nds
|
||||||
|
: ESlot2Ask;
|
||||||
|
|
||||||
#ifdef __KERNEL_LAUNCHER_SUPPORT__
|
#ifdef __KERNEL_LAUNCHER_SUPPORT__
|
||||||
temp = ini.GetString("system", "nds-bootstrap", "false");
|
temp = ini.GetString("system", "nds-bootstrap", "false");
|
||||||
@ -137,11 +138,16 @@ void cGlobalSettings::saveSettings() {
|
|||||||
ini.SetInt("system", "resethotkey", resetHotKey);
|
ini.SetInt("system", "resethotkey", resetHotKey);
|
||||||
ini.SetInt("system", "dsonly", dsOnly);
|
ini.SetInt("system", "dsonly", dsOnly);
|
||||||
ini.SetInt("system", "phatCol", phatCol);
|
ini.SetInt("system", "phatCol", phatCol);
|
||||||
|
ini.SetString(
|
||||||
ini.SetString("system", "scrollSpeed",
|
"system", "saveext",
|
||||||
(scrollSpeed == EScrollSlow)
|
saveExt ? ".sav"
|
||||||
? "slow"
|
: ".nds.sav");
|
||||||
: ((scrollSpeed == EScrollMedium) ? "medium" : "fast"));
|
ini.SetString(
|
||||||
|
"system", "scrollSpeed",
|
||||||
|
(scrollSpeed == EScrollSlow) ? "slow"
|
||||||
|
: (scrollSpeed == EScrollMedium) ? "medium"
|
||||||
|
: (scrollSpeed == EScrollFast) ? "fast"
|
||||||
|
: "fast");
|
||||||
ini.SetString(
|
ini.SetString(
|
||||||
"system", "viewMode",
|
"system", "viewMode",
|
||||||
(viewMode == EViewList) ? "list"
|
(viewMode == EViewList) ? "list"
|
||||||
@ -149,9 +155,12 @@ void cGlobalSettings::saveSettings() {
|
|||||||
: (viewMode == EViewSmall) ? "small"
|
: (viewMode == EViewSmall) ? "small"
|
||||||
: (viewMode == EViewInternal) ? "internal"
|
: (viewMode == EViewInternal) ? "internal"
|
||||||
: "internal");
|
: "internal");
|
||||||
ini.SetString("system", "slot2mode",
|
ini.SetString(
|
||||||
(slot2mode == ESlot2Gba) ? "gba" : ((slot2mode == ESlot2Nds) ? "nds" : "ask"));
|
"system", "slot2mode",
|
||||||
ini.SetString("system", "saveext", saveExt ? ".sav" : ".nds.sav");
|
(slot2mode == ESlot2Gba) ? "gba"
|
||||||
|
: (slot2mode == ESlot2Nds) ? "nds"
|
||||||
|
: (slot2mode == ESlot2Ask) ? "ask"
|
||||||
|
: "ask" );
|
||||||
|
|
||||||
#ifdef __KERNEL_LAUNCHER_SUPPORT__
|
#ifdef __KERNEL_LAUNCHER_SUPPORT__
|
||||||
ini.SetString("system", "nds-bootstrap",
|
ini.SetString("system", "nds-bootstrap",
|
||||||
|
@ -190,29 +190,30 @@ bool CIniFile::SaveIniFileModified(const std::string& FileName) {
|
|||||||
bool CIniFile::SaveIniFile(const std::string& FileName) {
|
bool CIniFile::SaveIniFile(const std::string& FileName) {
|
||||||
if (FileName != "") m_sFileName = FileName;
|
if (FileName != "") m_sFileName = FileName;
|
||||||
|
|
||||||
FILE* f = fopen(m_sFileName.c_str(), "wb");
|
FILE* f = fopen(m_sFileName.c_str(), "w");
|
||||||
if (NULL == f) {
|
if (f == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t ii = 0; ii < m_FileContainer.size(); ii++) {
|
for (size_t ii = 0; ii < m_FileContainer.size(); ii++) {
|
||||||
std::string& strline = m_FileContainer[ii];
|
std::string& strline = m_FileContainer[ii];
|
||||||
size_t notSpace = strline.find_first_not_of(' ');
|
size_t notSpace = strline.find_first_not_of(' ');
|
||||||
strline = strline.substr(notSpace);
|
if (notSpace != std::string::npos) {
|
||||||
if (strline.find('[') == 0 && ii > 0) {
|
strline = strline.substr(notSpace);
|
||||||
if (!m_FileContainer[ii - 1].empty() && m_FileContainer[ii - 1] != "")
|
|
||||||
fwrite("\r\n", 1, 2, f);
|
|
||||||
}
|
}
|
||||||
if (!strline.empty() && strline != "") {
|
|
||||||
fwrite(strline.c_str(), 1, strline.length(), f);
|
if (strline.find('[') == 0 && ii > 0) {
|
||||||
fwrite("\r\n", 1, 2, f);
|
if (!m_FileContainer[ii - 1].empty())
|
||||||
|
fprintf(f, "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strline.empty()) {
|
||||||
|
fprintf(f, "%s\n", strline.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
m_bModified = false;
|
m_bModified = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,8 +537,7 @@ void cMainWnd::setParam(void) {
|
|||||||
_values.clear();
|
_values.clear();
|
||||||
_values.push_back(LANG("switches", "Disable"));
|
_values.push_back(LANG("switches", "Disable"));
|
||||||
_values.push_back(LANG("switches", "Enable"));
|
_values.push_back(LANG("switches", "Enable"));
|
||||||
settingWnd.addSettingItem(LANG("file settings", "show hidden files"), _values,
|
settingWnd.addSettingItem(LANG("file settings", "show hidden files"), _values, gs().showHiddenFiles);
|
||||||
gs().showHiddenFiles);
|
|
||||||
_values.clear();
|
_values.clear();
|
||||||
_values.push_back(".nds.sav");
|
_values.push_back(".nds.sav");
|
||||||
_values.push_back(".sav");
|
_values.push_back(".sav");
|
||||||
@ -556,8 +555,8 @@ void cMainWnd::setParam(void) {
|
|||||||
settingWnd.addSettingItem(LANG("nds bootstrap", "dsmode"), _values, gs().dsOnly);
|
settingWnd.addSettingItem(LANG("nds bootstrap", "dsmode"), _values, gs().dsOnly);
|
||||||
#ifdef __DSIMODE__
|
#ifdef __DSIMODE__
|
||||||
_values.clear();
|
_values.clear();
|
||||||
_values.push_back("disable");
|
|
||||||
_values.push_back("enable");
|
_values.push_back("enable");
|
||||||
|
_values.push_back("disable");
|
||||||
settingWnd.addSettingItem(LANG("nds bootstrap", "phatCol"), _values, gs().phatCol);
|
settingWnd.addSettingItem(LANG("nds bootstrap", "phatCol"), _values, gs().phatCol);
|
||||||
#endif
|
#endif
|
||||||
_values.clear();
|
_values.clear();
|
||||||
@ -610,8 +609,8 @@ void cMainWnd::setParam(void) {
|
|||||||
|
|
||||||
// page 3: filesystem
|
// page 3: filesystem
|
||||||
gs().showHiddenFiles = settingWnd.getItemSelection(2, 0);
|
gs().showHiddenFiles = settingWnd.getItemSelection(2, 0);
|
||||||
gs().saveExt = settingWnd.getItemSelection(2, 2);
|
gs().saveExt = settingWnd.getItemSelection(2, 1);
|
||||||
gs().saveDir = settingWnd.getItemSelection(2, 3);
|
gs().saveDir = settingWnd.getItemSelection(2, 2);
|
||||||
|
|
||||||
// page 4: ndsbs
|
// page 4: ndsbs
|
||||||
gs().dsOnly = settingWnd.getItemSelection(3, 0);
|
gs().dsOnly = settingWnd.getItemSelection(3, 0);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define AKMENU_VERSION_MAIN "1"
|
#define AKMENU_VERSION_MAIN "1"
|
||||||
#define AKMENU_VERSION_SUB "6"
|
#define AKMENU_VERSION_SUB "6.1"
|
||||||
|
|
||||||
#ifndef __KERNEL_LAUNCHER_SUPPORT__
|
#ifndef __KERNEL_LAUNCHER_SUPPORT__
|
||||||
#define AKMENU_LOADER_NAME "nds-bootstrap"
|
#define AKMENU_LOADER_NAME "nds-bootstrap"
|
||||||
|
@ -280,6 +280,7 @@ target slot = Ziel Speicher-Slot
|
|||||||
flash memory = Flash Memory
|
flash memory = Flash Memory
|
||||||
microsd card = microSD Card
|
microsd card = microSD Card
|
||||||
slot2 card = Slot2 Card
|
slot2 card = Slot2 Card
|
||||||
|
slot1 card = Slot1 Card
|
||||||
favorites = Favoriten
|
favorites = Favoriten
|
||||||
|
|
||||||
[hotkeys]
|
[hotkeys]
|
||||||
|
@ -278,7 +278,7 @@ target slot = Slot de destination
|
|||||||
flash memory = Flash Memory
|
flash memory = Flash Memory
|
||||||
microsd card = microSD Card
|
microsd card = microSD Card
|
||||||
slot2 card = Slot 2 Card
|
slot2 card = Slot 2 Card
|
||||||
slot2 card = Slot 1 Card
|
slot1 card = Slot 1 Card
|
||||||
favorites = Favorites
|
favorites = Favorites
|
||||||
|
|
||||||
[hotkeys]
|
[hotkeys]
|
||||||
|
@ -280,6 +280,7 @@ target slot = Ziel Speicher-Slot
|
|||||||
flash memory = Flash Memory
|
flash memory = Flash Memory
|
||||||
microsd card = microSD Card
|
microsd card = microSD Card
|
||||||
slot2 card = Slot2 Card
|
slot2 card = Slot2 Card
|
||||||
|
slot1 card = Slot1 Card
|
||||||
favorites = Favoriten
|
favorites = Favoriten
|
||||||
|
|
||||||
[hotkeys]
|
[hotkeys]
|
||||||
|
@ -278,7 +278,7 @@ target slot = Slot de destination
|
|||||||
flash memory = Flash Memory
|
flash memory = Flash Memory
|
||||||
microsd card = microSD Card
|
microsd card = microSD Card
|
||||||
slot2 card = Slot 2 Card
|
slot2 card = Slot 2 Card
|
||||||
slot2 card = Slot 1 Card
|
slot1 card = Slot 1 Card
|
||||||
favorites = Favorites
|
favorites = Favorites
|
||||||
|
|
||||||
[hotkeys]
|
[hotkeys]
|
||||||
|
Loading…
Reference in New Issue
Block a user