diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/NewStory/src/options.cpp | 28 | ||||
-rw-r--r-- | plugins/NewStory/src/templates.cpp | 10 |
2 files changed, 33 insertions, 5 deletions
diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp index 380783eec9..85b5d93d69 100644 --- a/plugins/NewStory/src/options.cpp +++ b/plugins/NewStory/src/options.cpp @@ -49,6 +49,7 @@ public: { btnDiscard.OnClick = Callback(this, &COptionsDlg::onClick_Discard); btnPreview.OnClick = Callback(this, &COptionsDlg::UpdatePreview); + bthVarHelp.OnClick = Callback(this, &COptionsDlg::onVarHelp); m_tree.OnSelChanged = Callback(this, &COptionsDlg::onSelChanged); } @@ -129,6 +130,33 @@ public: UpdatePreview(0); } + void onVarHelp(CCtrlButton*) + { + CMStringW wszVarHelp; + wszVarHelp.Format(L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s", + L"%", TranslateT("simply % character"), + L"%n", TranslateT("line break"), + L"%S", TranslateT("my nick"), + L"%N", TranslateT("buddy\'s nick"), + L"%c", TranslateT("event count"), + L"%I", TranslateT("icon"), + L"%i", TranslateT("direction icon"), + L"%D", TranslateT("direction symbol"), + L"%t", TranslateT("timestamp"), + L"%h", TranslateT("hour (24 hour format, 0-23)"), + L"%a", TranslateT("hour (12 hour format)"), + L"%m", TranslateT("minute"), + L"%s", TranslateT("second"), + L"%o", TranslateT("month"), + L"%d", TranslateT("day of month"), + L"%y", TranslateT("year"), + L"%w", TranslateT("day of week (Sunday, Monday.. translateable)"), + L"%p", TranslateT("am/pm symbol"), + L"%O", TranslateT("name of month, translateable"), + L"%M", TranslateT("the message string itself")); + MessageBox(m_hwnd, wszVarHelp, TranslateT("Variables Help"), MB_OK); + } + void onSelChanged(CCtrlTreeView::TEventInfo*) { TVITEMEX tvi; diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index 48fffaa62a..fc9fa15e0d 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -102,7 +102,7 @@ int TplMeasureVars(TemplateVars *vars, wchar_t *str) } // Loading variables -void vfGlobal(int, TemplateVars *vars, MCONTACT, HistoryArray::ItemData *) +void vfGlobal(int, TemplateVars *vars, MCONTACT, HistoryArray::ItemData *item) { // %%: simply % character vars->SetVar('%', L"%", false); @@ -110,10 +110,10 @@ void vfGlobal(int, TemplateVars *vars, MCONTACT, HistoryArray::ItemData *) // %n: line break vars->SetVar('n', L"\x0d\x0a", false); - // %M: my nick (not for messages) - //todo: not working now - wchar_t *buf = Clist_GetContactDisplayName(0, 0); - vars->SetVar('M', buf, false); + // %S: my nick (not for messages) + char* proto = Proto_GetBaseAccountName(item->hContact); + ptrW nick(Contact_GetInfo(CNF_DISPLAY, 0, proto)); + vars->SetVar('S', nick, false); } void vfContact(int, TemplateVars *vars, MCONTACT hContact, HistoryArray::ItemData *) |