Macros LOG LNW EXEC

* Added :[notes] string to LOG and LNW macro tags
    - <LOG:append this text>
    - <LNW:append this text>
    the specified text will be appended to the notes field as
    the string "\nappend this text" before saving the log data
    <LOG> and <LNW> behave as before.
  * Added post execute expansion of returned macro text.
    Restores ability to include macro tags such as <MYCALL>
    in the returned text.  The macro tag will then be
    expanded before transmission.
pull/1/head
David Freese 2012-12-06 11:00:11 -06:00
rodzic 2004343286
commit 2719b0fc43
2 zmienionych plików z 24 dodań i 6 usunięć

Wyświetl plik

@ -101,9 +101,12 @@ void loadBrowser(Fl_Widget *widget) {
#endif
w->add(LINE_SEP);
w->add(_("<LOG>\tsave QSO data"));
w->add(_("<LNW>\tlog at xmt time"));
w->add(_("<CLRLOG>\tclear log fields"));
w->add(_("<LOG>\tsave QSO data"));
w->add(_("<LOG:msg>\tsaveQSO data, append msg to notes"));
w->add(_("<LNW>\tlog at xmt time"));
w->add(_("<LNW:msg>\tsaveQSO data, append msg to notes"));
w->add(_("<EQSL>\tlog eQSL"));
w->add(_("<EQSL:[msg]>\tlog eQSL optional msg"));
w->add(LINE_SEP);

Wyświetl plik

@ -860,8 +860,15 @@ static void pLOG(std::string &s, size_t &i, size_t endbracket)
s.replace(i, endbracket - i + 1, "");
return;
}
size_t start = s.find(':', i);
if (start != std::string::npos) {
string msg = inpNotes->value();
if (!msg.empty()) msg.append("\n");
msg.append(s.substr(start + 1, endbracket-start-1));
inpNotes->value(msg.c_str());
}
s.replace(i, endbracket - i + 1, "");
qsoSave_cb(0, 0);
s.replace(i, 5, "");
}
static void pLNW(std::string &s, size_t &i, size_t endbracket)
@ -870,7 +877,14 @@ static void pLNW(std::string &s, size_t &i, size_t endbracket)
s.replace(i, endbracket - i + 1, "");
return;
}
s.replace(i, 5, "^L");
size_t start = s.find(':', i);
if (start != std::string::npos) {
string msg = inpNotes->value();
if (!msg.empty()) msg.append("\n");
msg.append(s.substr(start + 1, endbracket-start-1));
inpNotes->value(msg.c_str());
}
s.replace(i, endbracket - i + 1, "^L");
}
static void pCLRLOG(std::string &s, size_t &i, size_t endbracket)
@ -1697,6 +1711,7 @@ static void pEXEC(std::string &s, size_t &i, size_t endbracket)
lnbuff.erase(lnbuff.length()-1,1);
if (!lnbuff.empty()) {
lnbuff = m.expandMacro(lnbuff, false);
s.insert(i, lnbuff);
i += lnbuff.length();
} else
@ -1955,8 +1970,8 @@ static const MTAGS mtags[] = {
{"<XBEG>", pXBEG},
{"<XEND>", pXEND},
{"<SAVEXCHG>", pSAVEXCHG},
{"<LOG>", pLOG},
{"<LNW>", pLNW},
{"<LOG", pLOG},
{"<LNW", pLNW},
{"<CLRLOG>", pCLRLOG},
{"<EQSL", pEQSL},
{"<TIMER:", pTIMER},