diff --git a/CMakeLists.txt b/CMakeLists.txt index 37b04b420..171cb1f01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,7 +83,7 @@ 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) -set (WSJT_DOC_DESTINATION doc/WSJT-X) +set (WSJT_DOC_DESTINATION doc/${CMAKE_PROJECT_NAME}) set (WSJT_MANPAGE_DESTINATION share) set (WSJT_PLUGIN_DESTINATION lib/plugins) set (WSJT_QT_CONF_DESTINATION bin) diff --git a/Configuration.cpp b/Configuration.cpp index 79ee5c353..d59e98060 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -343,6 +343,7 @@ private: QSettings * settings_; + QDir doc_path_; QDir temp_path_; QDir data_path_; QDir default_save_directory_; @@ -436,6 +437,7 @@ Configuration::~Configuration () { } +QDir Configuration::doc_path () const {return m_->doc_path_;} QDir Configuration::data_path () const {return m_->data_path_;} int Configuration::exec () {return m_->exec ();} @@ -552,6 +554,7 @@ Configuration::impl::impl (Configuration * self, QString const& instance_key, QS , self_ {self} , ui_ {new Ui::configuration_dialog} , settings_ {settings} + , doc_path_ {QApplication::applicationDirPath ()} , temp_path_ {QApplication::applicationDirPath ()} , data_path_ {QApplication::applicationDirPath ()} , font_ {QApplication::font ()} @@ -594,6 +597,25 @@ Configuration::impl::impl (Configuration * self, QString const& instance_key, QS ui_->setupUi (this); + // we must find this before changing the CWD since that breaks + // QCoreApplication::applicationDirPath() which is used internally + // by QStandardPaths :( +#if !defined (Q_OS_WIN) || QT_VERSION >= 0x050300 + auto path = QStandardPaths::locate (QStandardPaths::DataLocation, WSJT_DOC_DESTINATION, QStandardPaths::LocateDirectory); + if (path.isEmpty ()) + { + doc_path_.cdUp (); + doc_path_.cd (WSJT_SHARE_DESTINATION); + doc_path_.cd (WSJT_DOC_DESTINATION); + } + else + { + doc_path_.cd (path); + } +#else + doc_path.cd (WSJT_DOC_DESTINATION); +#endif + #if WSJT_STANDARD_FILE_LOCATIONS // the following needs to be done on all platforms but changes need // coordination with JTAlert developers diff --git a/Configuration.hpp b/Configuration.hpp index a497822d2..fb29b0e3e 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -67,6 +67,7 @@ public: int exec (); QDir data_path () const; + QDir doc_path () const; QAudioDeviceInfo const& audio_input_device () const; AudioDevice::Channel audio_input_channel () const; diff --git a/debian/CMakeLists.txt b/debian/CMakeLists.txt index 3ed86e88b..8a2727356 100644 --- a/debian/CMakeLists.txt +++ b/debian/CMakeLists.txt @@ -13,14 +13,15 @@ math (EXPR __index "${__month_index} - 1") list (GET __months "${__index}" __month) string (REPLACE "[${__month_index}]" "${__month}" ts ${ts}) +set (deb_changelog changelog.Debian) configure_file ( - "${CMAKE_CURRENT_SOURCE_DIR}/changelog.in" - "${CMAKE_CURRENT_BINARY_DIR}/changelog" + "${CMAKE_CURRENT_SOURCE_DIR}/${deb_changelog}.in" + "${CMAKE_CURRENT_BINARY_DIR}/${deb_changelog}" @ONLY) add_custom_target (debian - COMMAND ${GZIP_EXECUTABLE} -cf9 changelog > changelog.gz - DEPENDS changelog.in + COMMAND ${GZIP_EXECUTABLE} -cf9 ${deb_changelog} > ${deb_changelog}.gz + DEPENDS ${deb_changelog}.in WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Compressing Debian changelog" ) @@ -31,8 +32,8 @@ configure_file ( @ONLY) install (FILES - ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz + ${CMAKE_CURRENT_BINARY_DIR}/${deb_changelog}.gz ${CMAKE_CURRENT_BINARY_DIR}/copyright - DESTINATION ${WSJT_DOC_DESTINATION} + DESTINATION ${WSJT_SHARE_DESTINATION}/${WSJT_DOC_DESTINATION} #COMPONENT Debian ) diff --git a/debian/changelog.in b/debian/changelog.Debian.in similarity index 100% rename from debian/changelog.in rename to debian/changelog.Debian.in diff --git a/mainwindow.cpp b/mainwindow.cpp index 68e20a0ae..13a779a7c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1022,14 +1022,7 @@ void MainWindow::on_actionOnline_User_Guide_triggered() //Display 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); + auto file = m_config.doc_path ().absoluteFilePath (PROJECT_MANUAL); QDesktopServices::openUrl (QUrl {"file:///" + file}); } diff --git a/manpages/CMakeLists.txt b/manpages/CMakeLists.txt index 525bfa4c0..c0882fe4f 100644 --- a/manpages/CMakeLists.txt +++ b/manpages/CMakeLists.txt @@ -1,6 +1,7 @@ set (ASCIIDOC_MANS man1/wsjtx.1.txt man1/jt65code.1.txt + man1/rigctld-wsjtx.1.txt ) find_program (A2X_EXECUTABLE NAMES a2x a2x.py) @@ -48,7 +49,6 @@ if (A2X_EXECUTABLE AND GZIP_EXECUTABLE AND SED_EXECUTABLE) add_custom_command (OUTPUT "${o}.gz" COMMAND ${CMAKE_COMMAND} ARGS -E make_directory "${d}" COMMAND ${A2X_EXECUTABLE} ARGS ${A2X_OPTS} -D "${d}" "${f}" - COMMAND ${GZIP_EXECUTABLE} ARGS -f9 "${o}" COMMAND ${SED_EXECUTABLE} ARGS -e "'s@.so @&man${section}/@'" -i.orig "${d}/*.${section}" COMMAND ${GZIP_EXECUTABLE} ARGS -f9 "${d}/*.${section}" DEPENDS "${f}" diff --git a/manpages/man1/rigctld-wsjtx.1.txt b/manpages/man1/rigctld-wsjtx.1.txt new file mode 100644 index 000000000..6cf9ebfc1 --- /dev/null +++ b/manpages/man1/rigctld-wsjtx.1.txt @@ -0,0 +1,29 @@ +:doctype: manpage +:man source: AsciiDoc +:man version: {revnumber} +:man manual: WSJT-X Manual += rigctld-wsjtx(1) + +== NAME + +rigctld-wsjtx - Hamlib 3 rigctld server. + +== SYNOPSIS + +*rigctld-wsjtx* [OPTIONS] + +== DESCRIPTION + +*wsjtx* uses a version of the *hamlib* CAT control library. This + library is heavily modified over the current release version of + *hamlib*. If a *wsjtx* user wishes to use the *hamlib* network rig + server *rigctld* to remotely control their transceiver; then this + special version of *rigctld* should be used since that too has the + modified *hamlib* code embedded with it. + +WSJT-X home page:: http://www.physics.princeton.edu/pulsar/K1JT/wsjtx.html + +WSJT-X User's Guide:: http://www.physics.princeton.edu/pulsar/K1JT/wsjtx-doc/wsjtx-main-toc2.html + +== OPTIONS +Refer to the *hamlib* documentation. diff --git a/wsjtx_config.h.in b/wsjtx_config.h.in index f18b36022..943b99b60 100644 --- a/wsjtx_config.h.in +++ b/wsjtx_config.h.in @@ -12,6 +12,7 @@ #define CONFIG_TEST_VERSION_PATCH @CONFIG_TEST_VERSION_PATCH@ #cmakedefine WSJT_BIN_DESTINATION "@WSJT_BIN_DESTINATION@" +#cmakedefine WSJT_SHARE_DESTINATION "@WSJT_SHARE_DESTINATION@" #cmakedefine WSJT_LIB_DESTINATION "@WSJT_LIB_DESTINATION@" #cmakedefine WSJT_DOC_DESTINATION "@WSJT_DOC_DESTINATION@" #cmakedefine PROJECT_MANUAL "@PROJECT_MANUAL@"