mirror of
https://github.com/glest/glest-source.git
synced 2025-08-26 17:34:24 +02:00
- added a more graceful way to handle more serious errors during data validation commands in order to offer more detailed error analysis
This commit is contained in:
@@ -70,6 +70,7 @@ inline T truncateDecimal(const T &value, int precision=6) {
|
||||
if((T)value * (T)precNum <= MAX_INT_VALUE) {
|
||||
int resultInt = (T)value * (T)precNum;
|
||||
T result = (T)resultInt / precNum;
|
||||
//printf("=======================\nvalue = %.10f\nresultInt: %d\nprecision: %d\nbecame: %.10f\n----------\n",value,resultInt,precision,result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -60,12 +60,12 @@ const char * getDialogCommand() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool showMessage(const std::string & warning) {
|
||||
bool showMessage(std::string warning) {
|
||||
bool guiMessage = false;
|
||||
const char * dialogCommand = getDialogCommand();
|
||||
if (dialogCommand) {
|
||||
std::string command = dialogCommand;
|
||||
command += " --title \"Error\" --msgbox \"`printf \"" + warning + "\"`\"";
|
||||
command += " --title \"Error\" --msgbox \"`printf \"" + warning.erase(4096,std::string::npos) + "\"`\"";
|
||||
|
||||
//printf("\n\n\nzenity command [%s]\n\n\n",command.c_str());
|
||||
|
||||
@@ -79,9 +79,11 @@ bool showMessage(const std::string & warning) {
|
||||
}
|
||||
|
||||
void message(string message, bool isNonGraphicalModeEnabled) {
|
||||
std::cerr << "\n\n\n";
|
||||
std::cerr << "******************************************************\n";
|
||||
std::cerr << " " << message << "\n";
|
||||
std::cerr << "******************************************************\n";
|
||||
std::cerr << "\n\n\n";
|
||||
|
||||
if(isNonGraphicalModeEnabled == false) {
|
||||
showMessage(message);
|
||||
|
Reference in New Issue
Block a user