From 4490b8643f2449da159c9284503eb2c443aa2e9e Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Wed, 1 Feb 2006 12:24:10 +0000 Subject: Made the OkDialog and ConfirmDialog classes proxies for their buttons' events. Removed the RequestTradeWindow class, replaced with a plain ConfirmDialog. Fixed a memory leak along the way. --- src/gui/login.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/gui/login.cpp') diff --git a/src/gui/login.cpp b/src/gui/login.cpp index 836c1c14..e3828af7 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -133,7 +133,12 @@ LoginDialog::LoginDialog(LoginData *loginData): serverField->setText(config.getValue("host", "")); - wrongDataNoticeListener = NULL; + wrongDataNoticeListener = new WrongDataNoticeListener(); +} + +LoginDialog::~LoginDialog() +{ + delete wrongDataNoticeListener; } void @@ -160,10 +165,9 @@ LoginDialog::action(const std::string& eventId) // Check login if (user.length() == 0) { - wrongDataNoticeListener = new WrongDataNoticeListener(); wrongDataNoticeListener->setTarget(this->passField); - new OkDialog("Error", "Enter your username first", - wrongDataNoticeListener); + OkDialog *dlg = new OkDialog("Error", "Enter your username first"); + dlg->addActionListener(wrongDataNoticeListener); } else { -- cgit v1.2.3-70-g09d2