mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-02-03 01:34:15 -05:00
Get local user manual working on Linux systems.
The location of documentation files on Linux distributions is controlled to a certain extent. Using the QStandardPaths::locate() method helps us with this. Work round the misbehaviour of QCoreApplication::applicationDirPath() when the CWD has been changed by working out the documentation location before changing the CWD to a temporary directory. This path is now provided by the Configuration settings class which also manages other run time paths. Updated Debian packaging to move a little nearer a conforming DEB file. Added a basic manpage for rigctld-wsjtx. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4364 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
87da310279
commit
fcc0563391
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
13
debian/CMakeLists.txt
vendored
13
debian/CMakeLists.txt
vendored
@ -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
|
||||
)
|
||||
|
@ -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});
|
||||
}
|
||||
|
||||
|
@ -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}"
|
||||
|
29
manpages/man1/rigctld-wsjtx.1.txt
Normal file
29
manpages/man1/rigctld-wsjtx.1.txt
Normal file
@ -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.
|
@ -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@"
|
||||
|
Loading…
Reference in New Issue
Block a user