diff --git a/CMake/download_html_manual.cmake b/CMake/download_html_manual.cmake
new file mode 100644
index 000000000..08a6affdc
--- /dev/null
+++ b/CMake/download_html_manual.cmake
@@ -0,0 +1,16 @@
+#
+# CMake script to fetch the current HTML manual
+#
+message (STATUS "file: ${URL}/${NAME}")
+file (
+ DOWNLOAD ${URL}/${NAME} contrib/${NAME}
+ TIMEOUT 10
+ STATUS manual_STATUS
+ LOG manual_LOG
+ SHOW_PROGRESS
+ )
+list (GET manual_STATUS 0 manual_RC)
+if (manual_RC)
+ message (WARNING "${manual_STATUS}")
+ message (FATAL_ERROR "${manual_LOG}")
+endif (manual_RC)
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index 8b9ca9154..1e51ab8c2 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -32,14 +32,14 @@ if (CPACK_GENERATOR MATCHES "NSIS")
set (CPACK_PACKAGE_ICON "@PROJECT_SOURCE_DIR@/icons/windows-icons\\installer_logo.bmp")
# tell cpack to create links to the doc files
set (CPACK_NSIS_MENU_LINKS
- "@PROJECT_MANUAL@" "WSJT-X Documentation"
+ "@PROJECT_MANUAL_DIRECTORY_URL@@PROJECT_MANUAL@" "WSJT-X Documentation"
"@PROJECT_HOMEPAGE@" "WSJT-X Web Site"
)
# Use the icon from wsjtx for add-remove programs
set (CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\wsjtx.exe")
set (CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
- set (CPACK_NSIS_HELP_LINK "@PROJECT_MANUAL@")
+ set (CPACK_NSIS_HELP_LINK "@PROJECT_MANUAL_DIRECTORY_URL@@PROJECT_MANUAL@")
set (CPACK_NSIS_URL_INFO_ABOUT "@PROJECT_HOMEPAGE@")
set (CPACK_NSIS_CONTACT "${CPACK_PACKAGE_CONTACT}")
set (CPACK_NSIS_MUI_FINISHPAGE_RUN "wsjtx.exe")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index daa7fd314..38c92f493 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,8 @@ set (PROJECT_VENDOR "Joe Taylor, K1JT")
set (PROJECT_CONTACT "Joe Taylor ")
set (PROJECT_COPYRIGHT "Copyright (C) 2001-2014 by Joe Taylor, K1JT")
set (PROJECT_HOMEPAGE "http://www.physics.princeton.edu/pulsar/K1JT/wsjtx.html")
-set (PROJECT_MANUAL "http://www.physics.princeton.edu/pulsar/K1JT/wsjtx-doc/wsjtx-main.html")
+set (PROJECT_MANUAL wsjtx-main.html)
+set (PROJECT_MANUAL_DIRECTORY_URL http://www.physics.princeton.edu/pulsar/K1JT/wsjtx-doc)
set (PROJECT_SUMMARY_DESCRIPTION "WSJT-X - JT9 and JT65 Modes for LF, MF and HF Amateur Radio.")
set (PROJECT_DESCRIPTION "${PROJECT_SUMMARY_DESCRIPTION}
WSJT-X implements JT9, a new mode designed especially for the LF, MF,
@@ -81,12 +82,24 @@ CMAKE_DEPENDENT_OPTION (WSJT_ENABLE_EXPERIMENTAL_FEATURES "Enable features not f
#
set (WSJT_BIN_DESTINATION bin)
set (WSJT_LIB_DESTINATION lib)
-set (WSJT_SHARE_DESTINATION share/wsjtx)
-set (WSJT_DOC_DESTINATION share/doc/wsjtx)
-set (WSJT_MANPAGE_DESTINATION share)
+set (WSJT_SHARE_DESTINATION share)
+set (WSJT_DOC_DESTINATION doc/WSJT-X)
set (WSJT_PLUGIN_DESTINATION lib/plugins)
set (WSJT_QT_CONF_DESTINATION bin)
+if (WIN32)
+ set (WSJT_SHARE_DESTINATION bin)
+ set (WSJT_DOC_DESTINATION doc)
+ set (WSJT_PLUGIN_DESTINATION plugins)
+endif (WIN32)
+
+if (APPLE)
+ set (WSJT_BIN_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/MacOS)
+ set (WSJT_SHARE_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/Resources)
+ set (WSJT_PLUGIN_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/PlugIns)
+ set (WSJT_QT_CONF_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/Resources)
+endif (APPLE)
+
#
# Project sources
@@ -379,15 +392,6 @@ if (APPLE)
if (NOT "${ENDCH}" STREQUAL "/")
set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
endif ()
- # install inside bundle
- # set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}wsjtx.app")
-
- set (WSJT_PLUGIN_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/PlugIns)
- set (WSJT_QT_CONF_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/Resources)
- set (WSJT_SHARE_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/Resources)
- set (WSJT_DOC_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/Resources)
- set (WSJT_MANPAGE_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/Resources)
- set (WSJT_BIN_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/MacOS)
endif (APPLE)
@@ -468,6 +472,17 @@ FortranCInterface_HEADER (FC.h MACRO_NAMESPACE "FC_" SYMBOL_NAMESPACE "FC_"
# sort out pre-requisites
#
+#
+# fetch latest HTML manual
+#
+add_custom_command (
+ OUTPUT contrib/${PROJECT_MANUAL}
+ COMMAND ${CMAKE_COMMAND} -D URL=${PROJECT_MANUAL_DIRECTORY_URL} -D NAME=${PROJECT_MANUAL} -P ${CMAKE_SOURCE_DIR}/CMake/download_html_manual.cmake
+ DEPENDS CMake/download_html_manual.cmake
+ COMMENT "Downloading WSJT-X HTML manual"
+ VERBATIM
+ )
+
#
# Setup RPATH so that built executable targets will run in both the
# build tree and the install location without having to set a
@@ -652,6 +667,7 @@ add_executable (wsjtx WIN32 MACOSX_BUNDLE
${WSJTX_ICON_FILE}
${wsjtx_RESOURCES_RCC}
contrib/kvasd${CMAKE_EXECUTABLE_SUFFIX}
+ contrib/${PROJECT_MANUAL}
)
qt5_use_modules (wsjtx Widgets OpenGL Network Multimedia)
@@ -707,6 +723,12 @@ install (PROGRAMS
RENAME rigctld-wsjtx${CMAKE_EXECUTABLE_SUFFIX}
)
+install (FILES
+ ${CMAKE_BINARY_DIR}/contrib/${PROJECT_MANUAL}
+ DESTINATION ${WSJT_SHARE_DESTINATION}/${WSJT_DOC_DESTINATION}
+ #COMPONENT Runtime
+ )
+
#
# uninstall support
@@ -791,6 +813,7 @@ if (NOT is_debug_build)
# if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation
set (fixup_exe "\${CMAKE_INSTALL_PREFIX}/${WSJT_BIN_DESTINATION}/${CMAKE_PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
+
#get_filename_component (hamlib_lib_dir ${hamlib_LIBRARIES} PATH)
if (APPLE)
@@ -881,8 +904,10 @@ file (APPEND \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${WSJT_QT_CONF_DESTINATION
include (BundleUtilities)
set (BU_CHMOD_BUNDLE_ITEMS ON)
set (gp_tool ${gp_tool})
- message (STATUS \"fixup_exe: ${fixup_exe}\")
- fixup_bundle (\"${fixup_exe}\" \"\${QTPLUGINS}\" \"${fixup_library_dirs}\")
+ # canonicalize path in install context
+ get_filename_component (the_exe ${fixup_exe} REALPATH)
+ message (STATUS \"fixup_exe: \${the_exe}\")
+ fixup_bundle (\"\${the_exe}\" \"\${QTPLUGINS}\" \"${fixup_library_dirs}\")
"
#COMPONENT Runtime
)
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 1b91215ce..24c2f379c 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -988,9 +988,23 @@ void MainWindow::msgBox(QString t) //msgBox
msgBox0.exec();
}
-void MainWindow::on_actionOnline_Users_Guide_triggered() //Display manual
+void MainWindow::on_actionOnline_User_Guide_triggered() //Display manual
{
- QDesktopServices::openUrl (QUrl (PROJECT_MANUAL, QUrl::TolerantMode));
+ QDesktopServices::openUrl (QUrl (PROJECT_MANUAL_DIRECTORY_URL PROJECT_MANUAL));
+}
+
+//Display local copy of manual
+void MainWindow::on_actionLocal_User_Guide_triggered()
+{
+#if !defined (Q_OS_WIN) || QT_VERSION >= 0x050300
+ QDir path {QStandardPaths::locate (QStandardPaths::DataLocation, WSJT_DOC_DESTINATION, QStandardPaths::LocateDirectory)};
+#else
+ QDir path {QCoreApplication::applicationDirPath ()};
+ path.cd (WSJT_DOC_DESTINATION);
+#endif
+
+ auto file = path.absoluteFilePath (PROJECT_MANUAL);
+ QDesktopServices::openUrl (QUrl {"file:///" + file});
}
void MainWindow::on_actionWide_Waterfall_triggered() //Display Waterfalls
diff --git a/mainwindow.h b/mainwindow.h
index a0d03a6e3..35e5f7d23 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -96,7 +96,8 @@ private slots:
void on_autoButton_clicked (bool);
void on_stopTxButton_clicked();
void on_stopButton_clicked();
- void on_actionOnline_Users_Guide_triggered();
+ void on_actionOnline_User_Guide_triggered();
+ void on_actionLocal_User_Guide_triggered();
void on_actionWide_Waterfall_triggered();
void on_actionOpen_triggered();
void on_actionOpen_next_in_directory_triggered();
diff --git a/mainwindow.ui b/mainwindow.ui
index 5074611ff..ced250bbd 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -2330,11 +2330,14 @@ list. The list can be maintained in Settings (F2).
Help
-
+
+
+
-
+
+
diff --git a/wsjtx_config.h.in b/wsjtx_config.h.in
index d16cf7821..f18b36022 100644
--- a/wsjtx_config.h.in
+++ b/wsjtx_config.h.in
@@ -13,9 +13,9 @@
#cmakedefine WSJT_BIN_DESTINATION "@WSJT_BIN_DESTINATION@"
#cmakedefine WSJT_LIB_DESTINATION "@WSJT_LIB_DESTINATION@"
-#cmakedefine WSJT_SHARE_DESTINATION "@WSJT_SHARE_DESTINATION@"
#cmakedefine WSJT_DOC_DESTINATION "@WSJT_DOC_DESTINATION@"
#cmakedefine PROJECT_MANUAL "@PROJECT_MANUAL@"
+#cmakedefine PROJECT_MANUAL_DIRECTORY_URL "@PROJECT_MANUAL_DIRECTORY_URL@"
#cmakedefine01 WSJT_SHARED_RUNTIME
#cmakedefine01 WSJT_QDEBUG_TO_FILE