diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-11 17:09:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-11 17:09:17 +0300 |
commit | b2c91edc9646daa331de71d589e4fec6bdef4945 (patch) | |
tree | 847a77d0686d26e25b126313fbaa8262c81f8d1a /protocols/SkypeWeb | |
parent | ae081843e9663b3cb36b17309fbce1d2967315f1 (diff) |
GUI change:
- methods OnInitDialog, OnApply & OnClose of CDlgBase now return true if successful. return of false prevents a dialog from being loaded or left respectively;
- massive code cleaning considering the 'virtual' attribute of overridden methods;
- also fixes #1476 (Don't close "Create new account" window if user not set account name)
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/skype_dialogs.cpp | 6 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_dialogs.h | 8 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_options.cpp | 7 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_options.h | 4 |
4 files changed, 13 insertions, 12 deletions
diff --git a/protocols/SkypeWeb/src/skype_dialogs.cpp b/protocols/SkypeWeb/src/skype_dialogs.cpp index 231b1025d6..2e1a6aefdc 100644 --- a/protocols/SkypeWeb/src/skype_dialogs.cpp +++ b/protocols/SkypeWeb/src/skype_dialogs.cpp @@ -37,11 +37,12 @@ CSkypeInviteDlg::CSkypeInviteDlg(CSkypeProto *proto) : m_ok.OnClick = Callback(this, &CSkypeInviteDlg::btnOk_OnOk);
}
-void CSkypeInviteDlg::OnInitDialog()
+bool CSkypeInviteDlg::OnInitDialog()
{
for (auto &hContact : m_proto->AccContacts())
if (!m_proto->isChatRoom(hContact))
m_combo.AddString(Clist_GetContactDisplayName(hContact), hContact);
+ return true;
}
void CSkypeInviteDlg::btnOk_OnOk(CCtrlButton*)
@@ -64,13 +65,14 @@ CSkypeGCCreateDlg::~CSkypeGCCreateDlg() m_ContactsList.destroy();
}
-void CSkypeGCCreateDlg::OnInitDialog()
+bool CSkypeGCCreateDlg::OnInitDialog()
{
SetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE,
GetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE) | CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE);
m_clc.SendMsg(CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT, 0);
ResetListOptions(&m_clc);
+ return true;
}
void CSkypeGCCreateDlg::btnOk_OnOk(CCtrlButton*)
diff --git a/protocols/SkypeWeb/src/skype_dialogs.h b/protocols/SkypeWeb/src/skype_dialogs.h index 7b2fc0c2e2..e13f48dccf 100644 --- a/protocols/SkypeWeb/src/skype_dialogs.h +++ b/protocols/SkypeWeb/src/skype_dialogs.h @@ -29,8 +29,8 @@ private: CCtrlCombo m_combo;
protected:
-
- void OnInitDialog();
+ bool OnInitDialog() override;
+
void btnOk_OnOk(CCtrlButton*);
public:
@@ -48,15 +48,13 @@ private: CCtrlClc m_clc;
protected:
+ bool OnInitDialog() override;
- void OnInitDialog();
void btnOk_OnOk(CCtrlButton*);
void FilterList(CCtrlClc*);
void ResetListOptions(CCtrlClc*);
-
public:
-
LIST<char> m_ContactsList;
CSkypeGCCreateDlg(CSkypeProto *proto);
diff --git a/protocols/SkypeWeb/src/skype_options.cpp b/protocols/SkypeWeb/src/skype_options.cpp index cf92dfd198..7e689c427f 100644 --- a/protocols/SkypeWeb/src/skype_options.cpp +++ b/protocols/SkypeWeb/src/skype_options.cpp @@ -38,7 +38,7 @@ CSkypeOptionsMain::CSkypeOptionsMain(CSkypeProto *proto, int idDialog) m_usehostname.OnChange = Callback(this, &CSkypeOptionsMain::OnUsehostnameCheck);
}
-void CSkypeOptionsMain::OnInitDialog()
+bool CSkypeOptionsMain::OnInitDialog()
{
CSkypeDlgBase::OnInitDialog();
@@ -48,10 +48,10 @@ void CSkypeOptionsMain::OnInitDialog() m_skypename.SendMsg(EM_LIMITTEXT, 32, 0);
m_password.SendMsg(EM_LIMITTEXT, 128, 0);
m_group.SendMsg(EM_LIMITTEXT, 64, 0);
+ return true;
}
-
-void CSkypeOptionsMain::OnApply()
+bool CSkypeOptionsMain::OnApply()
{
ptrA szNewSkypename(m_skypename.GetTextA()),
szOldSkypename(m_proto->getStringA(SKYPE_SETTINGS_ID));
@@ -64,6 +64,7 @@ void CSkypeOptionsMain::OnApply() ptrW group(m_group.GetText());
if (mir_wstrlen(group) > 0 && !Clist_GroupExists(group))
Clist_GroupCreate(0, group);
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/SkypeWeb/src/skype_options.h b/protocols/SkypeWeb/src/skype_options.h index 6856e01e3b..59df858290 100644 --- a/protocols/SkypeWeb/src/skype_options.h +++ b/protocols/SkypeWeb/src/skype_options.h @@ -34,8 +34,8 @@ private: protected:
CSkypeOptionsMain(CSkypeProto *proto, int idDialog);
- void OnInitDialog();
- void OnApply();
+ bool OnInitDialog() override;
+ bool OnApply() override;
void OnUsehostnameCheck(CCtrlCheck*);
public:
|