gprofng-gui-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add the gprofng GUI version to the About panel.


From: vladimir . mezentsev
Subject: [PATCH] Add the gprofng GUI version to the About panel.
Date: Sun, 21 Jan 2024 13:42:16 -0800

From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

ChangeLog
2024-01-21  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

        * Makefile.am: Put the gprofng GUI version to Bundle.properties.
        * org/gprofng/mpmt/AboutPanel.java: Show the gprofng GUI version.
        * org/gprofng/mpmt/Analyzer.java: Remove the hardcoded VERSION string.
        * org/gprofng/mpmt/icons/README.license: Fix Copyrights.
        * NEW: Likewise.
        * gprofng-gui.spec: Likewise.
        * rpmbuild.sh: Likewise.
---
 Makefile.am                           |  1 +
 NEWS                                  |  2 +-
 gprofng-gui.spec                      |  2 +-
 org/gprofng/mpmt/AboutPanel.java      | 60 +++++++++++++++------------
 org/gprofng/mpmt/Analyzer.java        |  8 +---
 org/gprofng/mpmt/icons/README.license |  2 +-
 rpmbuild.sh                           |  2 +-
 7 files changed, 40 insertions(+), 37 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e45e44f..174cefb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -581,6 +581,7 @@ $(MPMT_PROPERTIES): $(MPMT_FILES) LocaleString.class \
        mkdir -m 777 -p $(@D)
        echo "# THIS FILE IS AUTO-GENERATED. DON'T EDIT IT." > $@
        echo "" >> $@
+       echo "gui_version=$(VERSION)" >> $@
        cat $(srcdir)/gprofng.properties >> $@
        cat $(MPMT_FILES) | $(JAVA) $(JAVA_FLAGS) -cp . LocaleString >> $@
 
diff --git a/NEWS b/NEWS
index e1a3ca3..98e71d3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
 This NEWS file records noteworthy changes, very tersely.
 See the manual for detailed information.
 
-  Copyright 2023 The gprofng-gui authors.
+  Copyright 2023-2024 The gprofng-gui authors.
 
   Copying and distribution of this file, with or without modification,
   are permitted in any medium without royalty provided the copyright
