Ui Class Reference

UI main class. More...

#include <ui.h>

Collaboration diagram for Ui:
Collaboration graph
[legend]

Public Types

enum  PlaybackEnum { ReplayPlayback, SavegamePlayback }

Public Member Functions

 Ui ()
 ~Ui ()
ChatPanelGetActiveChatPanel ()
ChatPanelGetChannelChatPanel (const wxString &channel)
bool ExecuteSayCommand (const wxString &cmd)
void ConsoleHelp (const wxString &topic)
void ShowMainWindow ()
 Shows the main window on screen.
void ShowConnectWindow ()
 Show the connect window on screen.
void Connect ()
 Connects to default server or opens the ConnectWindow.
void Disconnect ()
void Reconnect ()
void DoConnect (const wxString &servername, const wxString &username, const wxString &password)
 Opens the accutial connection to a server.
void AddServerWindow (const wxString &servername)
void ReopenServerTab ()
void ConnectionFailurePrompt ()
wxString GetNextServer ()
bool DoRegister (const wxString &servername, const wxString &username, const wxString &password, wxString &reason)
bool IsConnecting () const
bool IsConnected () const
void JoinChannel (const wxString &name, const wxString &password)
bool IsSpringCompatible ()
bool IsSpringRunning () const
void Quit ()
 Quits the entire application.
void DownloadMap (const wxString &hash, const wxString &name)
void DownloadMod (const wxString &hash, const wxString &name)
bool Ask (const wxString &heading, const wxString &question) const
 Display a dialog asking a question with OK and Canel buttons.
bool AskText (const wxString &heading, const wxString &question, wxString &answer, long style=wxOK|wxCANCEL|wxCENTRE)
bool AskPassword (const wxString &heading, const wxString &message, wxString &password)
 cannot be const because parent window cannot be const
void ShowMessage (const wxString &heading, const wxString &message) const
MainWindowmw ()
const MainWindowmw () const
bool IsMainWindowCreated () const
void OnUpdate (int mselapsed)
void OnConnected (Server &server, const wxString &server_name, const wxString &server_ver, bool supported)
 Called when connected to a server.
void OnLoggedIn ()
void OnDisconnected (Server &server, bool wasonline)
void OnJoinedChannelSuccessful (Channel &chan)
 Called when client has joined a channel.
void OnJoinedChannelSuccessful (Channel &chan, bool focusTab)
void OnUserJoinedChannel (Channel &chan, User &user)
void OnChannelJoin (Channel &chan, User &user)
void OnUserLeftChannel (Channel &chan, User &user, const wxString &reason)
void OnChannelTopic (Channel &channel, const wxString &user, const wxString &topic)
void OnChannelSaid (Channel &channel, User &user, const wxString &message)
 Called when something is said in a channel.
void OnChannelDidAction (Channel &channel, User &user, const wxString &action)
void OnChannelMessage (const wxString &channel, const wxString &msg)
void OnLeaveChannel (wxString &name)
 this was used when channel was left via raw command in server tab, now it's not used by anything
void OnChannelList (const wxString &channel, const int &numusers)
void OnUserOnline (User &user)
void OnUserOffline (User &user)
void OnUserStatusChanged (User &user)
void OnUserSaid (User &user, const wxString &message, bool me=false)
void OnUserSaidEx (User &user, const wxString &action, bool me=false)
void OnUnknownCommand (Server &server, const wxString &command, const wxString &params)
void OnMotd (Server &server, const wxString &message)
void OnServerBroadcast (Server &server, const wxString &message)
void OnServerMessage (Server &server, const wxString &message)
void OnBattleOpened (IBattle &battle)
void OnBattleClosed (IBattle &battle)
void OnUserJoinedBattle (IBattle &battle, User &user)
void OnUserLeftBattle (IBattle &battle, User &user, bool isbot)
void OnBattleInfoUpdated (BattleEvents::BattleEventData data)
void OnBattleStarted (Battle &battle)
void OnJoinedBattle (Battle &battle)
void OnHostedBattle (Battle &battle)
void OnUserBattleStatus (IBattle &battle, User &user)
void OnRequestBattleStatus (IBattle &battle)
void OnSaidBattle (IBattle &battle, const wxString &nick, const wxString &msg)
void OnSpringStarting ()
void OnSpringTerminated (long exit_code)
void OnAcceptAgreement (const wxString &agreement)
void OnMainWindowDestruct ()
void OnRing (const wxString &from)
bool OnPresetRequiringMap (const wxString &mapname)
 ask to download missing map, return true if download attempted
