Date:2010-07-26 05:58:06 (13 years 8 months ago)
Author:Maarten ter Huurne
Commit:40ead3b6425df9931eb7d5cea1dd2e5322980626
Message:Converted public fields of InputDialog to private.

Files: src/gmenu2x.cpp (3 diffs)
src/inputdialog.h (2 diffs)
src/menusettingstring.cpp (1 diff)

Change Details

src/gmenu2x.cpp
15161516    InputDialog id(this,tr["Insert a name for the new section"]);
15171517    if (id.exec()) {
15181518        //only if a section with the same name does not exist
1519        if (find(menu->sections.begin(),menu->sections.end(),id.input)==menu->sections.end()) {
1519        if (find(menu->sections.begin(), menu->sections.end(), id.getInput())
1520                == menu->sections.end()) {
15201521            //section directory doesn't exists
15211522            ledOn();
1522            if (menu->addSection(id.input)) {
1523            if (menu->addSection(id.getInput())) {
15231524                menu->setSectionIndex( menu->sections.size()-1 ); //switch to the new section
15241525                sync();
15251526            }
...... 
15321533    InputDialog id(this,tr["Insert a new name for this section"],menu->selSection());
15331534    if (id.exec()) {
15341535        //only if a section with the same name does not exist & !samename
1535        if (menu->selSection()!=id.input && find(menu->sections.begin(),menu->sections.end(),id.input)==menu->sections.end()) {
1536        if (menu->selSection() != id.getInput()
1537         && find(menu->sections.begin(),menu->sections.end(), id.getInput())
1538                == menu->sections.end()) {
15361539            //section directory doesn't exists
1537            string newsectiondir = "sections/"+id.input;
1538            string sectiondir = "sections/"+menu->selSection();
1540            string newsectiondir = "sections/" + id.getInput();
1541            string sectiondir = "sections/" + menu->selSection();
15391542            ledOn();
15401543            if (rename(sectiondir.c_str(), "tmpsection")==0 && rename("tmpsection", newsectiondir.c_str())==0) {
15411544                string oldpng = sectiondir+".png", newpng = newsectiondir+".png";
...... 
15501553                        sc.move("skin:"+oldpng, "skin:"+newpng);
15511554                    }
15521555                }
1553                menu->sections[menu->selSectionIndex()] = id.input;
1556                menu->sections[menu->selSectionIndex()] = id.getInput();
15541557                sync();
15551558            }
15561559            ledOff();
src/inputdialog.h
5757    int kbLength, kbWidth, kbHeight, kbLeft;
5858    SDL_Rect kbRect;
5959    IconButton *btnBackspaceX, *btnBackspaceL, *btnSpace, *btnConfirm, *btnChangeKeys;
60    string input;
6061
6162    void backspace();
6263    void space();
...... 
6970public:
7071    InputDialog(GMenu2X *gmenu2x, const string &text, const string &startvalue="", const string &title="", const string &icon="");
7172
72    string input;
7373    bool exec();
74    const string &getInput() { return input; }
7475};
7576
7677#endif /*INPUTDIALOG_H_*/
src/menusettingstring.cpp
7777void MenuSettingString::edit()
7878{
7979    InputDialog id(gmenu2x,description,value(), diagTitle,diagIcon);
80    if (id.exec()) setValue(id.input);
80    if (id.exec()) setValue(id.getInput());
8181}
8282
8383bool MenuSettingString::edited() {

Archive Download the corresponding diff file



interactive