New help system

1. Offline HTML excluded from Qucs-S distribution (if WITH_SPICE enabled)
2. F1 shortcut points to the main Qucs-S help page at the readthedocs
service.
3. Added menu etntry for the mainline Qucs help
This commit is contained in:
Vadim Kuznetzov 2016-07-30 16:59:21 +03:00
parent 3090d5d10d
commit 33602ba0ca
15 changed files with 49 additions and 24 deletions

View File

@ -48,6 +48,7 @@ ADD_DEFINITIONS(${QT_DEFINITIONS})
IF(NOT WITH_SPICE) IF(NOT WITH_SPICE)
ADD_SUBDIRECTORY( qucs-attenuator ) ADD_SUBDIRECTORY( qucs-attenuator )
ADD_SUBDIRECTORY( qucs-edit ) ADD_SUBDIRECTORY( qucs-edit )
ADD_SUBDIRECTORY( qucs-help )
ADD_SUBDIRECTORY( qucs-transcalc ) ADD_SUBDIRECTORY( qucs-transcalc )
ADD_SUBDIRECTORY( qucs-rescodes ) ADD_SUBDIRECTORY( qucs-rescodes )
ADD_SUBDIRECTORY( contrib ) ADD_SUBDIRECTORY( contrib )
@ -57,7 +58,6 @@ ADD_SUBDIRECTORY( qucs )
ADD_SUBDIRECTORY( qucs-activefilter ) ADD_SUBDIRECTORY( qucs-activefilter )
#ADD_SUBDIRECTORY( qucs-doc ) #ADD_SUBDIRECTORY( qucs-doc )
ADD_SUBDIRECTORY( qucs-filter ) ADD_SUBDIRECTORY( qucs-filter )
ADD_SUBDIRECTORY( qucs-help )
ADD_SUBDIRECTORY( qucs-lib ) ADD_SUBDIRECTORY( qucs-lib )
#ADD_SUBDIRECTORY( examples ) #ADD_SUBDIRECTORY( examples )
ADD_SUBDIRECTORY( translations ) ADD_SUBDIRECTORY( translations )

View File

@ -2,15 +2,6 @@ PROJECT(qucshelp CXX C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
cmake_policy(VERSION 2.6) cmake_policy(VERSION 2.6)
IF(WITH_SPICE)
MESSAGE("SPICE support enabled")
SET(QUCS_NAME "qucs-s")
ELSE()
SET(QUCS_NAME "qucs")
ENDIF()
IF(NOT WITH_SPICE)
# use top VERSION file # use top VERSION file
file (STRINGS ${PROJECT_SOURCE_DIR}/../VERSION QUCS_VERSION) file (STRINGS ${PROJECT_SOURCE_DIR}/../VERSION QUCS_VERSION)
message(STATUS "Configuring ${PROJECT_NAME} (GUI): VERSION ${QUCS_VERSION}") message(STATUS "Configuring ${PROJECT_NAME} (GUI): VERSION ${QUCS_VERSION}")
@ -102,9 +93,3 @@ INSTALL( FILES ./docs/qucsdigi.1 DESTINATION share/man/man1 )
INSTALL( FILES ./docs/qucsdigilib.1 DESTINATION share/man/man1 ) INSTALL( FILES ./docs/qucsdigilib.1 DESTINATION share/man/man1 )
INSTALL( FILES ./docs/qucsveri.1 DESTINATION share/man/man1 ) INSTALL( FILES ./docs/qucsveri.1 DESTINATION share/man/man1 )
ELSE()
ADD_SUBDIRECTORY( docs )
INSTALL( FILES ./docs/${QUCS_NAME}.1 DESTINATION share/man/man1 )
ENDIF()

View File

@ -8,5 +8,5 @@ optimization1.png optimization4.png optimization7.png qucsdigi.png subcircuit.p
optimization2.png optimization5.png optimization8.png qucsmain.png wire.png ) optimization2.png optimization5.png optimization8.png qucsmain.png wire.png )
# installation of documentation # installation of documentation
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/cs) INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/cs)