bool IsThisMe (User &other) const
bool IsThisMe (User *other) const
bool IsThisMe (const wxString &other) const
int TestHostPort (unsigned int port) const
void ReloadPresetList ()
void OpenFileInEditor (const wxString &filepath)
void FirstRunWelcome ()
 the welcome box, should be called in all code paths directly after MainWindow might be shown for the first time
void CheckForUpdates ()

Protected Member Functions

void DownloadFileP2P (const wxString &name)
 does actual work, called from downloadmap/mod
void DownloadFileWebsite (const wxString &name)

Protected Attributes

Serverm_serv
MainWindowm_main_win
ConnectWindowm_con_win
wxTimer m_reconnect_delay_timer
ReconnectDialogm_reconnect_dialog
wxString m_last_used_backup_server
unsigned int m_upd_counter_torrent
bool m_first_update_trigger
bool m_ingame
bool m_recconecting_wait
EventReceiverFunc< Ui,
BattleEvents::BattleEventData,&Ui::OnBattleInfoUpdated > 
m_battle_info_updatedSink

Detailed Description

UI main class.

Definition at line 34 of file ui.h.


Member Enumeration Documentation

Enumerator:
ReplayPlayback 
SavegamePlayback 

Definition at line 41 of file ui.h.


Constructor & Destructor Documentation

Ui::Ui (  ) 

Definition at line 109 of file ui.cpp.

Ui::~Ui (  ) 

Definition at line 126 of file ui.cpp.


Member Function Documentation

void Ui::AddServerWindow ( const wxString servername  ) 

Definition at line 290 of file ui.cpp.

bool Ui::Ask ( const wxString heading,
const wxString question 
) const

Display a dialog asking a question with OK and Canel buttons.

Returns:
true if OK button was pressed
Note:
this does not return until the user pressed any of the buttons or closed the dialog.

Definition at line 419 of file ui.cpp.

bool Ui::AskPassword ( const wxString heading,
const wxString message,
wxString password 
)

cannot be const because parent window cannot be const

Definition at line 426 of file ui.cpp.

bool Ui::AskText ( const wxString heading,
const wxString question,
wxString answer,
long  style = wxOK | wxCANCEL | wxCENTRE 
)

Definition at line 435 of file ui.cpp.

void Ui::CheckForUpdates (  ) 

Definition at line 1430 of file ui.cpp.

void Ui::Connect (  ) 

Connects to default server or opens the ConnectWindow.

Todo:
Fix Auto Connect
See also:
DoConnect

Definition at line 188 of file ui.cpp.

void Ui::ConnectionFailurePrompt (  ) 

Definition at line 710 of file ui.cpp.

void Ui::ConsoleHelp ( const wxString topic  ) 

Definition at line 510 of file ui.cpp.

void Ui::Disconnect (  ) 

Definition at line 219 of file ui.cpp.

void Ui::DoConnect ( const wxString servername,
const wxString username,
const wxString password 
)

Opens the accutial connection to a server.

Definition at line 231 of file ui.cpp.

bool Ui::DoRegister ( const wxString servername,
const wxString username,
const wxString password,
wxString reason 
)

Definition at line 314 of file ui.cpp.

void Ui::DownloadFileP2P ( const wxString name  )  [protected]

does actual work, called from downloadmap/mod

Definition at line 393 of file ui.cpp.

void Ui::DownloadFileWebsite ( const wxString name  )  [protected]

Definition at line 406 of file ui.cpp.

void Ui::DownloadMap ( const wxString hash,
const wxString name 
)

Definition at line 374 of file ui.cpp.

void Ui::DownloadMod ( const wxString hash,
const wxString name 
)

Definition at line 384 of file ui.cpp.

bool Ui::ExecuteSayCommand ( const wxString cmd  ) 

Definition at line 452 of file ui.cpp.

void Ui::FirstRunWelcome (  ) 

the welcome box, should be called in all code paths directly after MainWindow might be shown for the first time

Definition at line 1392 of file ui.cpp.

ChatPanel * Ui::GetActiveChatPanel (  ) 

