From a76776079b6d15e92dffd0c5c0016389092b1c8b Mon Sep 17 00:00:00 2001 From: aunsane Date: Sun, 25 Feb 2018 14:45:28 +0300 Subject: Fixes related with 7fc01c9 --- protocols/Tox/src/tox_dialogs.h | 27 --------------------------- protocols/Tox/src/tox_options.cpp | 24 +++--------------------- protocols/Tox/src/tox_options.h | 23 +++-------------------- 3 files changed, 6 insertions(+), 68 deletions(-) (limited to 'protocols/Tox/src') diff --git a/protocols/Tox/src/tox_dialogs.h b/protocols/Tox/src/tox_dialogs.h index dedd355e1b..b5cbba0639 100644 --- a/protocols/Tox/src/tox_dialogs.h +++ b/protocols/Tox/src/tox_dialogs.h @@ -1,33 +1,6 @@ #ifndef _TOX_DIALOGS_H_ #define _TOX_DIALOGS_H_ -class CCtrlLabel : public CCtrlData -{ - typedef CCtrlData CSuper; - -public: - CCtrlLabel(CDlgBase *dlg, int ctrlId) : - CSuper(dlg, ctrlId) - { - } - - virtual void OnInit() - { - CSuper::OnInit(); - OnReset(); - } - - virtual void OnReset() - { - if (GetDataType() == DBVT_WCHAR) - SetText(LoadText()); - else if (GetDataType() != DBVT_DELETED) - SetInt(LoadInt()); - } -}; - -/////////////////////////////////////////////// - typedef CProtoDlgBase CToxDlgBase; #endif //_TOX_DIALOGS_H_ \ No newline at end of file diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 71353d3263..119bce5a0d 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -9,8 +9,7 @@ CToxOptionsMain::CToxOptionsMain(CToxProto *proto, int idDialog) m_passwordRemove(this, IDC_PASSWORD_REMOVE), m_group(this, IDC_GROUP), m_enableUdp(this, IDC_ENABLE_UDP), m_enableUdpHolePunching(this, IDC_ENABLE_HOLEPUNCHING), m_enableIPv6(this, IDC_ENABLE_IPV6), m_enableLocalDiscovery(this, IDC_ENABLE_LOCALDISCOVERY), - m_maxConnectRetries(this, IDC_MAXCONNECTRETRIES), m_maxConnectRetriesSpin(this, IDC_MAXCONNECTRETRIESSPIN), - m_maxReconnectRetries(this, IDC_MAXRECONNECTRETRIES), m_maxReconnectRetriesSpin(this, IDC_MAXRECONNECTRETRIESSPIN) + m_maxConnectRetries(this, IDC_MAXCONNECTRETRIESSPIN), m_maxReconnectRetries(this, IDC_MAXRECONNECTRETRIESSPIN) { CreateLink(m_toxAddress, TOX_SETTINGS_ID, L""); CreateLink(m_nickname, "Nick", L""); @@ -67,10 +66,8 @@ void CToxOptionsMain::OnInitDialog() m_nickname.SetMaxLength(TOX_MAX_NAME_LENGTH); m_group.SetMaxLength(64); - m_maxConnectRetriesSpin.SetRange(255, 1); - m_maxConnectRetriesSpin.SetPosition(m_proto->getByte("MaxConnectRetries", TOX_MAX_CONNECT_RETRIES)); - m_maxReconnectRetriesSpin.SetRange(255, 1); - m_maxReconnectRetriesSpin.SetPosition(m_proto->getByte("MaxReconnectRetries", TOX_MAX_RECONNECT_RETRIES)); + m_maxConnectRetries.SetRange(255, 1); + m_maxReconnectRetries.SetRange(255, 1); } void CToxOptionsMain::PasswordCreate_OnClick(CCtrlButton*) @@ -333,21 +330,6 @@ void CToxNodeEditor::OnClose() Utils_SaveWindowPosition(m_hwnd, NULL, MODULE, "EditNodeDlg"); } -/****************************************/ - -CCtrlNodeList::CCtrlNodeList(CDlgBase* dlg, int ctrlId) - : CCtrlListView(dlg, ctrlId) -{} - -BOOL CCtrlNodeList::OnNotify(int idCtrl, NMHDR *pnmh) -{ - if (pnmh->code == NM_CLICK) { - TEventInfo evt = { this, pnmh }; - OnClick(&evt); - return TRUE; - } - return CCtrlListView::OnNotify(idCtrl, pnmh); -} /****************************************/ diff --git a/protocols/Tox/src/tox_options.h b/protocols/Tox/src/tox_options.h index 5a85edea61..74987139da 100644 --- a/protocols/Tox/src/tox_options.h +++ b/protocols/Tox/src/tox_options.h @@ -24,10 +24,8 @@ private: CCtrlCheck m_enableIPv6; CCtrlCheck m_enableLocalDiscovery; - CCtrlEdit m_maxConnectRetries; - CCtrlSpin m_maxConnectRetriesSpin; - CCtrlEdit m_maxReconnectRetries; - CCtrlSpin m_maxReconnectRetriesSpin; + CCtrlSpin m_maxConnectRetries; + CCtrlSpin m_maxReconnectRetries; protected: void OnInitDialog(); @@ -85,21 +83,6 @@ public: CToxNodeEditor(int iItem, CCtrlListView *m_list); }; -/****************************************/ - -class CCtrlNodeList : public CCtrlListView -{ -private: - typedef CCtrlListView CSuper; - -protected: - BOOL OnNotify(int idCtrl, NMHDR *pnmh); - -public: - CCtrlNodeList(CDlgBase* dlg, int ctrlId); - - CCallback OnClick; -}; /****************************************/ @@ -108,7 +91,7 @@ class CToxOptionsNodeList : public CToxDlgBase private: typedef CToxDlgBase CSuper; - CCtrlNodeList m_nodes; + CCtrlListView m_nodes; CCtrlButton m_addNode; CCtrlButton m_updateNodes; -- cgit v1.2.3