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[])
}
}
}
if (!found) {
struct stat st;
strcpy(file, "$pwr_exe/wb_qt");
dcli_translate_filename(file, file);
if (stat(file, &st) == 0)
strcpy(wmg, "qt");
else {
strcpy(file, "$pwr_exe/wb_gtk");
if (!found) {
const char *flavours[] = {"qt","gtk","motif"};
for (int i = 0; i < 3; i++) {
strcpy(file, "$pwr_exe/wb_");
strcat(file, flavours[i]);
dcli_translate_filename(file, file);
if (stat(file, &st) == 0)
strcpy(wmg, "gtk");
else
strcpy(wmg, "motif");
struct stat st;
if (stat(file, &st) == 0) {
strcpy(wmg, flavours[i]);
break;
}
}
}
......
......@@ -68,24 +68,23 @@ int main(int argc, char* argv[])
}
if (!found) {
struct stat st;
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;
if (stat(file, &st) == 0) {
strcpy(wmg, flavours[i]);
break;
}
strcpy(file, "$pwr_exe/wb_cmd_qt");
dcli_translate_filename(file, file);
if (stat(file, &st) != 0) {
strcpy(file, "$pwr_eexe/wb_cmd_qt");
strcpy(file, "$pwr_eexe/wb_cmd_");
strcat(file, flavours[i]);
dcli_translate_filename(file, file);
if (stat(file, &st) != 0) {
strcpy(file, "$pwr_exe/wb_cmd_gtk");
dcli_translate_filename(file, file);
if (stat(file, &st) != 0) {
strcpy(file, "$pwr_eexe/wb_cmd_gtk");
dcli_translate_filename(file, file);
if (stat(file, &st) != 0) {
printf("** wb_cmd not found %s\n", file);
exit(0);
}
}
if (stat(file, &st) == 0) {
strcpy(wmg, flavours[i]);
break;
}
}
}
......
......@@ -62,15 +62,19 @@ int main(int argc, char* argv[])
}
}
}
if (!found) {
struct stat st;
strcpy(file, "$pwr_exe/co_help_gtk");
dcli_translate_filename(file, file);
if (stat(file, &st) == 0)
strcpy(wmg, "gtk");
else
strcpy(wmg, "motif");
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);
struct stat st;
if (stat(file, &st) == 0) {
strcpy(wmg, flavours[i]);
break;
}
}
}
strcpy(file, argv[0]);
......
......@@ -36,16 +36,15 @@
/* pwr_rtmonitor.cpp Runtime Monitor */
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include "pwr.h"
#include "co_dcli.h"
#include "co_string.h"
static void usage()
{
printf("\nUsage: pwr_rtmonitor [-f windowmgr]");
printf("\nUsage: pwr_rtmon [-f windowmgr]");
}
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]);
strcat(file, "_");
......
......@@ -36,11 +36,10 @@
/* rt_statusmon.cpp Status Monitor */
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include "pwr.h"
#include "co_dcli.h"
#include "co_string.h"
static void usage()
......@@ -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]);
strcat(file, "_");
......
......@@ -62,20 +62,18 @@ int main(int argc, char* argv[])
}
}
}
if (!found) {
struct stat st;
strcpy(file, "$pwr_exe/rt_xtt_qt");
dcli_translate_filename(file, file);
if (stat(file, &st) == 0)
strcpy(wmg, "qt");
else {
strcpy(file, "$pwr_exe/rt_xtt_gtk");
if (!found) {
const char *flavours[] = {"qt","gtk","motif"};
for (int i = 0; i < 3; i++) {
strcpy(file, "$pwr_exe/rt_xtt_");
strcat(file, flavours[i]);
dcli_translate_filename(file, file);
if (stat(file, &st) == 0)
strcpy(wmg, "gtk");
else
strcpy(wmg, "motif");
struct stat st;
if (stat(file, &st) == 0) {
strcpy(wmg, flavours[i]);
break;
}
}
}
......
......@@ -62,15 +62,19 @@ int main(int argc, char* argv[])
}
}
}
if (!found) {
struct stat st;
strcpy(file, "$pwr_exe/rt_xtt_cmd_gtk");
dcli_translate_filename(file, file);
if (stat(file, &st) == 0)
strcpy(wmg, "gtk");
else
strcpy(wmg, "motif");
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);
struct stat st;
if (stat(file, &st) == 0) {
strcpy(wmg, flavours[i]);
break;
}
}
}
strcpy(file, argv[0]);
......
......@@ -36,11 +36,10 @@
/* wb_ge.c -- graphical editor */
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include "pwr.h"
#include "co_dcli.h"
#include "co_string.h"
static void usage()
......@@ -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]);
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