diff --git a/source/shared_lib/sources/platform/sdl/platform_util.cpp b/source/shared_lib/sources/platform/sdl/platform_util.cpp index de618555..cc31acca 100644 --- a/source/shared_lib/sources/platform/sdl/platform_util.cpp +++ b/source/shared_lib/sources/platform/sdl/platform_util.cpp @@ -51,12 +51,6 @@ const char * getDialogCommand() { return "zenity"; } - file = popen("which gdialog","r"); - //printf("File #1 [%p]\n",file); - if (file != NULL) { - pclose(file); - return "gdialog"; - } file = popen("which kdialog","r"); //printf("File #2 [%p]\n",file); if (file != NULL) { @@ -64,6 +58,20 @@ const char * getDialogCommand() { return "kdialog"; } + file = popen("which yad","r"); + //printf("File #1 [%p]\n",file); + if (file != NULL) { + pclose(file); + return "yad"; + } + + file = popen("which gdialog","r"); + //printf("File #1 [%p]\n",file); + if (file != NULL) { + pclose(file); + return "gdialog"; + } + return NULL; } @@ -83,7 +91,17 @@ bool showMessage(std::string warning,string writepath) { } //command += " --title \"Error\" --msgbox \"`printf \"" + warning + "\"`\""; - command += " --title \"Error\" --text-info --filename=" + text_file; + command += " --title \"Error\" "; + + if (dialogCommand == "kdialog") { + command += "--textbox " + text_file + " 640 360"; + } + else if (dialogCommand == "yad") { + command += "--text-info --center --wrap --width 640 --height 360 --filename=" + text_file; + } + else { + command += "--text-info --width 640 --height 360 --filename=" + text_file; + } //printf("\n\n\nzenity command [%s]\n\n\n",command.c_str());