Definition at line 132 of file ui.cpp.

ChatPanel * Ui::GetChannelChatPanel ( const wxString channel  ) 

Definition at line 558 of file ui.cpp.

wxString Ui::GetNextServer (  ) 

Definition at line 753 of file ui.cpp.

bool Ui::IsConnected (  )  const

Definition at line 348 of file ui.cpp.

bool Ui::IsConnecting (  )  const

Definition at line 342 of file ui.cpp.

bool Ui::IsMainWindowCreated (  )  const

Definition at line 151 of file ui.cpp.

bool Ui::IsSpringCompatible (  ) 

Definition at line 628 of file ui.cpp.

bool Ui::IsSpringRunning (  )  const

Definition at line 360 of file ui.cpp.

bool Ui::IsThisMe ( const wxString other  )  const

Definition at line 1334 of file ui.cpp.

bool Ui::IsThisMe ( User other  )  const

Definition at line 1329 of file ui.cpp.

bool Ui::IsThisMe ( User other  )  const

Definition at line 1324 of file ui.cpp.

void Ui::JoinChannel ( const wxString name,
const wxString password 
)

Definition at line 354 of file ui.cpp.

const MainWindow & Ui::mw (  )  const

Definition at line 144 of file ui.cpp.

MainWindow & Ui::mw (  ) 

Definition at line 138 of file ui.cpp.

void Ui::OnAcceptAgreement ( const wxString agreement  ) 

Definition at line 1262 of file ui.cpp.

void Ui::OnBattleClosed ( IBattle battle  ) 

Definition at line 1043 of file ui.cpp.

void Ui::OnBattleInfoUpdated ( BattleEvents::BattleEventData  data  ) 

Definition at line 1129 of file ui.cpp.

void Ui::OnBattleOpened ( IBattle battle  ) 

Definition at line 1024 of file ui.cpp.

void Ui::OnBattleStarted ( Battle battle  ) 

Definition at line 1202 of file ui.cpp.

void Ui::OnChannelDidAction ( Channel channel,
User user,
const wxString action 
)

Definition at line 810 of file ui.cpp.

void Ui::OnChannelJoin ( Channel chan,
User user 
)

Definition at line 854 of file ui.cpp.

void Ui::OnChannelList ( const wxString channel,
const int &  numusers 
)

Definition at line 890 of file ui.cpp.

void Ui::OnChannelMessage ( const wxString channel,
const wxString msg 
)

Definition at line 822 of file ui.cpp.

void Ui::OnChannelSaid ( Channel channel,
User user,
const wxString message 
)

Called when something is said in a channel.

Definition at line 798 of file ui.cpp.

void Ui::OnChannelTopic ( Channel channel,
const wxString user,
const wxString topic 
)

Definition at line 878 of file ui.cpp.

void Ui::OnConnected ( Server server,
const wxString server_name,
const wxString server_ver,
bool  supported 
)

Called when connected to a server.

Todo:
Display in servertab

Definition at line 607 of file ui.cpp.

void Ui::OnDisconnected ( Server server,
bool  wasonline 
)

Definition at line 674 of file ui.cpp.

void Ui::OnHostedBattle ( Battle battle  ) 

Definition at line 1171 of file ui.cpp.

void Ui::OnJoinedBattle ( Battle battle  ) 

Definition at line 1155 of file ui.cpp.

void Ui::OnJoinedChannelSuccessful ( Channel chan,
bool  focusTab 
)

Definition at line 787 of file ui.cpp.

void Ui::OnJoinedChannelSuccessful ( Channel chan  ) 

Called when client has joined a channel.

Todo:
Check if a pannel allready exists for this channel

Definition at line 780 of file ui.cpp.

void Ui::OnLeaveChannel ( wxString name  ) 

this was used when channel was left via raw command in server tab, now it's not used by anything

Definition at line 833 of file ui.cpp.

void Ui::OnLoggedIn (  ) 

Definition at line 665 of file ui.cpp.

void Ui::OnMainWindowDestruct (  ) 
void Ui::OnMotd ( Server server,
const wxString message 
)

Definition at line 961 of file ui.cpp.

bool Ui::OnPresetRequiringMap ( const wxString mapname  ) 

ask to download missing map, return true if download attempted

Definition at line 1362 of file ui.cpp.

