summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-03-31 13:21:43 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-03-31 13:21:43 +0300
commitf9bd37d742a2f8851d4afc98eb207b9ee26fa42b (patch)
tree4138e9e18987461f64075f7ef2d0adcf43c47233
parent5c8cb41864e75d952da036a826f1f6de57465f7e (diff)
fixes #4316 (NewStory считает системную историю "неизвестным контактом")
-rw-r--r--src/mir_app/res/resource.rc2
-rw-r--r--src/mir_app/src/resource.h1
-rw-r--r--src/mir_app/src/srmm_main.cpp14
3 files changed, 12 insertions, 5 deletions
diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc
index 3928c68da5..858cf54d98 100644
--- a/src/mir_app/res/resource.rc
+++ b/src/mir_app/res/resource.rc
@@ -82,7 +82,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
CONTROL "Are you sure to wipe the history for %s?",IDC_TOPLINE,
"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,7,7,270,8
- LTEXT "This will erase all history for this contact!",IDC_STATIC,7,18,239,16
+ LTEXT "This will erase all history for this contact!",IDC_SECONDLINE,7,18,239,16
CONTROL "Remove server history",IDC_DELSERVERHISTORY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,37,280,8
CONTROL "Remove history for everyone",IDC_BOTH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,50,260,8
PUSHBUTTON "&Yes",IDOK,149,65,65,14
diff --git a/src/mir_app/src/resource.h b/src/mir_app/src/resource.h
index e6bf49bc6d..9900567fb1 100644
--- a/src/mir_app/src/resource.h
+++ b/src/mir_app/src/resource.h
@@ -495,6 +495,7 @@
#define IDC_SAVEAS 1513
#define IDC_AUTORENAME 1514
#define IDC_ASK 1516
+#define IDC_SECONDLINE 1533
#define IDC_HIDE 1534
#define IDC_TOPLINE 1535
#define IDC_BOTH 1536
diff --git a/src/mir_app/src/srmm_main.cpp b/src/mir_app/src/srmm_main.cpp
index 2499505bb6..3d7897de67 100644
--- a/src/mir_app/src/srmm_main.cpp
+++ b/src/mir_app/src/srmm_main.cpp
@@ -65,10 +65,16 @@ public:
lf.lfWeight = FW_BOLD;
SendDlgItemMessage(m_hwnd, IDC_TOPLINE, WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), 0);
- wchar_t szFormat[256], szFinal[256];
- GetDlgItemText(m_hwnd, IDC_TOPLINE, szFormat, _countof(szFormat));
- mir_snwprintf(szFinal, szFormat, Clist_GetContactDisplayName(m_hContact));
- SetDlgItemText(m_hwnd, IDC_TOPLINE, szFinal);
+ if (m_hContact != 0) {
+ wchar_t szFormat[256], szFinal[256];
+ GetDlgItemText(m_hwnd, IDC_TOPLINE, szFormat, _countof(szFormat));
+ mir_snwprintf(szFinal, szFormat, Clist_GetContactDisplayName(m_hContact));
+ SetDlgItemText(m_hwnd, IDC_TOPLINE, szFinal);
+ }
+ else {
+ SetDlgItemText(m_hwnd, IDC_TOPLINE, TranslateT("Are you sure to wipe the system history?"));
+ ShowWindow(GetDlgItem(m_hwnd, IDC_SECONDLINE), SW_HIDE);
+ }
SetFocus(GetDlgItem(m_hwnd, IDNO));
SetWindowPos(m_hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);