]> granicus.if.org Git - nethack/commitdiff
more Qt "about nethack"
authorPatR <rankin@nethack.org>
Wed, 5 Aug 2020 17:55:10 +0000 (10:55 -0700)
committerPatR <rankin@nethack.org>
Wed, 5 Aug 2020 17:55:10 +0000 (10:55 -0700)
The presence of longer lines has made the 'about' box become wider
so combine the first two short lines into one longer one.

Switching to the longer nethack version string resulted in "This
is NetHack MacOSX Nethack ..." so remove the initial "NetHack"
from the 'about' box's format string.  That version string also
includes a final period; strip that off since "with Qt 5.x.y."
follows it to end the sentence.

Still some issues:

The application menu has first entry "nethack" which ought to be
capitalized but I haven't been able to figure out how to accomplish
that.

Some code in qt_main.cpp tries to add an extra instance of "about
NetHack" to the game window's "Help" menu but it doesn't show up.

win/Qt/qt_main.cpp

index 7662639ef3e17ae1fb988f9d19b4da03c688a6c1..ce0954d2e569304a746d52cec5cd4a5a5454cb62 100644 (file)
@@ -439,18 +439,23 @@ static const char * cast_c_xpm[] UNUSED = {
 static QString
 aboutMsg()
 {
-    char vbuf[BUFSZ];
+    char *p, vbuf[BUFSZ];
+    /* nethack's getversionstring() includes a final period
+       but we're using it mid-sentence so strip period off */
+    if ((p = strrchr(getversionstring(vbuf), '.')) != 0 && *(p + 1) == '\0')
+        *p = '\0';
     QString msg;
     msg.sprintf(
         // format
-        "Qt NetHack is a version of NetHack\n"
-        "built using"           // no newline
+        "Qt NetHack is a version of NetHack built using" // no newline
 #ifdef KDE
-        " KDE and"              // ditto
+        " KDE and"                                       // ditto
 #endif
-        " the Qt %d GUI toolkit.\n"
-        "\nThis is NetHack %s%s.\n"
-        "\nNetHack's Qt interface originally developed by Warwick Allison.\n"
+        " the Qt %d GUI toolkit.\n"                      // short Qt version
+        "\n"
+        "This is %s%s.\n"       // long nethack version and full Qt version
+        "\n"
+        "NetHack's Qt interface originally developed by Warwick Allison.\n"
         "\n"
 #if 0
         "Homepage:\n     http://trolls.troll.no/warwick/nethack/\n" //obsolete
@@ -463,14 +468,14 @@ aboutMsg()
 #else
         "Qt:\n     http://www.troll.no/\n"      // obsolete
 #endif
-        "NetHack:\n     %s\n",
+        "NetHack:\n     %s\n", // DEVTEAM_URL
         // arguments
 #ifdef QT_VERSION_MAJOR
         QT_VERSION_MAJOR,
 #else
         5,              // Qt version macro should exist; if not, assume Qt5
 #endif
-        getversionstring(vbuf), /* nethack version */
+        vbuf,           // nethack version
 #ifdef QT_VERSION_STR
         " with Qt " QT_VERSION_STR,
 #else