void Ui::OnRequestBattleStatus ( IBattle battle  ) 

Definition at line 1188 of file ui.cpp.

void Ui::OnRing ( const wxString from  ) 

Definition at line 1273 of file ui.cpp.

void Ui::OnSaidBattle ( IBattle battle,
const wxString nick,
const wxString msg 
)

Definition at line 1210 of file ui.cpp.

void Ui::OnServerBroadcast ( Server server,
const wxString message 
)

Definition at line 966 of file ui.cpp.

void Ui::OnServerMessage ( Server server,
const wxString message 
)

Definition at line 978 of file ui.cpp.

void Ui::OnSpringStarting (  ) 

Definition at line 1220 of file ui.cpp.

void Ui::OnSpringTerminated ( long  exit_code  ) 

Definition at line 1229 of file ui.cpp.

void Ui::OnUnknownCommand ( Server server,
const wxString command,
const wxString params 
)

Definition at line 955 of file ui.cpp.

void Ui::OnUpdate ( int  mselapsed  ) 

Definition at line 569 of file ui.cpp.

void Ui::OnUserBattleStatus ( IBattle battle,
User user 
)

Definition at line 1180 of file ui.cpp.

void Ui::OnUserJoinedBattle ( IBattle battle,
User user 
)

Definition at line 1073 of file ui.cpp.

void Ui::OnUserJoinedChannel ( Channel chan,
User user 
)

Definition at line 842 of file ui.cpp.

void Ui::OnUserLeftBattle ( IBattle battle,
User user,
bool  isbot 
)

Definition at line 1099 of file ui.cpp.

void Ui::OnUserLeftChannel ( Channel chan,
User user,
const wxString reason 
)

Definition at line 866 of file ui.cpp.

void Ui::OnUserOffline ( User user  ) 

Definition at line 914 of file ui.cpp.

void Ui::OnUserOnline ( User user  ) 

Definition at line 902 of file ui.cpp.

void Ui::OnUserSaid ( User user,
const wxString message,
bool  me = false 
)

Definition at line 1002 of file ui.cpp.

void Ui::OnUserSaidEx ( User user,
const wxString action,
bool  me = false 
)

Definition at line 1013 of file ui.cpp.

void Ui::OnUserStatusChanged ( User user  ) 

Definition at line 930 of file ui.cpp.

void Ui::OpenFileInEditor ( const wxString filepath  ) 

Definition at line 1377 of file ui.cpp.

void Ui::Quit (  ) 

Quits the entire application.

Definition at line 367 of file ui.cpp.

void Ui::Reconnect (  ) 

Definition at line 204 of file ui.cpp.

void Ui::ReloadPresetList (  ) 

Definition at line 1348 of file ui.cpp.

void Ui::ReopenServerTab (  ) 

Definition at line 300 of file ui.cpp.

void Ui::ShowConnectWindow (  ) 

Show the connect window on screen.

Note:
It will create the ConnectWindow if not allready created

Definition at line 169 of file ui.cpp.

void Ui::ShowMainWindow (  ) 

Shows the main window on screen.

Definition at line 159 of file ui.cpp.

void Ui::ShowMessage ( const wxString heading,
const wxString message 
) const

Definition at line 445 of file ui.cpp.

int Ui::TestHostPort ( unsigned int  port  )  const

Definition at line 1343 of file ui.cpp.


Field Documentation

Definition at line 179 of file ui.h.

Definition at line 165 of file ui.h.

bool Ui::m_first_update_trigger [protected]

Definition at line 173 of file ui.h.

bool Ui::m_ingame [protected]

Definition at line 175 of file ui.h.

Definition at line 169 of file ui.h.

MainWindow* Ui::m_main_win [protected]

Definition at line 164 of file ui.h.

bool Ui::m_recconecting_wait [protected]

Definition at line 176 of file ui.h.

wxTimer Ui::m_reconnect_delay_timer [protected]

Definition at line 166 of file ui.h.

Definition at line 167 of file ui.h.

Server* Ui::m_serv [protected]

Definition at line 163 of file ui.h.

unsigned int Ui::m_upd_counter_torrent [protected]

Definition at line 171 of file ui.h.


The documentation for this class was generated from the following files:

Generated on Thu Dec 29 00:11:49 2011 for SpringLobby by doxygen 1.6.3