Change Details
data/translations/Basque |
95 | 95 | Insert a new name for this section=Sekzio honetarako izen berria sartu |
96 | 96 | Yes=Bai |
97 | 97 | No=Ez |
98 | | You will lose all the links in this section.=Sekzio honetako esteka guztiak galduko dira |
99 | 98 | Exit=Irten |
100 | 99 | Link Scanner=Esteka bilatzailea |
101 | 100 | Scanning SD filesystem...=SD txartela arakatzen... |
data/translations/Catalan |
97 | 97 | Insert a new name for this section=Introduir nou nom per a la secció |
98 | 98 | Yes=Si |
99 | 99 | No=No |
100 | | You will lose all the links in this section.=Es perdran tots els enllaços d'aquesta secció. |
101 | 100 | Exit=Sortir |
102 | 101 | Link Scanner=Buscador d'enllaços |
103 | 102 | Scanning SD filesystem...=Explorant el sistema de fitxers de la SD... |
data/translations/Danish |
100 | 100 | Insert a new name for this section=Angiv nyt navn for denne sektion |
101 | 101 | Yes=Ja |
102 | 102 | No=Nej |
103 | | You will lose all the links in this section.=Du vil miste alle genveje i denne sektion. |
104 | 103 | Exit=Afslut |
105 | 104 | Link Scanner=Skan genveje |
106 | 105 | Scanning SD filesystem...=Skanner SD filsystem... |
data/translations/Dutch |
97 | 97 | Insert a new name for this section=Geef een nieuwe naam voor deze groep |
98 | 98 | Yes=Ja |
99 | 99 | No=Nee |
100 | | You will lose all the links in this section.=Alle snelkoppelingen in deze groep worden gewist. |
101 | 100 | Exit=Verlaat |
102 | 101 | Link Scanner=Snelkoppeling-Scanner |
103 | 102 | Scanning SD filesystem...=Scant het SD-bestandssysteem... |
data/translations/Finnish |
97 | 97 | Insert a new name for this section=Anna uusi nimi t�lle v�lilehdelle |
98 | 98 | Yes=Kyll� |
99 | 99 | No=Ei |
100 | | You will lose all the links in this section.=Menet�t kaikki t�ss� v�lilehdess� olevat linkit. |
101 | 100 | Exit=Poistu |
102 | 101 | Link Scanner=Linkkiskanneri |
103 | 102 | Scanning SD filesystem...=Skannataan SD-tiedostoj�rjestelm��... |
... | ... | |
69 | 69 | Insert a new name for this section=Saisir un nouveau nom pour cette section |
70 | 70 | Yes=Oui |
71 | 71 | No=Non |
72 | | You will lose all the links in this section.=Vous perdrez tous les liens dans cette section. |
73 | 72 | Exit=Quitter |
74 | 73 | Log Viewer=Journal |
75 | 74 | Displays last launched program's output=Afficher la sortie du dernier programme lancé |
data/translations/German |
97 | 97 | Insert a new name for this section=Neuer Name für diese Sektion |
98 | 98 | Yes=Ja |
99 | 99 | No=Nein |
100 | | You will lose all the links in this section.=Alle Links in dieser Sektion gehen verloren. |
101 | 100 | Exit=Beenden |
102 | 101 | Link Scanner=Links suchen |
103 | 102 | Scanning SD filesystem...=SD-Karte wird durchsucht... |
data/translations/Italian |
97 | 97 | Insert a new name for this section=Inserisci un nuovo nome per questa sezione |
98 | 98 | Yes=Si |
99 | 99 | No=No |
100 | | You will lose all the links in this section.=Perderai tutti i collegamenti in questa sezione. |
101 | 100 | Exit=Esci |
102 | 101 | Link Scanner=Scanner di collegamenti |
103 | 102 | Scanning SD filesystem...=Scansione del filesystem della SD... |
data/translations/Norwegian |
69 | 69 | Insert a new name for this section=Sett inn et nytt navn for denne katalogen |
70 | 70 | Yes=Ja |
71 | 71 | No=Nei |
72 | | You will lose all the links in this section.=Du vil miste alle linker i denne katalogen |
73 | 72 | Exit=Utgang |
74 | 73 | Log Viewer=Logg leser |
75 | 74 | Displays last launched program's output=Viser det siste lanserte programmets utgang |
data/translations/Polish |
69 | 69 | Insert a new name for this section=Wstaw nową nazwę dla tej sekcji |
70 | 70 | Yes=Tak |
71 | 71 | No=Nie |
72 | | You will lose all the links in this section.=Wszystkie odnośniki w tej sekcji zostaną utracone. |
73 | 72 | Exit=Wyjdź |
74 | 73 | Log Viewer=Dziennik zdarzeń |
75 | 74 | Displays last launched program's output=Wyświetla wyjście ostatnio uruchamianego programu |
data/translations/Portuguese (Brazil) |
70 | 70 | Insert a new name for this section=Insira um novo nome para esta seção |
71 | 71 | Yes=Sim |
72 | 72 | No=Não |
73 | | You will lose all the links in this section.=Você perderá todos os atalho desta seção. |
74 | 73 | Exit=Sair |
75 | 74 | Log Viewer=Visualizador de Logs |
76 | 75 | Displays last launched program's output=Mostrar a saída do último programa executado |
data/translations/Portuguese (Portugal) |
97 | 97 | Insert a new name for this section=Insira um novo nome para esta secção |
98 | 98 | Yes=Sim |
99 | 99 | No=Não |
100 | | You will lose all the links in this section.=Perderá todos os links desta secção. |
101 | 100 | Exit=Sair |
102 | 101 | Link Scanner=Pesquisador de links |
103 | 102 | Scanning SD filesystem...=A pesquisar o filesystem do SD... |
data/translations/Russian |
97 | 97 | Insert a new name for this section=Впишите новое имя для этой секции |
98 | 98 | Yes=Да |
99 | 99 | No=Нет |
100 | | You will lose all the links in this section.=Вы потеряете все ссылки в этой секции |
101 | 100 | Exit=Выход |
102 | 101 | Link Scanner=Поиск ссылок |
103 | 102 | Scanning SD filesystem...=Сканирование SD... |
data/translations/Slovak |
97 | 97 | Insert a new name for this section=Zadajte nový názov pre túto sekciu |
98 | 98 | Yes=Áno |
99 | 99 | No=Nie |
100 | | You will lose all the links in this section.=Stratíte všetky odkazy v tejto sekcii. |
101 | 100 | Exit=Ukončiť |
102 | 101 | Link Scanner=Vyhľadávač odkazov |
103 | 102 | Scanning SD filesystem...=Prehľadávam súborový systém na SD karte... |
data/translations/Spanish |
95 | 95 | Insert a new name for this section=Insertar nuevo nombre para la sección |
96 | 96 | Yes=Si |
97 | 97 | No=No |
98 | | You will lose all the links in this section.=Se perderán todos los enlaces de esta sección. |
99 | 98 | Exit=Salir |
100 | 99 | Link Scanner=Buscador de enlaces |
101 | 100 | Scanning SD filesystem...=Explorando sistema de archivos de SD... |
data/translations/Swedish |
97 | 97 | Insert a new name for this section=Skriv in namn för den här avdelningen |
98 | 98 | Yes=Ja |
99 | 99 | No=Nej |
100 | | You will lose all the links in this section.=Du kommer att förlora alla länkar i den här |
101 | 100 | avdelningen. |
102 | 101 | Exit=Avsluta |
103 | 102 | Link Scanner=Länkscanner |
data/translations/Turkish |
97 | 97 | Insert a new name for this section=Bu bölüm için yeni isim girin |
98 | 98 | Yes=Evet |
99 | 99 | No=Hayir |
100 | | You will lose all the links in this section.=Bu bölümdeki tüm linkleri kaybedeceksiniz. |
101 | 100 | Exit=Çikis |
102 | 101 | Link Scanner=Link taramasi |
103 | 102 | Scanning SD filesystem...=SD karti taraniyor... |
src/contextmenu.cpp |
71 | 71 | options.push_back(std::make_shared<MenuOption>( |
72 | 72 | tr["Add section"], |
73 | 73 | std::bind(&GMenu2X::addSection, &gmenu2x))); |
74 | | options.push_back(std::make_shared<MenuOption>( |
75 | | tr["Delete section"], |
76 | | std::bind(&GMenu2X::deleteSection, &gmenu2x))); |
| 74 | if (menu.sectionLinks()->empty()) { |
| 75 | options.push_back(std::make_shared<MenuOption>( |
| 76 | tr["Delete section"], |
| 77 | std::bind(&GMenu2X::deleteSection, &gmenu2x))); |
| 78 | } |
77 | 79 | |
78 | 80 | // Compute bounding box. |
79 | 81 | int w = 0; |
src/gmenu2x.cpp |
1024 | 1024 | } |
1025 | 1025 | } |
1026 | 1026 | |
1027 | | void GMenu2X::deleteSection() { |
1028 | | MessageBox mb(*this,tr["You will lose all the links in this section."]+"\n"+tr["Are you sure?"]); |
1029 | | mb.setButton(InputManager::ACCEPT, tr["Yes"]); |
1030 | | mb.setButton(InputManager::CANCEL, tr["No"]); |
1031 | | if (mb.exec() == InputManager::ACCEPT) { |
1032 | | |
1033 | | if (rmtree(getHome() + "/sections/" + menu->selSection())) |
1034 | | menu->deleteSelectedSection(); |
| 1027 | void GMenu2X::deleteSection() |
| 1028 | { |
| 1029 | string path = getHome() + "/sections/" + menu->selSection(); |
| 1030 | if (rmdir(path.c_str()) && errno != ENOENT) { |
| 1031 | WARNING("Removal of section dir \"%s\" failed: %s\n", |
| 1032 | path.c_str(), strerror(errno)); |
1035 | 1033 | } |
| 1034 | menu->deleteSelectedSection(); |
1036 | 1035 | } |
1037 | 1036 | |
1038 | 1037 | #ifdef ENABLE_CPUFREQ |
src/menu.h |
71 | 71 | */ |
72 | 72 | void calcSectionRange(int &leftSection, int &rightSection); |
73 | 73 | |
74 | | std::vector<std::unique_ptr<Link>> *sectionLinks(int i = -1); |
75 | | |
76 | 74 | void readLinks(); |
77 | 75 | void freeLinks(); |
78 | 76 | |
... | ... | |
160 | 158 | void setLinkIndex(int i); |
161 | 159 | |
162 | 160 | const std::vector<std::string> &getSections() { return sections; } |
| 161 | std::vector<std::unique_ptr<Link>> *sectionLinks(int i = -1); |
163 | 162 | }; |
164 | 163 | |
165 | 164 | #endif // MENU_H |
src/utilities.cpp |
160 | 160 | return access(file.c_str(), F_OK) == 0; |
161 | 161 | } |
162 | 162 | |
163 | | bool rmtree(string path) { |
164 | | DIR *dirp; |
165 | | struct stat st; |
166 | | struct dirent *dptr; |
167 | | string filepath; |
168 | | |
169 | | DEBUG("RMTREE: '%s'\n", path.c_str()); |
170 | | |
171 | | if ((dirp = opendir(path.c_str())) == NULL) return false; |
172 | | if (path[path.length()-1]!='/') path += "/"; |
173 | | |
174 | | while ((dptr = readdir(dirp))) { |
175 | | filepath = dptr->d_name; |
176 | | if (filepath=="." || filepath=="..") continue; |
177 | | filepath = path+filepath; |
178 | | int statRet = stat(filepath.c_str(), &st); |
179 | | if (statRet == -1) continue; |
180 | | if (S_ISDIR(st.st_mode)) { |
181 | | if (!rmtree(filepath)) return false; |
182 | | } else { |
183 | | if (unlink(filepath.c_str())!=0) return false; |
184 | | } |
185 | | } |
186 | | |
187 | | closedir(dirp); |
188 | | return rmdir(path.c_str())==0; |
189 | | } |
190 | | |
191 | 163 | int constrain(int x, int imin, int imax) { |
192 | 164 | return min(imax, max(imin, x)); |
193 | 165 | } |
src/utilities.h |
79 | 79 | } |
80 | 80 | |
81 | 81 | bool fileExists(const std::string &file); |
82 | | bool rmtree(std::string path); |
83 | 82 | |
84 | 83 | int constrain(int x, int imin, int imax); |
85 | 84 | |
Download the corresponding diff file