aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-08 08:07:25 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-08 08:07:25 +0200
commit9815f32d5c7c397c5a27a53764565beda2d007c2 (patch)
tree55ce7e5f2b870f03880358450eebb933cd845d1e
parentc3476b6a801ae6355664d5af24ab5a87022c58f6 (diff)
parent5dcb19b3d7ae4910f3d3cd1015b0840e7d4bf11d (diff)
downloadnx-libs-9815f32d5c7c397c5a27a53764565beda2d007c2.tar.gz
nx-libs-9815f32d5c7c397c5a27a53764565beda2d007c2.tar.bz2
nx-libs-9815f32d5c7c397c5a27a53764565beda2d007c2.zip
Merge branch 'uli42-pr/dialog_text' into 3.6.x
Attributes GH PR #1004: https://github.com/ArcticaProject/nx-libs/pull/1004
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Dialog.h4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keystroke.c4
-rw-r--r--nxcomp/src/Children.cpp60
3 files changed, 47 insertions, 21 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h
index b11df5045..d0295f81c 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h
@@ -192,9 +192,7 @@ by dragging the desktop with the mouse while pressing\n\
Ctrl+Alt or use the keystrokes listed below. Press\n\
%s again to return to the desktop resize mode.\n\
\n\
-Use these keystrokes to navigate:\n\
-%s\
-"
+Use these keystrokes to navigate:%s"
#define DIALOG_DISABLE_DESKTOP_RESIZE_MODE_TYPE "ok"
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
index 9a7c1cd65..aff2e56ab 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
@@ -513,13 +513,13 @@ char *nxagentFindMatchingKeystrokes(char *name)
{
char *tmp;
char *tmp1 = nxagentGetSingleKeystrokeString(cur);
- if (-1 == asprintf(&tmp, "%s %-*s : %s\n", res, maxlen,
+ if (-1 == asprintf(&tmp, "%s\n %-*s : %s", res, maxlen,
nxagentSpecialKeystrokeNames[cur->stroke],
tmp1))
{
SAFE_free(tmp1);
#ifdef TEST
- fprintf(stderr, "%s: returning incomplete result:\n%s", __func__, res);
+ fprintf(stderr, "%s: returning incomplete result:%s\n", __func__, res);
#endif
return res;
}
diff --git a/nxcomp/src/Children.cpp b/nxcomp/src/Children.cpp
index 036cffa95..2e89f2e68 100644
--- a/nxcomp/src/Children.cpp
+++ b/nxcomp/src/Children.cpp
@@ -216,7 +216,16 @@ int NXTransDialog(const char *caption, const char *message,
UnsetEnv("LD_LIBRARY_PATH");
- for (int i = 0; i < 2; i++)
+ if (!pulldown)
+ {
+ cerr << "Info: Upcoming dialog:\n"
+ << "/-----------------------------------------------------------\n"
+ << caption << ":\n"
+ << message << "\n"
+ << "\\-----------------------------------------------------------\n";
+ }
+
+ for (int i = 0; i < 4; i++)
{
if (local != 0)
{
@@ -249,58 +258,63 @@ int NXTransDialog(const char *caption, const char *message,
}
}
- #ifdef WARNING
+ #ifdef TEST
*logofs << "NXTransDialog: WARNING! Couldn't start '"
<< command << "'. " << "Error is " << EGET()
<< " '" << ESTR() << "'.\n" << logofs_flush;
#endif
+ #ifdef WARNING
cerr << "Warning" << ": Couldn't start '" << command
<< "'. Error is " << EGET() << " '" << ESTR()
<< "'.\n";
+ #endif
//
// Retry by looking for the default name
// in the default NX path.
//
- if (i == 0)
+ if (i == 0 || i == 2)
{
-
strcpy(command, "nxclient");
+ }
+ else if (i == 1 || i == 3)
+ {
+ strcpy(command, "nxdialog");
+ }
+ if (i == 2)
+ {
char newPath[DEFAULT_STRING_LIMIT];
strcpy(newPath, "/usr/NX/bin:/opt/NX/bin:/usr/local/NX/bin:");
#ifdef __APPLE__
-
// FIXME: missing length limitation!
strcat(newPath, "/Applications/NX Client for OSX.app/Contents/MacOS:");
-
#endif
#ifdef __CYGWIN32__
-
// FIXME: missing length limitation!
strcat(newPath, ".:");
-
#endif
int newLength = strlen(newPath);
-
char *oldPath = getenv("PATH");
// FIXME: check if strncat would be better here
snprintf(newPath + newLength, DEFAULT_STRING_LIMIT - newLength, "%s", oldPath);
- #ifdef WARNING
+ #ifdef TEST
*logofs << "NXTransDialog: WARNING! Trying with path '"
<< newPath << "'.\n" << logofs_flush;
#endif
+ #ifdef WARNING
cerr << "Warning" << ": Trying with path '" << newPath
<< "'.\n";
+ #endif
//
// Solaris doesn't seem to have
@@ -308,22 +322,36 @@ int NXTransDialog(const char *caption, const char *message,
//
#ifdef __sun
-
char newEnv[DEFAULT_STRING_LIMIT + 5];
-
sprintf(newEnv,"PATH=%s", newPath);
-
putenv(newEnv);
-
#else
-
setenv("PATH", newPath, 1);
-
+ #endif
+ }
+ else
+ {
+ #ifdef TEST
+ *logofs << "NXTransDialog: WARNING! Trying with command '"
+ << command << "'.\n" << logofs_flush;
#endif
+ #ifdef WARNING
+ cerr << "Warning" << ": Trying with command '" << command
+ << "'.\n";
+ #endif
}
}
+ #ifdef TEST
+ *logofs << "NXTransDialog: WARNING! Could not display dialog.\n"
+ << logofs_flush;
+ #endif
+
+ #ifdef WARNING
+ cerr << "Warning" << ": Could not display dialog.\n";
+ #endif
+
//
// Hopefully useless.
//