Bill,
Please see attached files:
CMakeLists.txt.patch
AppVersion/AppVersion.cpp
Please let me know if you have any questions.
73,
--
Dave Slotter, W3DJS <https://www.qrz.com/db/W3DJS>
On Tue, Dec 1, 2020 at 8:04 PM Bill Somerville <[email protected]>
wrote:
> Hi Dave,
>
> a universal diff patch against the current SourceForge git repo master
> branch is fine as it is a small change.
>
> 73
> Bill
> G4WJS.
>
> On 02/12/2020 00:54, Dave Slotter, W3DJS wrote:
>
> Bill,
>
> Ok, I volunteered myself to write it. It works and seems to reasonably fit
> within the existing Qt / CMake environment.
>
> How do I get the changes to you? AppVersion.cpp is 49 lines long and
> CMakeLists.txt has 10 new lines.
>
> Do you want a Git pull request or do you want a patch file or should I
> just send the changed files as attachments?
>
> Please advise, and thanks.
>
> --
> Dave Slotter, W3DJS <https://www.qrz.com/db/W3DJS>
>
>
> On Tue, Dec 1, 2020 at 5:25 PM Dave Slotter, W3DJS <
> [email protected]> wrote:
>
>> Bill,
>>
>> Do you want me to volunteer to write it?
>>
>> --
>> Dave Slotter, W3DJS <https://www.qrz.com/db/W3DJS>
>>
>>
>> On Tue, Dec 1, 2020 at 4:53 PM Bill Somerville <[email protected]>
>> wrote:
>>
>>> On 01/12/2020 21:02, Dave Slotter, W3DJS wrote:
>>>
>>> Hi Bill,
>>>
>>> Thank you for all that you do for WSJT-X development. Because of your
>>> contributions, tens of thousands (hundreds of thousands?) of amateur radio
>>> operators enjoy operating digital modes with other amateur radio operators
>>> around the globe.
>>>
>>> That said, under Linux (and probably also for Mac and Windows), using
>>> the command line, when I type in "wsjtx --version", a GUI dialog is
>>> displayed with the WSJT-X version, but that doesn't help a shell script
>>> trying to get the WSJT-X version programmatically.
>>>
>>> I wrote an update script for Linux, and while it could in theory check
>>> the version on the website and check the installed version and then
>>> determine whether to download the newer version (or not), it is hampered by
>>> this limitation.
>>>
>>> I did discover that there is a version number stored in
>>> $HOME/.config/WSJT-X.ini, but that is only a preference setting, and does
>>> not guarantee the version installed. Likewise, under
>>> $HOME/.local/share/WSJT-X/logs/wsjtx_syslog_YYYY-MM.log the program version
>>> is logged upon application startup, but once again, that's not a guarantee
>>> of installed version.
>>>
>>> *May I please request that a) "wsjtx --version" return version string to
>>> stdout and b) the operation is non-blocking?*
>>>
>>> *While I'm at it, may I please additionally request that c) wsjtx --help
>>> also output to stdout ?*
>>>
>>> Is there an issue tracker for WSJT-X? I'd be happy to enter these
>>> concerns into there directly. I went to SourceForge and didn't see any
>>> mechanism for this.
>>>
>>> Thanks and 73,
>>>
>>> --
>>> Dave Slotter, W3DJS <https://www.qrz.com/db/W3DJS>
>>>
>>> Hi Dave,
>>>
>>> that would have to be a non-Windows platform only change, in fact
>>> non-macOS as well really. Windows and macOS don't normally have a console
>>> attached when running the application. It would be easier to provide a
>>> command line tool packaged with WSJT-X that did what you are looking for.
>>>
>>> 73
>>> Bill
>>> G4WJS.
>>>
>>
> _______________________________________________
> wsjt-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wsjt-devel
>
pi@hampi:~/hamradio/wsjtx $ cat AppVersion/AppVersion.cpp
//
// wsjtx_app_version - a console application that outputs WSJT-X
// application version
//
// This application is only provided as a simple console application
//
//
#include <iostream>
#include <exception>
#include <QCoreApplication>
#include <QCommandLineParser>
#include <QCommandLineOption>
#include "qt_helpers.hpp"
#include "revision_utils.hpp"
int main (int argc, char * argv[])
{
QCoreApplication app {argc, argv};
try
{
setlocale (LC_NUMERIC, "C"); // ensure number forms are in
// consistent format, do this after
// instantiating QApplication so
// that GUI has correct l18n
app.setApplicationName ("WSJT-X");
app.setApplicationVersion (version());
QCommandLineParser parser;
// parser.setApplicationDescription ("\n" PROJECT_DESCRIPTION);
auto help_option = parser.addHelpOption ();
auto version_option = parser.addVersionOption ();
parser.process (app);
catch (std::exception const & e)
{
std::cerr << "Error: " << e.what () << '\n';
}
catch (...)
{
std::cerr << "Unexpected error\n";
}
return -1;
}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 72c38fa13..da1a1f929 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1458,6 +1458,15 @@ generate_version_info (udp_daemon_VERSION_RESOURCES
add_executable (udp_daemon UDPExamples/UDPDaemon.cpp ${udp_daemon_VERSION_RESOURCES})
target_link_libraries (udp_daemon wsjtx_udp-static)
+generate_version_info (wsjtx_app_version_VERSION_RESOURCES
+ NAME wsjtx_app_version
+ BUNDLE ${PROJECT_BUNDLE_NAME}
+ ICON ${WSJTX_ICON_FILE}
+ FILE_DESCRIPTION "Display WSJT-X Application Version on console"
+ )
+add_executable (wsjtx_app_version AppVersion/AppVersion.cpp ${wsjtx_app_version_VERSION_RESOURCES})
+target_link_libraries (wsjtx_app_version wsjt_qt)
+
generate_version_info (message_aggregator_VERSION_RESOURCES
NAME message_aggregator
BUNDLE ${PROJECT_BUNDLE_NAME}
@@ -1517,7 +1526,7 @@ install (TARGETS wsjtx
# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wsjtx
# )
-install (TARGETS udp_daemon message_aggregator
+install (TARGETS udp_daemon message_aggregator wsjtx_app_version
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
)
_______________________________________________
wsjt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wsjt-devel