diff --git a/gprofng-gui.spec b/gprofng-gui.spec
index 9fa3d88..6dcf5bb 100644
--- a/gprofng-gui.spec
+++ b/gprofng-gui.spec
@@ -1,4 +1,4 @@
-# Copyright (C) 2022, 2023, 2024 Free Software Foundation
+# Copyright (C) 2022-2024 Free Software Foundation
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/org/gprofng/mpmt/AboutPanel.java b/org/gprofng/mpmt/AboutPanel.java
index ee83dba..bd89bd1 100644
--- a/org/gprofng/mpmt/AboutPanel.java
+++ b/org/gprofng/mpmt/AboutPanel.java
@@ -31,12 +31,12 @@ import javax.swing.text.StyleContext;
 import javax.swing.text.StyledDocument;
 
 public class AboutPanel extends JPanel {
-
+  private static final String GUI_VERSION = "gui_version";
   private static final String REGULAR = "regular";
   private static final String BOLD = "bold";
   private static final String ITALIC = "italic";
   private static final String strLegalNotice =
-      "Copyright (C) 2022 Free Software Foundation\n\n"
+      "Copyright (C) 2022-2024 Free Software Foundation\n\n"
       + "This program is free software; you can redistribute it and/or 
modify\n"
       + "it under the terms of the GNU General Public License as published 
by\n"
       + "the Free Software Foundation, either version 3 of the License, or\n"
@@ -78,33 +78,39 @@ public class AboutPanel extends JPanel {
     Style boldStyle = doc.addStyle(BOLD, regularStyle);
     StyleConstants.setBold(boldStyle, true);
 
+    String gui_version = AnLocale.getString(GUI_VERSION);
+    if (gui_version.compareTo(GUI_VERSION) == 0) // Did not find
+      gui_version = "";
     try {
-      doc.insertString(doc.getLength(), AnLocale.getString("Version: "), 
doc.getStyle(BOLD));
-      doc.insertString(doc.getLength(), Analyzer.fdversion + "\n", 
doc.getStyle(REGULAR));
-      doc.insertString(
-          doc.getLength(), AnLocale.getString("GUI protocol version: "), 
doc.getStyle(BOLD));
-      doc.insertString(doc.getLength(), IPCProtocol.version + "\n", 
doc.getStyle(REGULAR));
-      doc.insertString(doc.getLength(), AnLocale.getString("Install: "), 
doc.getStyle(BOLD));
-      doc.insertString(doc.getLength(), Analyzer.fdhome + "\n", 
doc.getStyle(REGULAR));
-      doc.insertString(
-          doc.getLength(), AnLocale.getString("Working directory: "), 
doc.getStyle(BOLD));
-      doc.insertString(
-          doc.getLength(),
-          Analyzer.getInstance().getWorkingDirectory() + "\n",
-          doc.getStyle(REGULAR));
-      doc.insertString(doc.getLength(), AnLocale.getString("Java: "), 
doc.getStyle(BOLD));
-      doc.insertString(
-          doc.getLength(), "J2SE[tm] " + Analyzer.jvm_ver + "\n", 
doc.getStyle(REGULAR));
-      doc.insertString(doc.getLength(), AnLocale.getString("Java home: "), 
doc.getStyle(BOLD));
-      doc.insertString(doc.getLength(), Analyzer.jvm_home + "\n", 
doc.getStyle(REGULAR));
-      doc.insertString(doc.getLength(), AnLocale.getString("User directory: 
"), doc.getStyle(BOLD));
-      doc.insertString(
-          doc.getLength(),
-          UserPref.getInstance().getAnalyzerDirPath() + "\n",
-          doc.getStyle(REGULAR));
-      doc.insertString(doc.getLength(), "gp-display-text: ", 
doc.getStyle(BOLD));
+      doc.insertString(doc.getLength(),
+          AnLocale.getString("Version: "), boldStyle);
+      doc.insertString(doc.getLength(), gui_version + "\n", regularStyle);
+      doc.insertString(doc.getLength(),
+          AnLocale.getString("GUI protocol version: "), boldStyle);
+      doc.insertString(doc.getLength(),
+          IPCProtocol.version + "\n", regularStyle);
+      doc.insertString(doc.getLength(),
+          AnLocale.getString("Install: "), boldStyle);
+      doc.insertString(doc.getLength(), Analyzer.fdhome + "\n", regularStyle);
+      doc.insertString(doc.getLength(),
+          AnLocale.getString("Working directory: "), boldStyle);
+      doc.insertString(doc.getLength(),
+          Analyzer.getInstance().getWorkingDirectory() + "\n", regularStyle);
+      doc.insertString(doc.getLength(), AnLocale.getString("Java: "), 
boldStyle);
+      doc.insertString(doc.getLength(), Analyzer.jvm_ver + "\n", regularStyle);
+      doc.insertString(doc.getLength(),
+          AnLocale.getString("Java home: "), boldStyle);
+      doc.insertString(doc.getLength(), Analyzer.jvm_home + "\n", 
regularStyle);
+      doc.insertString(doc.getLength(),
+          AnLocale.getString("User directory: "), boldStyle);
+      doc.insertString(doc.getLength(),
+          UserPref.getInstance().getAnalyzerDirPath() + "\n", regularStyle);
+      doc.insertString(doc.getLength(), "gp-display-text: ", boldStyle);
       doc.insertString(
-          doc.getLength(), Analyzer.getInstance().er_print + "\n", 
doc.getStyle(REGULAR));
+          doc.getLength(), Analyzer.getInstance().er_print + "\n", 
regularStyle);
+      doc.insertString(doc.getLength(),
+          AnLocale.getString("gp-display-text version: "), boldStyle);
+      doc.insertString(doc.getLength(), Analyzer.fdversion + "\n", 
regularStyle);
     } catch (BadLocationException ble) {
     }
     AnUtility.setAccessibleContext(
diff --git a/org/gprofng/mpmt/Analyzer.java b/org/gprofng/mpmt/Analyzer.java
index 8acc69f..7dc866a 100644
--- a/org/gprofng/mpmt/Analyzer.java
+++ b/org/gprofng/mpmt/Analyzer.java
@@ -47,8 +47,6 @@ public final class Analyzer {
 
   // Runtime environment
   public static final String PERFORMANCE_ANALYZER_RELEASE_NAME = "gprofng GUI";
-  public static final String THIS_VERSION = "12.6";
-
   public static final String jvm_ver = System.getProperty("java.version", 
"unknown");
   public static final String jvm_home = System.getProperty("java.home", 
"unknown");
   public static final String home_dir =
@@ -398,8 +396,6 @@ public final class Analyzer {
         }
       }
     }
-    System.err.println("fdhome: " + (fdhome == null ? "" : fdhome));
-    System.err.println("gp-display-text: " + er_print);
     AnLog.log("analyzer: gp-display-text=" + er_print + "\n");
     // Check the OS - only Solaris and Linux are supported
     if (remoteHost == null) {
@@ -1833,8 +1829,8 @@ public final class Analyzer {
    */
   private String initIPC() throws Exception {
     AnUtility.checkIPCOnWrongThread(false);
-    String temporaryRemoteVersion = getAnalyzerReleaseName() + " " + 
THIS_VERSION;
-    fdversion = temporaryRemoteVersion;
+    String temporaryRemoteVersion = getAnalyzerReleaseName();
+    fdversion = "";
     String emsg = null;
     startIPC();
     // Version Handshake
diff --git a/org/gprofng/mpmt/icons/README.license 
b/org/gprofng/mpmt/icons/README.license
index 3ca0f57..a4e36e3 100644
--- a/org/gprofng/mpmt/icons/README.license
+++ b/org/gprofng/mpmt/icons/README.license
@@ -1,4 +1,4 @@
-Copyright (C) 2023 Free Software Foundation
+Copyright (C) 2022-2024 Free Software Foundation
 
 The image files in this directory are distributed under the terms of
 the GNU General Public License as published by the Free Software
diff --git a/rpmbuild.sh b/rpmbuild.sh
index 43d7439..f7cbc35 100755
--- a/rpmbuild.sh
+++ b/rpmbuild.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2022, 2023, 2024 Free Software Foundation
+# Copyright (C) 2022-2024 Free Software Foundation
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]