k-observer/K-observer_client_qt/main.cpp

39 lines
1.4 KiB
C++
Raw Permalink Normal View History

2013-01-19 21:55:39 +00:00
#include <QtGui/QApplication>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "observerclientmodel.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
TObserverClientModel observerClient;
w.ObserverClientModel = &observerClient;
observerClient.MainWindowPtr = &w;
w.OpenMap();
w.GetUi()->ConnectButton->PressedHandler = boost::bind(&TObserverClientModel::OnConnectButtonPressed, &observerClient);
w.GetUi()->UpdateDataButton->PressedHandler = boost::bind(&TObserverClientModel::OnUpdateInfoButtonPressed, &observerClient);
w.GetUi()->DisconnectButton->PressedHandler = boost::bind(&TObserverClientModel::Finish, &observerClient);
w.GetUi()->MapTypeButton->PressedHandler = boost::bind(&TObserverClientModel::OnChangeMapTypeButtonPressed, &observerClient);
w.GetUi()->ChatSendButton->PressedHandler = boost::bind(&TObserverClientModel::OnChatSendClick, &observerClient);
w.GetUi()->AlarmButton->PressedHandler = boost::bind(&TObserverClientModel::OnSendAlarmClick, &observerClient);
w.GetUi()->KickButton->PressedHandler = boost::bind(&TObserverClientModel::OnKickPlayerClick, &observerClient);
w.GetUi()->SelectPlayerButton->PressedHandler = boost::bind(&TObserverClientModel::OnSelectPlayerClick, &observerClient);
return a.exec();
}