View File

@ -9,5 +9,5 @@ optimization2.png optimization5.png optimization8.png qucshaupt.png wire.png
index.html matching.html programs.html start.html start_opt.html) index.html matching.html programs.html start.html start_opt.html)
# installation of documentation # installation of documentation
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/de) INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/de)

View File

@ -11,5 +11,5 @@ SET(PNGS qucsmain.png paste.png wire.png select.png contab.png subcircuit.png
# installation of documentation # installation of documentation
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/en) INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/en)

View File

@ -5,5 +5,5 @@ SET(HTML index.html mathfunc.html programs.html short.html start.html subcircuit
SET(PNGS contab.png paste.png qucsmain.png select.png subcircuit.png wire.png ) SET(PNGS contab.png paste.png qucsmain.png select.png subcircuit.png wire.png )
# installation of documentation # installation of documentation
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/es) INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/es)

View File

@ -5,5 +5,5 @@ SET(HTML index.html mathfunc.html short.html start.html subcircuit.html)
SET(PNGS contab.png paste.png qucsmain.png select.png subcircuit.png wire.png) SET(PNGS contab.png paste.png qucsmain.png select.png subcircuit.png wire.png)
# installation of documentation # installation of documentation
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/fr) INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/fr)

View File

@ -8,5 +8,5 @@ optimization1.png optimization4.png optimization7.png qucsdigi.png subcircuit.p
optimization2.png optimization5.png optimization8.png qucsmain.png wire.png) optimization2.png optimization5.png optimization8.png qucsmain.png wire.png)
# installation of documentation # installation of documentation
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/pt) INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/pt)

View File

@ -8,5 +8,5 @@ optimization1.png optimization4.png optimization7.png qucsdigi.png subcircuit.p
optimization2.png optimization5.png optimization8.png qucsmain.png wire.png) optimization2.png optimization5.png optimization8.png qucsmain.png wire.png)
# installation of documentation # installation of documentation
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/ru) INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/ru)

View File

@ -8,5 +8,5 @@ optimization1.png optimization4.png optimization7.png qucsdigi.png subcircuit.p
optimization2.png optimization5.png optimization8.png qucsmain.png wire.png) optimization2.png optimization5.png optimization8.png qucsmain.png wire.png)
# installation of documentation # installation of documentation
INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/${QUCS_NAME}/docs/uk) INSTALL(FILES ${HTML} ${PNGS} DESTINATION share/qucs/docs/uk)

View File

@ -331,6 +331,10 @@ ENDIF()
INSTALL( FILES ${SCRIPTS} DESTINATION bin/ ) INSTALL( FILES ${SCRIPTS} DESTINATION bin/ )
ENDIF() ENDIF()
IF(WITH_SPICE)
INSTALL( FILES ${QUCS_NAME}.1 DESTINATION share/man/man1 )
ENDIF()
# To Create a package, one can run "cpack -G DragNDrop CPackConfig.cmake" on Mac OS X # To Create a package, one can run "cpack -G DragNDrop CPackConfig.cmake" on Mac OS X
# where CPackConfig.cmake is created by including CPack # where CPackConfig.cmake is created by including CPack
# And then there's ways to customize this as well # And then there's ways to customize this as well

View File

