mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-04-21 12:27:27 +03:00
Replaced every message output by calls to the log macros.
This commit is contained in:
33
src/menu.cpp
33
src/menu.cpp
@@ -31,6 +31,7 @@
|
||||
#include "menu.h"
|
||||
#include "filelister.h"
|
||||
#include "utilities.h"
|
||||
#include "debug.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -207,9 +208,8 @@ bool Menu::addLink(string path, string file, string section) {
|
||||
linkpath = "sections/"+section+"/"+title+linkpath;
|
||||
x++;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
cout << "\033[0;34mGMENU2X:\033[0m Adding link: " << linkpath << endl;
|
||||
#endif
|
||||
|
||||
INFO("Adding link: '%s'\n", linkpath.c_str());
|
||||
|
||||
if (path[path.length()-1]!='/') path += "/";
|
||||
//search for a manual
|
||||
@@ -241,9 +241,8 @@ bool Menu::addLink(string path, string file, string section) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
cout << "\033[0;34mGMENU2X:\033[0m Manual: " << manual << endl;
|
||||
#endif
|
||||
|
||||
INFO("Manual: '%s'\n", manual.c_str());
|
||||
|
||||
string shorttitle=title, description="", exec=path+file, icon="";
|
||||
|
||||
@@ -266,17 +265,17 @@ bool Menu::addLink(string path, string file, string section) {
|
||||
sync();
|
||||
int isection = find(sections.begin(),sections.end(),section) - sections.begin();
|
||||
if (isection>=0 && isection<(int)sections.size()) {
|
||||
#ifdef DEBUG
|
||||
cout << "\033[0;34mGMENU2X:\033[0m Section: " << sections[isection] << "(" << isection << ")" << endl;
|
||||
#endif
|
||||
|
||||
INFO("Section: '%s(%i)'\n", sections[isection].c_str(), isection);
|
||||
|
||||
LinkApp* link = new LinkApp(gmenu2x, gmenu2x->input, linkpath.c_str());
|
||||
link->setSize(gmenu2x->skinConfInt["linkWidth"],gmenu2x->skinConfInt["linkHeight"]);
|
||||
links[isection].push_back( link );
|
||||
}
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
cout << "\033[0;34mGMENU2X:\033[0;31m Error while opening the file '" << linkpath << "' for write\033[0m" << endl;
|
||||
#endif
|
||||
|
||||
ERROR("Error while opening the file '%s' for write.\n", linkpath.c_str());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -295,9 +294,8 @@ bool Menu::addSection(const string §ionName) {
|
||||
}
|
||||
|
||||
void Menu::deleteSelectedLink() {
|
||||
#ifdef DEBUG
|
||||
cout << "\033[0;34mGMENU2X:\033[0m Deleting link " << selLink()->getTitle() << endl;
|
||||
#endif
|
||||
INFO("Deleting link '%s'\n", selLink()->getTitle().c_str());
|
||||
|
||||
if (selLinkApp()!=NULL)
|
||||
unlink(selLinkApp()->getFile().c_str());
|
||||
gmenu2x->sc.del(selLink()->getIconPath());
|
||||
@@ -306,9 +304,8 @@ void Menu::deleteSelectedLink() {
|
||||
}
|
||||
|
||||
void Menu::deleteSelectedSection() {
|
||||
#ifdef DEBUG
|
||||
cout << "\033[0;34mGMENU2X:\033[0m Deleting section " << selSection() << endl;
|
||||
#endif
|
||||
INFO("Deleting section '%s'\n", selSection().c_str());
|
||||
|
||||
gmenu2x->sc.del("sections/"+selSection()+".png");
|
||||
links.erase( links.begin()+selSectionIndex() );
|
||||
sections.erase( sections.begin()+selSectionIndex() );
|
||||
|
||||
Reference in New Issue
Block a user