summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-11 17:09:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-11 17:09:17 +0300
commitb2c91edc9646daa331de71d589e4fec6bdef4945 (patch)
tree847a77d0686d26e25b126313fbaa8262c81f8d1a /protocols/Gadu-Gadu/src
parentae081843e9663b3cb36b17309fbce1d2967315f1 (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/Gadu-Gadu/src')
-rw-r--r--protocols/Gadu-Gadu/src/options.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/options.h6
2 files changed, 10 insertions, 6 deletions
diff --git a/protocols/Gadu-Gadu/src/options.cpp b/protocols/Gadu-Gadu/src/options.cpp
index 5abcd75209..b1b1d4af99 100644
--- a/protocols/Gadu-Gadu/src/options.cpp
+++ b/protocols/Gadu-Gadu/src/options.cpp
@@ -32,7 +32,7 @@ GaduOptionsDlgConference::GaduOptionsDlgConference(GaduProto *proto) :
CreateLink(cmbDefaultChatPolicy, GG_KEY_GC_POLICY_DEFAULT, DBVT_WORD, GG_KEYDEF_GC_POLICY_DEFAULT);
}
-void GaduOptionsDlgConference::OnInitDialog()
+bool GaduOptionsDlgConference::OnInitDialog()
{
cmbPolicyForAllChatParticipants.AddString(TranslateT("Allow"), 0L);
cmbPolicyForAllChatParticipants.AddString(TranslateT("Ask"), 1L);
@@ -55,9 +55,10 @@ void GaduOptionsDlgConference::OnInitDialog()
cmbDefaultChatPolicy.AddString(TranslateT("Ignore"), 2L);
listIndex = m_proto->getWord(GG_KEY_GC_POLICY_DEFAULT, GG_KEYDEF_GC_POLICY_DEFAULT);
cmbDefaultChatPolicy.SetCurSel(listIndex);
+ return true;
}
-void GaduOptionsDlgConference::OnApply()
+bool GaduOptionsDlgConference::OnApply()
{
int selectionIndex = cmbPolicyForAllChatParticipants.GetCurSel();
m_proto->setWord(GG_KEY_GC_POLICY_TOTAL, cmbPolicyForAllChatParticipants.GetItemData(selectionIndex));
@@ -67,8 +68,10 @@ void GaduOptionsDlgConference::OnApply()
selectionIndex = cmbDefaultChatPolicy.GetCurSel();
m_proto->setWord(GG_KEY_GC_POLICY_DEFAULT, cmbDefaultChatPolicy.GetItemData(selectionIndex));
+ return true;
}
+/////////////////////////////////////////////////////////////////////////////////////////
GaduOptionsDlgAdvanced::GaduOptionsDlgAdvanced(GaduProto *proto) :
GaduDlgBase(proto, IDD_OPT_GG_ADVANCED),
@@ -114,7 +117,7 @@ GaduOptionsDlgAdvanced::GaduOptionsDlgAdvanced(GaduProto *proto) :
edtForwardPort.OnChange = Callback(this, &GaduOptionsDlgAdvanced::showRecconectRequired);
}
-void GaduOptionsDlgAdvanced::OnInitDialog()
+bool GaduOptionsDlgAdvanced::OnInitDialog()
{
chkKeepConnectionAlive.Disable();
chkSslConnection.Disable();
@@ -136,6 +139,7 @@ void GaduOptionsDlgAdvanced::OnInitDialog()
txtForwardPortLabel.Enable(useForwarding);
txtReconnectRequired.Hide();
+ return true;
}
void GaduOptionsDlgAdvanced::onCheck_ManualHosts(CCtrlCheck *)
diff --git a/protocols/Gadu-Gadu/src/options.h b/protocols/Gadu-Gadu/src/options.h
index 4a58f042a5..8e8694d25e 100644
--- a/protocols/Gadu-Gadu/src/options.h
+++ b/protocols/Gadu-Gadu/src/options.h
@@ -38,8 +38,8 @@ private:
public:
GaduOptionsDlgConference(GaduProto *proto);
- void OnInitDialog() override;
- void OnApply() override;
+ bool OnInitDialog() override;
+ bool OnApply() override;
};
class GaduOptionsDlgAdvanced : public GaduDlgBase
@@ -70,7 +70,7 @@ private:
public:
GaduOptionsDlgAdvanced(GaduProto *proto);
- void OnInitDialog() override;
+ bool OnInitDialog() override;
private:
void onCheck_ManualHosts(CCtrlCheck*);