@ -23,6 +23,10 @@
#include <QHash> #include <QHash>
#include <QStack> #include <QStack>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
class QucsDoc; class QucsDoc;
class Schematic; class Schematic;
class SimMessage; class SimMessage;
@ -301,6 +305,10 @@ public:
*addToProj, *editFind, *insEntity, *selectMarker, *addToProj, *editFind, *insEntity, *selectMarker,
*createLib, *importData, *graph2csv, *createPkg, *extractPkg, *createLib, *importData, *graph2csv, *createPkg, *extractPkg,
*callAtt, *callRes, *centerHor, *centerVert, *loadModule, *buildModule; *callAtt, *callRes, *centerHor, *centerVert, *loadModule, *buildModule;
#ifdef WITH_SPICE
QAction *helpQucsIndex;
#endif
QAction *simSettings; QAction *simSettings;
QAction *buildVAModule; QAction *buildVAModule;
@ -349,6 +357,9 @@ public slots:
void slotCallAtt(); void slotCallAtt();
void slotCallRes(); void slotCallRes();
void slotHelpIndex(); // shows a HTML docu: Help Index void slotHelpIndex(); // shows a HTML docu: Help Index
#ifdef WITH_SPICE
void slotHelpQucsIndex();
#endif
void slotGettingStarted(); // shows a HTML docu: Getting started void slotGettingStarted(); // shows a HTML docu: Getting started
void slotChangeProps(); void slotChangeProps();
void slotAddToProject(); void slotAddToProject();

View File

@ -843,13 +843,28 @@ void QucsApp::launchTool(const QString& prog, const QString& progDesc, const QSt
// -------------------------------------------------------------- // --------------------------------------------------------------
void QucsApp::slotHelpIndex() void QucsApp::slotHelpIndex()
{ {
#ifndef WITH_SPICE
showHTML("index.html"); showHTML("index.html");
#else
QDesktopServices::openUrl(QUrl("https://qucs-help.readthedocs.org/en/spice4qucs/"));
#endif
} }
#ifdef WITH_SPICE
void QucsApp::slotHelpQucsIndex()
{
QDesktopServices::openUrl(QUrl("https://qucs-help.readthedocs.io/"));
}
#endif
// -------------------------------------------------------------- // --------------------------------------------------------------
void QucsApp::slotGettingStarted() void QucsApp::slotGettingStarted()
{ {
#ifndef WITH_SPICE
showHTML("start.html"); showHTML("start.html");
#else
QDesktopServices::openUrl(QUrl("https://qucs-help.readthedocs.io/en/0.0.18/start.html"));
#endif
} }
// -------------------------------------------------------------- // --------------------------------------------------------------

View File

@ -649,6 +649,13 @@ void QucsApp::initActions()
helpIndex->setWhatsThis(tr("Help Index\n\nIndex of intern Qucs help")); helpIndex->setWhatsThis(tr("Help Index\n\nIndex of intern Qucs help"));
connect(helpIndex, SIGNAL(triggered()), SLOT(slotHelpIndex())); connect(helpIndex, SIGNAL(triggered()), SLOT(slotHelpIndex()));
#ifdef WITH_SPICE
helpQucsIndex = new QAction(tr("Help Index (basic Qucs version)"), this);
helpQucsIndex->setStatusTip(tr("Index of basic Qucs Help"));
helpQucsIndex->setWhatsThis(tr("Help Index\n\nIndex of basic Qucs help"));
connect(helpQucsIndex, SIGNAL(triggered()), SLOT(slotHelpQucsIndex()));
#endif
helpGetStart = new QAction(tr("Getting Started..."), this); helpGetStart = new QAction(tr("Getting Started..."), this);
helpGetStart->setStatusTip(tr("Getting Started with Qucs")); helpGetStart->setStatusTip(tr("Getting Started with Qucs"));
helpGetStart->setWhatsThis( helpGetStart->setWhatsThis(
@ -812,6 +819,9 @@ void QucsApp::initMenuBar()
helpMenu = new QMenu(tr("&Help")); // menuBar entry helpMenu helpMenu = new QMenu(tr("&Help")); // menuBar entry helpMenu
helpMenu->addAction(helpIndex); helpMenu->addAction(helpIndex);
#ifdef WITH_SPICE
helpMenu->addAction(helpQucsIndex);
#endif
helpMenu->addAction(helpGetStart); helpMenu->addAction(helpGetStart);
helpMenu->insertSeparator(); helpMenu->insertSeparator();