summaryrefslogtreecommitdiff
path: root/plugins/NewAwaySysMod/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NewAwaySysMod/src')
-rw-r--r--plugins/NewAwaySysMod/src/AwayOpt.cpp203
-rw-r--r--plugins/NewAwaySysMod/src/resource.h5
2 files changed, 0 insertions, 208 deletions
diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp
index abb0e0516a..b0b313b999 100644
--- a/plugins/NewAwaySysMod/src/AwayOpt.cpp
+++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp
@@ -675,209 +675,6 @@ Dlg4Buttons[] = {
IDC_MESSAGEDLG_VARS, ILI_NOICON, LPGENW("Open Variables help dialog"),
};
-INT_PTR CALLBACK MessagesModernOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- static int ChangeLock = 0;
- static CMsgTree* MsgTree = NULL;
-
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- MySetPos(hwndDlg);
- ChangeLock++;
- g_MessagesOptPage.SetWnd(hwndDlg);
- SendDlgItemMessage(hwndDlg, IDC_MESSAGEDLG_MSGTITLE, EM_LIMITTEXT, TREEITEMTITLE_MAXLEN, 0);
- SendDlgItemMessage(hwndDlg, IDC_MESSAGEDLG_MSGDATA, EM_LIMITTEXT, AWAY_MSGDATA_MAX, 0);
-
- // init image buttons
- for (int i = 0; i < _countof(Dlg4Buttons); i++) {
- HWND hButton = GetDlgItem(hwndDlg, Dlg4Buttons[i].DlgItem);
- SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)TranslateW(Dlg4Buttons[i].Text), BATF_UNICODE);
- SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0);
- }
- // now default status message buttons
- for (int i = 0; i < _countof(Dlg4DefMsgDlgItems); i++) {
- HWND hButton = GetDlgItem(hwndDlg, Dlg4DefMsgDlgItems[i].DlgItem);
- SendMessage(hButton, BUTTONADDTOOLTIP, (WPARAM)pcli->pfnGetStatusModeDescription(Dlg4DefMsgDlgItems[i].Status, 0), BATF_UNICODE);
- SendMessage(hButton, BUTTONSETASPUSHBTN, TRUE, 0);
- SendMessage(hButton, BUTTONSETASFLATBTN, TRUE, 0);
- g_OrigDefStatusButtonMsgProc = (WNDPROC)SetWindowLongPtr(hButton, GWLP_WNDPROC, (LONG_PTR)DefStatusButtonSubclassProc);
- }
- SendMessage(hwndDlg, UM_ICONSCHANGED, 0, 0);
- g_MessagesOptPage.DBToMemToPage();
- _ASSERT(!MsgTree);
- MsgTree = new CMsgTree(GetDlgItem(hwndDlg, IDC_MESSAGEDLG_MSGTREE));
- if (!MsgTree->SetSelection(MsgTree->GetDefMsg(ID_STATUS_AWAY), MTSS_BYID))
- MsgTree->SetSelection(g_Messages_PredefinedRootID, MTSS_BYID);
-
- ChangeLock--;
- return true;
-
- case UM_ICONSCHANGED:
- for (int i = 0; i < _countof(Dlg4DefMsgDlgItems); i++)
- SendDlgItemMessage(hwndDlg, Dlg4DefMsgDlgItems[i].DlgItem, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_IconList[Dlg4DefMsgDlgItems[i].IconIndex]);
-
- for (int i = 0; i < _countof(Dlg4Buttons); i++)
- if (Dlg4Buttons[i].IconIndex != ILI_NOICON)
- SendDlgItemMessage(hwndDlg, Dlg4Buttons[i].DlgItem, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_IconList[Dlg4Buttons[i].IconIndex]);
-
- variables_skin_helpbutton(hwndDlg, IDC_MESSAGEDLG_VARS);
- break;
-
- case WM_NOTIFY:
- if (((NMHDR*)lParam)->code == PSN_APPLY) {
- HWND hTreeView = GetDlgItem(hwndDlg, IDC_MESSAGEDLG_MSGTREE);
- HTREEITEM hSelectedItem = TreeView_GetSelection(hTreeView);
- ChangeLock++;
- TreeView_SelectItem(hTreeView, NULL);
- TreeView_SelectItem(hTreeView, hSelectedItem);
- ChangeLock--;
- MsgTree->Save();
- return true;
- }
-
- if (((LPNMHDR)lParam)->idFrom == IDC_MESSAGEDLG_MSGTREE) {
- PNMMSGTREE pnm = (PNMMSGTREE)lParam;
- switch (((LPNMHDR)lParam)->code) {
- case MTN_SELCHANGED:
- if (pnm->ItemOld && !(pnm->ItemOld->Flags & (TIF_ROOTITEM | TIF_GROUP))) {
- TCString Msg;
- GetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGDATA, Msg.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
- Msg.ReleaseBuffer();
- if (((CTreeItem*)pnm->ItemOld)->User_Str1 != (const wchar_t*)Msg) {
- ((CTreeItem*)pnm->ItemOld)->User_Str1 = Msg;
- MsgTree->SetModified(true);
- }
- }
- if (pnm->ItemNew) {
- ChangeLock++;
- if (!(pnm->ItemNew->Flags & TIF_ROOTITEM)) {
- SetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGTITLE, pnm->ItemNew->Title);
- SetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGDATA, (pnm->ItemNew->Flags & TIF_GROUP) ? L"" : ((CTreeItem*)pnm->ItemNew)->User_Str1);
- }
- else {
- SetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGTITLE, L"");
- if (pnm->ItemNew->ID == g_Messages_RecentRootID)
- SetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGDATA, TranslateT("Your most recent status messages are placed in this category. It's not recommended that you put your messages manually here, as they'll be replaced by your recent messages."));
- else {
- _ASSERT(pnm->ItemNew->ID == g_Messages_PredefinedRootID);
- SetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGDATA, TranslateT("You can put your frequently used and favorite messages in this category."));
- }
- }
- for (int i = 0; i < _countof(Dlg4DefMsgDlgItems); i++) {
- COptItem_Checkbox *Checkbox = (COptItem_Checkbox*)g_MessagesOptPage.Find(Dlg4DefMsgDlgItems[i].DlgItem);
- Checkbox->SetWndValue(g_MessagesOptPage.GetWnd(), MsgTree->GetDefMsg(Dlg4DefMsgDlgItems[i].Status) == pnm->ItemNew->ID);
- }
- ChangeLock--;
- }
- EnableMessagesOptDlgControls(MsgTree);
- return 0;
-
- case MTN_DEFMSGCHANGED:
- if (!ChangeLock) {
- CBaseTreeItem* SelectedItem = MsgTree->GetSelection();
- _ASSERT(SelectedItem);
- if ((pnm->ItemOld && pnm->ItemOld->ID == SelectedItem->ID) || (pnm->ItemNew && pnm->ItemNew->ID == SelectedItem->ID)) { // SelectedItem contains the same info as one of ItemOld or ItemNew - so we'll just use SelectedItem and won't bother with identifying which of ItemOld or ItemNew is currently selected
- for (int i = 0; i < _countof(Dlg4DefMsgDlgItems); i++) {
- COptItem_Checkbox *Checkbox = (COptItem_Checkbox*)g_MessagesOptPage.Find(Dlg4DefMsgDlgItems[i].DlgItem);
- Checkbox->SetWndValue(g_MessagesOptPage.GetWnd(), MsgTree->GetDefMsg(Dlg4DefMsgDlgItems[i].Status) == SelectedItem->ID);
- }
- }
- }
- if (!ChangeLock)
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- return 0;
-
- case MTN_ITEMRENAMED:
- {
- CBaseTreeItem *SelectedItem = MsgTree->GetSelection();
- _ASSERT(SelectedItem);
- if (pnm->ItemNew->ID == SelectedItem->ID && !ChangeLock) {
- ChangeLock++;
- SetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGTITLE, pnm->ItemNew->Title);
- ChangeLock--;
- }
- } // go through
- case MTN_ENDDRAG:
- case MTN_NEWCATEGORY:
- case MTN_NEWMESSAGE:
- case MTN_DELETEITEM:
- case TVN_ITEMEXPANDED:
- if (!ChangeLock)
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- return 0;
- }
- }
- break;
-
- case WM_COMMAND:
- switch (HIWORD(wParam)) {
- case BN_CLICKED:
- switch (LOWORD(wParam)) {
- case IDC_MESSAGEDLG_DEF_ONL:
- case IDC_MESSAGEDLG_DEF_AWAY:
- case IDC_MESSAGEDLG_DEF_NA:
- case IDC_MESSAGEDLG_DEF_OCC:
- case IDC_MESSAGEDLG_DEF_DND:
- case IDC_MESSAGEDLG_DEF_FFC:
- case IDC_MESSAGEDLG_DEF_INV:
- case IDC_MESSAGEDLG_DEF_OTP:
- case IDC_MESSAGEDLG_DEF_OTL:
- for (int i = 0; i < _countof(Dlg4DefMsgDlgItems); i++) {
- if (LOWORD(wParam) == Dlg4DefMsgDlgItems[i].DlgItem) {
- // PSM_CHANGED is sent here through MTN_DEFMSGCHANGED, so we don't need to send it once more
- MsgTree->SetDefMsg(Dlg4DefMsgDlgItems[i].Status, MsgTree->GetSelection()->ID);
- break;
- }
- }
- break;
- case IDC_MESSAGEDLG_VARS:
- my_variables_showhelp(hwndDlg, IDC_MESSAGEDLG_MSGDATA);
- break;
- case IDC_MESSAGEDLG_DEL:
- MsgTree->EnsureVisible(MsgTree->GetSelection()->hItem);
- MsgTree->DeleteSelectedItem();
- break;
- case IDC_MESSAGEDLG_NEWCAT:
- MsgTree->AddCategory();
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGEDLG_MSGTITLE));
- break;
- case IDC_MESSAGEDLG_NEWMSG:
- MsgTree->AddMessage();
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGEDLG_MSGTITLE));
- break;
- case IDC_LNK_AUTOAWAY:
- Options_OpenPage(NULL, L"Status", L"Autoreply");
- }
- break;
- case EN_CHANGE:
- if (LOWORD(wParam) == IDC_MESSAGEDLG_MSGDATA || LOWORD(wParam) == IDC_MESSAGEDLG_MSGTITLE) {
- if (!ChangeLock) {
- if (LOWORD(wParam) == IDC_MESSAGEDLG_MSGTITLE) {
- CBaseTreeItem* TreeItem = MsgTree->GetSelection();
- if (TreeItem && !(TreeItem->Flags & TIF_ROOTITEM)) {
- GetDlgItemText(hwndDlg, IDC_MESSAGEDLG_MSGTITLE, TreeItem->Title.GetBuffer(TREEITEMTITLE_MAXLEN), TREEITEMTITLE_MAXLEN);
- TreeItem->Title.ReleaseBuffer();
- ChangeLock++;
- MsgTree->UpdateItem(TreeItem->ID);
- ChangeLock--;
- }
- }
- MsgTree->SetModified(true);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- }
- }
- break;
-
- case WM_DESTROY:
- delete MsgTree;
- MsgTree = NULL;
- g_MessagesOptPage.SetWnd(NULL);
- }
- return 0;
-}
-
// ================================================ Contact list ================================================
// Based on the code from built-in Miranda ignore module
diff --git a/plugins/NewAwaySysMod/src/resource.h b/plugins/NewAwaySysMod/src/resource.h
index 17b0647bce..422bf2f0d0 100644
--- a/plugins/NewAwaySysMod/src/resource.h
+++ b/plugins/NewAwaySysMod/src/resource.h
@@ -4,7 +4,6 @@
//
#define IDD_OPTDIALOGMAIN 101
#define IDD_MESSAGES 101
-#define IDD_MODERNOPT_MESSAGES 102
#define IDI_MSGICON 109
#define IDI_SOE_ENABLED 110
#define IDD_READAWAYMSG 111
@@ -50,7 +49,6 @@
#define IDC_SAWAYMSG_MSGDATA 1008
#define IDC_MOREOPTDLG_USEDEFMSG 1008
#define IDC_OPTDLG_SAVE 1010
-#define IDC_LNK_AUTOAWAY 1010
#define IDC_OPTDLG_RESET 1012
#define IDC_OPTDLG_VARSLIST 1013
#define IDC_MESSAGEDLG_VARS 1013
@@ -208,9 +206,6 @@
#define IDC_POPUPOPTDLG_LOGONLYWITHPOPUP 1177
#define IDC_POPUPOPTDLG_STATIC_EXTRATEXT 1178
#define IDC_REPLYDLG_STATIC_EXTRATEXT 1179
-#define IDC_TXT_TITLE1 1181
-#define IDC_TXT_TITLE2 1182
-#define IDC_TXT_TITLE3 1183
#define IDC_SAWAYMSG_STATIC_COUNTER 1202
#define IDC_READAWAYMSG_RETRIEVE 3453
#define IDS_MESSAGEDLG_DEF_ONL 20000