fixed configuration for kdialog, added support for yad

This commit is contained in:
filux 2015-06-23 22:08:42 +02:00
parent 803526d866
commit 68cfb32e96
1 changed files with 25 additions and 7 deletions

View File

@ -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());