mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-26 01:06:16 +02:00
Converted public fields of InputDialog to private.
This commit is contained in:
parent
07bad5ade1
commit
40ead3b642
@ -1516,10 +1516,11 @@ void GMenu2X::addSection() {
|
||||
InputDialog id(this,tr["Insert a name for the new section"]);
|
||||
if (id.exec()) {
|
||||
//only if a section with the same name does not exist
|
||||
if (find(menu->sections.begin(),menu->sections.end(),id.input)==menu->sections.end()) {
|
||||
if (find(menu->sections.begin(), menu->sections.end(), id.getInput())
|
||||
== menu->sections.end()) {
|
||||
//section directory doesn't exists
|
||||
ledOn();
|
||||
if (menu->addSection(id.input)) {
|
||||
if (menu->addSection(id.getInput())) {
|
||||
menu->setSectionIndex( menu->sections.size()-1 ); //switch to the new section
|
||||
sync();
|
||||
}
|
||||
@ -1532,10 +1533,12 @@ void GMenu2X::renameSection() {
|
||||
InputDialog id(this,tr["Insert a new name for this section"],menu->selSection());
|
||||
if (id.exec()) {
|
||||
//only if a section with the same name does not exist & !samename
|
||||
if (menu->selSection()!=id.input && find(menu->sections.begin(),menu->sections.end(),id.input)==menu->sections.end()) {
|
||||
if (menu->selSection() != id.getInput()
|
||||
&& find(menu->sections.begin(),menu->sections.end(), id.getInput())
|
||||
== menu->sections.end()) {
|
||||
//section directory doesn't exists
|
||||
string newsectiondir = "sections/"+id.input;
|
||||
string sectiondir = "sections/"+menu->selSection();
|
||||
string newsectiondir = "sections/" + id.getInput();
|
||||
string sectiondir = "sections/" + menu->selSection();
|
||||
ledOn();
|
||||
if (rename(sectiondir.c_str(), "tmpsection")==0 && rename("tmpsection", newsectiondir.c_str())==0) {
|
||||
string oldpng = sectiondir+".png", newpng = newsectiondir+".png";
|
||||
@ -1550,7 +1553,7 @@ void GMenu2X::renameSection() {
|
||||
sc.move("skin:"+oldpng, "skin:"+newpng);
|
||||
}
|
||||
}
|
||||
menu->sections[menu->selSectionIndex()] = id.input;
|
||||
menu->sections[menu->selSectionIndex()] = id.getInput();
|
||||
sync();
|
||||
}
|
||||
ledOff();
|
||||
|
@ -57,6 +57,7 @@ private:
|
||||
int kbLength, kbWidth, kbHeight, kbLeft;
|
||||
SDL_Rect kbRect;
|
||||
IconButton *btnBackspaceX, *btnBackspaceL, *btnSpace, *btnConfirm, *btnChangeKeys;
|
||||
string input;
|
||||
|
||||
void backspace();
|
||||
void space();
|
||||
@ -69,8 +70,8 @@ private:
|
||||
public:
|
||||
InputDialog(GMenu2X *gmenu2x, const string &text, const string &startvalue="", const string &title="", const string &icon="");
|
||||
|
||||
string input;
|
||||
bool exec();
|
||||
const string &getInput() { return input; }
|
||||
};
|
||||
|
||||
#endif /*INPUTDIALOG_H_*/
|
||||
|
@ -77,7 +77,7 @@ void MenuSettingString::clear()
|
||||
void MenuSettingString::edit()
|
||||
{
|
||||
InputDialog id(gmenu2x,description,value(), diagTitle,diagIcon);
|
||||
if (id.exec()) setValue(id.input);
|
||||
if (id.exec()) setValue(id.getInput());
|
||||
}
|
||||
|
||||
bool MenuSettingString::edited() {
|
||||
|
Loading…
Reference in New Issue
Block a user