diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2006-08-30 21:20:52 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2006-08-30 21:20:52 +0000 |
commit | 299f22cf915c421194309afb1156ab9559aefc97 (patch) | |
tree | 6112314cf6606acc002d486c661ca3791b461d51 /src/gui/connection.cpp | |
parent | 47320d3507aac21c8568cd244308e39a8869976a (diff) | |
download | mana-299f22cf915c421194309afb1156ab9559aefc97.tar.gz mana-299f22cf915c421194309afb1156ab9559aefc97.tar.bz2 mana-299f22cf915c421194309afb1156ab9559aefc97.tar.xz mana-299f22cf915c421194309afb1156ab9559aefc97.zip |
Added a first version of the server dialog with an unskinned dropdown. Upgraded also the connection window a bit to handle Cancelling more gracefully.
Diffstat (limited to 'src/gui/connection.cpp')
-rw-r--r-- | src/gui/connection.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/connection.cpp b/src/gui/connection.cpp index a29008c3..1e0034fb 100644 --- a/src/gui/connection.cpp +++ b/src/gui/connection.cpp @@ -35,18 +35,25 @@ namespace { struct ConnectionActionListener : public gcn::ActionListener { + ConnectionActionListener(unsigned char previousState): + mPreviousState(previousState) {}; + void action(const std::string &eventId, gcn::Widget *widget) { - state = STATE_EXIT; + state = mPreviousState; } - } listener; + + 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..."); |