Commit 199a6d11 authored by Christoffer Ackelman's avatar Christoffer Ackelman

Changed all GUI-exe files to select gui according to priority 1.QT 2.GTK 3.MOTIF

parent 9f0278a2
...@@ -62,20 +62,18 @@ int main(int argc, char* argv[]) ...@@ -62,20 +62,18 @@ int main(int argc, char* argv[])
} }
} }
} }
if (!found) {
struct stat st;
strcpy(file, "$pwr_exe/wb_qt"); if (!found) {
dcli_translate_filename(file, file); const char *flavours[] = {"qt","gtk","motif"};
if (stat(file, &st) == 0) for (int i = 0; i < 3; i++) {
strcpy(wmg, "qt"); strcpy(file, "$pwr_exe/wb_");
else { strcat(file, flavours[i]);
strcpy(file, "$pwr_exe/wb_gtk");
dcli_translate_filename(file, file); dcli_translate_filename(file, file);
if (stat(file, &st) == 0) struct stat st;
strcpy(wmg, "gtk"); if (stat(file, &st) == 0) {
else strcpy(wmg, flavours[i]);
strcpy(wmg, "motif"); break;
}
} }
} }
......
...@@ -68,24 +68,23 @@ int main(int argc, char* argv[]) ...@@ -68,24 +68,23 @@ int main(int argc, char* argv[])
} }
if (!found) { if (!found) {
const char *flavours[] = {"qt","gtk","motif"};
for (int i = 0; i < 3; i++) {
strcpy(file, "$pwr_exe/wb_cmd_");
strcat(file, flavours[i]);
dcli_translate_filename(file, file);
struct stat st; struct stat st;
if (stat(file, &st) == 0) {
strcpy(wmg, flavours[i]);
break;
}
strcpy(file, "$pwr_exe/wb_cmd_qt"); strcpy(file, "$pwr_eexe/wb_cmd_");
dcli_translate_filename(file, file); strcat(file, flavours[i]);
if (stat(file, &st) != 0) {
strcpy(file, "$pwr_eexe/wb_cmd_qt");
dcli_translate_filename(file, file);
if (stat(file, &st) != 0) {
strcpy(file, "$pwr_exe/wb_cmd_gtk");
dcli_translate_filename(file, file); dcli_translate_filename(file, file);
if (stat(file, &st) != 0) { if (stat(file, &st) == 0) {
strcpy(file, "$pwr_eexe/wb_cmd_gtk"); strcpy(wmg, flavours[i]);
dcli_translate_filename(file, file); break;
if (stat(file, &st) != 0) {
printf("** wb_cmd not found %s\n", file);
exit(0);
}
}
} }
} }
} }
......
...@@ -62,15 +62,19 @@ int main(int argc, char* argv[]) ...@@ -62,15 +62,19 @@ int main(int argc, char* argv[])
} }
} }
} }
if (!found) {
struct stat st;
strcpy(file, "$pwr_exe/co_help_gtk"); if (!found) {
const char *flavours[] = {"qt","gtk"};
for (int i = 0; i < 2; i++) {
strcpy(file, "$pwr_exe/co_help_");
strcat(file, flavours[i]);
dcli_translate_filename(file, file); dcli_translate_filename(file, file);
if (stat(file, &st) == 0) struct stat st;
strcpy(wmg, "gtk"); if (stat(file, &st) == 0) {
else strcpy(wmg, flavours[i]);
strcpy(wmg, "motif"); break;
}
}
} }
strcpy(file, argv[0]); strcpy(file, argv[0]);
......
...@@ -36,16 +36,15 @@ ...@@ -36,16 +36,15 @@
/* pwr_rtmonitor.cpp Runtime Monitor */ /* pwr_rtmonitor.cpp Runtime Monitor */
#include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h>
#include "pwr.h" #include "co_dcli.h"
#include "co_string.h" #include "co_string.h"
static void usage() static void usage()
{ {
printf("\nUsage: pwr_rtmonitor [-f windowmgr]"); printf("\nUsage: pwr_rtmon [-f windowmgr]");
} }
int main(int argc, char* argv[]) int main(int argc, char* argv[])
...@@ -68,8 +67,20 @@ int main(int argc, char* argv[]) ...@@ -68,8 +67,20 @@ int main(int argc, char* argv[])
} }
} }
} }
if (!found)
strcpy(wmg, "gtk"); if (!found) {
const char *flavours[] = {"qt","gtk"};
for (int i = 0; i < 2; i++) {
strcpy(file, "$pwr_exe/pwr_rtmon_");
strcat(file, flavours[i]);
dcli_translate_filename(file, file);
struct stat st;
if (stat(file, &st) == 0) {
strcpy(wmg, flavours[i]);
break;
}
}
}
strcpy(file, argv[0]); strcpy(file, argv[0]);
strcat(file, "_"); strcat(file, "_");
......
...@@ -36,11 +36,10 @@ ...@@ -36,11 +36,10 @@
/* rt_statusmon.cpp Status Monitor */ /* rt_statusmon.cpp Status Monitor */
#include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h>
#include "pwr.h" #include "co_dcli.h"
#include "co_string.h" #include "co_string.h"
static void usage() static void usage()
...@@ -68,8 +67,20 @@ int main(int argc, char* argv[]) ...@@ -68,8 +67,20 @@ int main(int argc, char* argv[])
} }
} }
} }
if (!found)
strcpy(wmg, "gtk"); if (!found) {
const char *flavours[] = {"qt","gtk"};
for (int i = 0; i < 2; i++) {
strcpy(file, "$pwr_exe/rt_statusmon_");
strcat(file, flavours[i]);
dcli_translate_filename(file, file);
struct stat st;
if (stat(file, &st) == 0) {
strcpy(wmg, flavours[i]);
break;
}
}
}
strcpy(file, argv[0]); strcpy(file, argv[0]);
strcat(file, "_"); strcat(file, "_");
......
...@@ -62,20 +62,18 @@ int main(int argc, char* argv[]) ...@@ -62,20 +62,18 @@ int main(int argc, char* argv[])
} }
} }
} }
if (!found) {
struct stat st;
strcpy(file, "$pwr_exe/rt_xtt_qt"); if (!found) {
dcli_translate_filename(file, file); const char *flavours[] = {"qt","gtk","motif"};
if (stat(file, &st) == 0) for (int i = 0; i < 3; i++) {
strcpy(wmg, "qt"); strcpy(file, "$pwr_exe/rt_xtt_");
else { strcat(file, flavours[i]);
strcpy(file, "$pwr_exe/rt_xtt_gtk");
dcli_translate_filename(file, file); dcli_translate_filename(file, file);
if (stat(file, &st) == 0) struct stat st;
strcpy(wmg, "gtk"); if (stat(file, &st) == 0) {
else strcpy(wmg, flavours[i]);
strcpy(wmg, "motif"); break;
}
} }
} }
......
...@@ -62,15 +62,19 @@ int main(int argc, char* argv[]) ...@@ -62,15 +62,19 @@ int main(int argc, char* argv[])
} }
} }
} }
if (!found) {
struct stat st;
strcpy(file, "$pwr_exe/rt_xtt_cmd_gtk"); if (!found) {
const char *flavours[] = {"qt","gtk"};
for (int i = 0; i < 2; i++) {
strcpy(file, "$pwr_exe/rt_xtt_cmd_");
strcat(file, flavours[i]);
dcli_translate_filename(file, file); dcli_translate_filename(file, file);
if (stat(file, &st) == 0) struct stat st;
strcpy(wmg, "gtk"); if (stat(file, &st) == 0) {
else strcpy(wmg, flavours[i]);
strcpy(wmg, "motif"); break;
}
}
} }
strcpy(file, argv[0]); strcpy(file, argv[0]);
......
...@@ -36,11 +36,10 @@ ...@@ -36,11 +36,10 @@
/* wb_ge.c -- graphical editor */ /* wb_ge.c -- graphical editor */
#include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h>
#include "pwr.h" #include "co_dcli.h"
#include "co_string.h" #include "co_string.h"
static void usage() static void usage()
...@@ -68,8 +67,20 @@ int main(int argc, char* argv[]) ...@@ -68,8 +67,20 @@ int main(int argc, char* argv[])
} }
} }
} }
if (!found)
strcpy(wmg, "gtk"); if (!found) {
const char *flavours[] = {"qt","gtk","motif"};
for (int i = 0; i < 3; i++) {
strcpy(file, "$pwr_exe/wb_ge_");
strcat(file, flavours[i]);
dcli_translate_filename(file, file);
struct stat st;
if (stat(file, &st) == 0) {
strcpy(wmg, flavours[i]);
break;
}
}
}
strcpy(file, argv[0]); strcpy(file, argv[0]);
strcat(file, "_"); strcat(file, "_");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment