diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-11-05 14:57:35 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-11-05 14:57:35 +0000 |
commit | de61b658590630cfc59960c012c8e533b361a8b0 (patch) | |
tree | b89a6f23a385ea4a7d32e3abc6ce4a82114c5d67 /src/gui/connection.cpp | |
parent | dbca3013575b766a681d1cea946e249a386e2144 (diff) | |
parent | 482f0ddb85487bd5a4beaf2706cca9f690aa9304 (diff) | |
download | mana-de61b658590630cfc59960c012c8e533b361a8b0.tar.gz mana-de61b658590630cfc59960c012c8e533b361a8b0.tar.bz2 mana-de61b658590630cfc59960c012c8e533b361a8b0.tar.xz mana-de61b658590630cfc59960c012c8e533b361a8b0.zip |
Moved 0.1.0 branch to trunk. A new beginning.
Diffstat (limited to 'src/gui/connection.cpp')
-rw-r--r-- | src/gui/connection.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gui/connection.cpp b/src/gui/connection.cpp index 8da36f20..1e0034fb 100644 --- a/src/gui/connection.cpp +++ b/src/gui/connection.cpp @@ -35,16 +35,25 @@ namespace { struct ConnectionActionListener : public gcn::ActionListener { - void action(const std::string& eventId, gcn::Widget* widget) { state = EXIT_STATE; } - } listener; + ConnectionActionListener(unsigned char previousState): + mPreviousState(previousState) {}; + + void action(const std::string &eventId, gcn::Widget *widget) { + state = mPreviousState; + } + + unsigned char mPreviousState; + }; } -ConnectionDialog::ConnectionDialog(): +ConnectionDialog::ConnectionDialog(unsigned char previousState): Window("Info"), mProgress(0) { setContentSize(200, 100); - Button *cancelButton = new Button("Cancel", "cancelButton", &listener); + ConnectionActionListener *connectionListener = new ConnectionActionListener(previousState); + + Button *cancelButton = new Button("Cancel", "cancelButton", connectionListener); mProgressBar = new ProgressBar(0.0, 200 - 10, 20, 128, 128, 128); gcn::Label *label = new gcn::Label("Connecting..."); |