diff options
| author | 2015-05-22 00:05:05 +0200 | |
|---|---|---|
| committer | 2015-05-22 00:05:05 +0200 | |
| commit | 8742b3b8669f85df3c15196f0a51f43d932c0c93 (patch) | |
| tree | 1e8ff896e357efed25aeab817aed0b3e7baabce3 | |
| parent | c8c9bffb2b439b95d5061d639ebecec07271ae01 (diff) | |
| parent | 88e5130bd86992819a036ef982733b5ee344d656 (diff) | |
| download | OneRoll-8742b3b8669f85df3c15196f0a51f43d932c0c93.tar.gz OneRoll-8742b3b8669f85df3c15196f0a51f43d932c0c93.zip | |
Merge branch 'master' of github.com:obiwankennedy/DiceParser
| -rw-r--r-- | diceparser.cpp | 12 | ||||
| -rw-r--r-- | diceparser.h | 6 | ||||
| -rw-r--r-- | node/helpnode.cpp | 7 | ||||
| -rw-r--r-- | node/helpnode.h | 7 |
4 files changed, 27 insertions, 5 deletions
diff --git a/diceparser.cpp b/diceparser.cpp index f8f82d6..570c96b 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -593,7 +593,10 @@ bool DiceParser::readCommand(QString& str,ExecutionNode* & node) { if(str=="help") { - node = new HelpNode(); + HelpNode* help = new HelpNode(); + help->setHelpPath(m_helpPath); + node = help; + } else if(str=="la") { @@ -929,7 +932,8 @@ void DiceParser::writeDownDotTree(QString filepath) QTextStream in(&file); in << str; } - - //qDebug()<< str; - +} +void DiceParser::setPathToHelp(QString l) +{ + m_helpPath = l; } diff --git a/diceparser.h b/diceparser.h index fa56b0f..efca060 100644 --- a/diceparser.h +++ b/diceparser.h @@ -186,6 +186,11 @@ public: * @return */ QMap<ExecutionNode::ERROR_CODE,QString> getErrorMap(); + /** + * @brief setPathToHelp set the path to the documentation, this path must be adatped to the lang of application etc… + * @param l the path. + */ + void setPathToHelp(QString l); private: /** @@ -291,6 +296,7 @@ private: ExecutionNode* m_current; QString m_command; ParsingToolBox* m_parsingToolbox; + QString m_helpPath; }; #endif // DICEPARSER_H diff --git a/node/helpnode.cpp b/node/helpnode.cpp index d41464b..6108e4d 100644 --- a/node/helpnode.cpp +++ b/node/helpnode.cpp @@ -1,6 +1,7 @@ #include "helpnode.h" HelpNode::HelpNode() + : m_path("https://github.com/obiwankennedy/DiceParser/blob/master/HelpMe.md") { m_result = new StringResult(); } @@ -30,10 +31,14 @@ void HelpNode::run(ExecutionNode* previous) } QString HelpNode::toString() const { - return QObject::tr("Rolisteam Dice Parser:\nFull documentation at: https://github.com/obiwankennedy/DiceParser/blob/master/HelpMe.md \n"); + return QObject::tr("Rolisteam Dice Parser:\nFull documentation at: %1 \n").arg(m_path); } qint64 HelpNode::getPriority() const { return 0; } +void HelpNode::setHelpPath(QString path) +{ + m_path = path; +} diff --git a/node/helpnode.h b/node/helpnode.h index 3a949d9..88a0842 100644 --- a/node/helpnode.h +++ b/node/helpnode.h @@ -32,6 +32,13 @@ public: * @return */ virtual qint64 getPriority() const; + /** + * @brief setHelpPath + * @param path + */ + void setHelpPath(QString path); +private: + QString m_path; }; |