diff --git a/server/2015Remote/2015Remote.rc b/server/2015Remote/2015Remote.rc index 5ef24ff..3d41393 100644 Binary files a/server/2015Remote/2015Remote.rc and b/server/2015Remote/2015Remote.rc differ diff --git a/server/2015Remote/NotifySettingsDlg.cpp b/server/2015Remote/NotifySettingsDlg.cpp index 2b88945..651827e 100644 --- a/server/2015Remote/NotifySettingsDlg.cpp +++ b/server/2015Remote/NotifySettingsDlg.cpp @@ -56,7 +56,7 @@ BOOL NotifySettingsDlg::OnInitDialog() SetDlgItemText(IDC_STATIC_TRIGGER, _TR(_T("触å�‘æ�¡ä»¶:"))); SetDlgItemText(IDC_STATIC_MATCH_COLUMN, _TR(_T("匹é…�列:"))); SetDlgItemText(IDC_STATIC_KEYWORDS, _TR(_T("关键è¯�:"))); - SetDlgItemText(IDC_STATIC_KEYWORDS_HINT, _TR(_T("(多个关键è¯�用分å�·åˆ†éš”,匹é…�任一项å�³è§¦å�‘通知)"))); + SetDlgItemText(IDC_STATIC_KEYWORDS_HINT, _TR(_T("(æ¯�行一个关键è¯�,匹é…�任一项å�³è§¦å�‘通知)"))); SetDlgItemText(IDC_STATIC_NOTIFY_TIP, _TR(_T("æ��示: å�Œä¸€ä¸»æœº 60 分钟内仅通知一次"))); SetDlgItemText(IDOK, _TR("确定")); SetDlgItemText(IDCANCEL, _TR("å�–消")); @@ -154,7 +154,24 @@ void NotifySettingsDlg::LoadSettings() m_comboNotifyColumn.SetCurSel(rule.columnIndex); } - m_editNotifyPattern.SetWindowText(CString(rule.matchPattern.c_str())); + // Display stored semicolon-separated keywords as one keyword per line. + { + CString pattern; + const CString stored(CA2T(rule.matchPattern.c_str(), CP_UTF8)); + int start = 0; + for (;;) { + const int pos = stored.Find(_T(';'), start); + CString kw = (pos < 0) ? stored.Mid(start) : stored.Mid(start, pos - start); + kw.Trim(); + if (!kw.IsEmpty()) { + if (!pattern.IsEmpty()) pattern += _T("\r\n"); + pattern += kw; + } + if (pos < 0) break; + start = pos + 1; + } + m_editNotifyPattern.SetWindowText(pattern); + } } void NotifySettingsDlg::SaveSettings() @@ -189,8 +206,26 @@ void NotifySettingsDlg::SaveSettings() sel = m_comboNotifyColumn.GetCurSel(); rule.columnIndex = (sel >= 0) ? (int)m_comboNotifyColumn.GetItemData(sel) : ONLINELIST_COMPUTER_NAME; + // Normalize one-keyword-per-line input back to semicolon-separated storage. m_editNotifyPattern.GetWindowText(str); - rule.matchPattern = CT2A(str, CP_UTF8); + str.Replace(_T("\r\n"), _T("\n")); + str.Replace(_T('\r'), _T('\n')); + { + CString joined; + int start = 0; + for (;;) { + const int pos = str.Find(_T('\n'), start); + CString kw = (pos < 0) ? str.Mid(start) : str.Mid(start, pos - start); + kw.Trim(); + if (!kw.IsEmpty()) { + if (!joined.IsEmpty()) joined += _T(';'); + joined += kw; + } + if (pos < 0) break; + start = pos + 1; + } + rule.matchPattern = CT2A(joined, CP_UTF8); + } // Update manager config and save GetNotifyManager().SetConfig(m_config); diff --git a/server/2015Remote/lang/en_US.ini b/server/2015Remote/lang/en_US.ini index cb78628..4733d9e 100644 --- a/server/2015Remote/lang/en_US.ini +++ b/server/2015Remote/lang/en_US.ini @@ -1493,7 +1493,7 @@ SMTP ´¥·¢Ìõ¼þ:=Trigger: Æ¥ÅäÁÐ:=Match Column: ¹Ø¼ü´Ê:=Keywords: -(¶à¸ö¹Ø¼ü´ÊÓ÷ֺŷָô£¬Æ¥ÅäÈÎÒ»Ïî¼´´¥·¢Í¨Öª)=(Multiple keywords separated by semicolon) +(ÿÐÐÒ»¸ö¹Ø¼ü´Ê£¬Æ¥ÅäÈÎÒ»Ïî¼´´¥·¢Í¨Öª)=(One keyword per line) Ìáʾ: ͬһÖ÷»ú 60 ·ÖÖÓÄÚ½ö֪ͨһ´Î=Tip: Same host notified only once per 60 minutes Ö÷»úÉÏÏß=Host Online IPµØÖ·=IP Address