@ -16,11 +16,11 @@
# include <errno.h>
# include < qcolor.h>
# include < qdatetime.h>
# include < qlineedit.h>
# include < qscrollview.h>
# include < qpopupmenu.h>
# include < t qcolor.h>
# include < t qdatetime.h>
# include < t qlineedit.h>
# include < t qscrollview.h>
# include < t qpopupmenu.h>
# include <kaboutapplication.h>
# include <kaction.h>
@ -64,15 +64,15 @@
# include "selectgame_widget.h"
# include "selectconfiguration_widget.h"
LogTextEdit : : LogTextEdit ( QWidget * parent , const char * name ) : QTextEdit( parent , name )
LogTextEdit : : LogTextEdit ( T QWidget * parent , const char * name ) : T QTextEdit( parent , name )
{
# ifdef KDE_3_2_FEATURES
m_clear = KStdAction : : clear ( this , SLOT( clear ( ) ) , 0 ) ;
m_clear = KStdAction : : clear ( this , TQT_ SLOT( clear ( ) ) , 0 ) ;
# else
m_clear = new KAction ( i18n ( " Clear " ) , " clear " , NULL , this , SLOT( clear ( ) ) , static_cast < KActionCollection * > ( 0 ) , " clear " ) ;
m_clear = new KAction ( i18n ( " Clear " ) , " clear " , NULL , this , TQT_ SLOT( clear ( ) ) , static_cast < KActionCollection * > ( 0 ) , " clear " ) ;
# endif
m_selectAll = KStdAction : : selectAll ( this , SLOT( selectAll ( ) ) , 0 ) ;
m_copy = KStdAction : : copy ( this , SLOT( copy ( ) ) , 0 ) ;
m_selectAll = KStdAction : : selectAll ( this , TQT_ SLOT( selectAll ( ) ) , 0 ) ;
m_copy = KStdAction : : copy ( this , TQT_ SLOT( copy ( ) ) , 0 ) ;
}
LogTextEdit : : ~ LogTextEdit ( )
@ -82,9 +82,9 @@ LogTextEdit::~LogTextEdit()
delete m_copy ;
}
QPopupMenu * LogTextEdit : : createPopupMenu ( const QPoint & )
T QPopupMenu * LogTextEdit : : createPopupMenu ( const T QPoint & )
{
QPopupMenu * rmbMenu = new QPopupMenu( this ) ;
T QPopupMenu * rmbMenu = new T QPopupMenu( this ) ;
m_clear - > plug ( rmbMenu ) ;
rmbMenu - > insertSeparator ( ) ;
m_copy - > setEnabled ( hasSelectedText ( ) ) ;
@ -102,13 +102,13 @@ Atlantik::Atlantik ()
readConfig ( ) ;
// Toolbar: Game
// KStdGameAction::gameNew(this, SLOT(slotNewGame()), actionCollection(), "game_new");
m_showEventLog = new KAction ( i18n ( " Show Event &Log " ) /*, "atlantik_showeventlog"*/ , CTRL + Key_L , this , SLOT( showEventLog ( ) ) , actionCollection ( ) , " showeventlog " ) ;
KStdGameAction : : quit ( kapp , SLOT( closeAllWindows ( ) ) , actionCollection ( ) , " game_quit " ) ;
// KStdGameAction::gameNew(this, TQT_ SLOT(slotNewGame()), actionCollection(), "game_new");
m_showEventLog = new KAction ( i18n ( " Show Event &Log " ) /*, "atlantik_showeventlog"*/ , CTRL + Key_L , this , TQT_ SLOT( showEventLog ( ) ) , actionCollection ( ) , " showeventlog " ) ;
KStdGameAction : : quit ( kapp , TQT_ SLOT( closeAllWindows ( ) ) , actionCollection ( ) , " game_quit " ) ;
// Toolbar: Settings
KStdAction : : preferences ( this , SLOT( slotConfigure ( ) ) , actionCollection ( ) ) ;
KStdAction : : configureNotifications ( this , SLOT( configureNotifications ( ) ) , actionCollection ( ) ) ;
KStdAction : : preferences ( this , TQT_ SLOT( slotConfigure ( ) ) , actionCollection ( ) ) ;
KStdAction : : configureNotifications ( this , TQT_ SLOT( configureNotifications ( ) ) , actionCollection ( ) ) ;
// Initialize pointers to 0L
m_configDialog = 0 ;
@ -121,78 +121,78 @@ Atlantik::Atlantik ()
// Game and network core
m_atlanticCore = new AtlanticCore ( this , " atlanticCore " ) ;
connect ( m_atlanticCore , SIGNAL( createGUI ( Player * ) ) , this , SLOT( newPlayer ( Player * ) ) ) ;
connect ( m_atlanticCore , SIGNAL( removeGUI ( Player * ) ) , this , SLOT( removeGUI ( Player * ) ) ) ;
connect ( m_atlanticCore , SIGNAL( createGUI ( Trade * ) ) , this , SLOT( newTrade ( Trade * ) ) ) ;
connect ( m_atlanticCore , SIGNAL( removeGUI ( Trade * ) ) , this , SLOT( removeGUI ( Trade * ) ) ) ;
connect ( m_atlanticCore , TQT_ SIGNAL( createGUI ( Player * ) ) , this , TQT_ SLOT( newPlayer ( Player * ) ) ) ;
connect ( m_atlanticCore , TQT_ SIGNAL( removeGUI ( Player * ) ) , this , TQT_ SLOT( removeGUI ( Player * ) ) ) ;
connect ( m_atlanticCore , TQT_ SIGNAL( createGUI ( Trade * ) ) , this , TQT_ SLOT( newTrade ( Trade * ) ) ) ;
connect ( m_atlanticCore , TQT_ SIGNAL( removeGUI ( Trade * ) ) , this , TQT_ SLOT( removeGUI ( Trade * ) ) ) ;
initEventLog ( ) ;
initNetworkObject ( ) ;
// Menu,toolbar: Move
m_roll = KStdGameAction : : roll ( this , SIGNAL( rollDice ( ) ) , actionCollection ( ) ) ;
m_roll = KStdGameAction : : roll ( this , TQT_ SIGNAL( rollDice ( ) ) , actionCollection ( ) ) ;
m_roll - > setEnabled ( false ) ;
m_buyEstate = new KAction ( i18n ( " &Buy " ) , " atlantik_buy_estate " , CTRL + Key_B , this , SIGNAL( buyEstate ( ) ) , actionCollection ( ) , " buy_estate " ) ;
m_buyEstate = new KAction ( i18n ( " &Buy " ) , " atlantik_buy_estate " , CTRL + Key_B , this , TQT_ SIGNAL( buyEstate ( ) ) , actionCollection ( ) , " buy_estate " ) ;
m_buyEstate - > setEnabled ( false ) ;
m_auctionEstate = new KAction ( i18n ( " &Auction " ) , " auction " , CTRL + Key_A , this , SIGNAL( auctionEstate ( ) ) , actionCollection ( ) , " auction " ) ;
m_auctionEstate = new KAction ( i18n ( " &Auction " ) , " auction " , CTRL + Key_A , this , TQT_ SIGNAL( auctionEstate ( ) ) , actionCollection ( ) , " auction " ) ;
m_auctionEstate - > setEnabled ( false ) ;
m_endTurn = KStdGameAction : : endTurn ( this , SIGNAL( endTurn ( ) ) , actionCollection ( ) ) ;
m_endTurn = KStdGameAction : : endTurn ( this , TQT_ SIGNAL( endTurn ( ) ) , actionCollection ( ) ) ;
m_endTurn - > setEnabled ( false ) ;
m_jailCard = new KAction ( i18n ( " Use Card to Leave Jail " ) /*, "atlantik_move_jail_card"*/ , 0 , this , SIGNAL( jailCard ( ) ) , actionCollection ( ) , " move_jailcard " ) ;
m_jailCard = new KAction ( i18n ( " Use Card to Leave Jail " ) /*, "atlantik_move_jail_card"*/ , 0 , this , TQT_ SIGNAL( jailCard ( ) ) , actionCollection ( ) , " move_jailcard " ) ;
m_jailCard - > setEnabled ( false ) ;
m_jailPay = new KAction ( i18n ( " &Pay to Leave Jail " ) , " jail_pay " , CTRL + Key_P , this , SIGNAL( jailPay ( ) ) , actionCollection ( ) , " move_jailpay " ) ;
m_jailPay = new KAction ( i18n ( " &Pay to Leave Jail " ) , " jail_pay " , CTRL + Key_P , this , TQT_ SIGNAL( jailPay ( ) ) , actionCollection ( ) , " move_jailpay " ) ;
m_jailPay - > setEnabled ( false ) ;
m_jailRoll = new KAction ( i18n ( " Roll to Leave &Jail " ) /*, "atlantik_move_jail_roll"*/ , CTRL + Key_J , this , SIGNAL( jailRoll ( ) ) , actionCollection ( ) , " move_jailroll " ) ;
m_jailRoll = new KAction ( i18n ( " Roll to Leave &Jail " ) /*, "atlantik_move_jail_roll"*/ , CTRL + Key_J , this , TQT_ SIGNAL( jailRoll ( ) ) , actionCollection ( ) , " move_jailroll " ) ;
m_jailRoll - > setEnabled ( false ) ;
// Mix code and XML into GUI
KMainWindow : : createGUI ( ) ;
applyMainWindowSettings ( KGlobal : : config ( ) , " AtlantikMainWindow " ) ;
KMainWindow : : statusBar ( ) - > insertItem ( " Atlantik " ATLANTIK_VERSION_STRING , 0 ) ;
KMainWindow : : statusBar ( ) - > insertItem ( QString: : null , 1 ) ;
connect ( statusBar ( ) , SIGNAL( released ( int ) ) , this , SLOT( statusBarClick ( int ) ) ) ;
KMainWindow : : statusBar ( ) - > insertItem ( T QString: : null , 1 ) ;
connect ( statusBar ( ) , TQT_ SIGNAL( released ( int ) ) , this , TQT_ SLOT( statusBarClick ( int ) ) ) ;
// Main widget, containing all others
m_mainWidget = new QWidget( this , " main " ) ;
m_mainWidget = new T QWidget( this , " main " ) ;
m_mainWidget - > show ( ) ;
m_mainLayout = new QGridLayout( m_mainWidget , 3 , 2 ) ;
m_mainLayout = new T QGridLayout( m_mainWidget , 3 , 2 ) ;
setCentralWidget ( m_mainWidget ) ;
// Vertical view area for portfolios.
m_portfolioScroll = new QScrollView( m_mainWidget , " pfScroll " ) ;
m_portfolioScroll = new T QScrollView( m_mainWidget , " pfScroll " ) ;
m_mainLayout - > addWidget ( m_portfolioScroll , 0 , 0 ) ;
m_portfolioScroll - > setHScrollBarMode ( QScrollView: : AlwaysOff ) ;
m_portfolioScroll - > setResizePolicy ( QScrollView: : AutoOneFit ) ;
m_portfolioScroll - > setHScrollBarMode ( T QScrollView: : AlwaysOff ) ;
m_portfolioScroll - > setResizePolicy ( T QScrollView: : AutoOneFit ) ;
m_portfolioScroll - > setFixedHeight ( 200 ) ;
m_portfolioScroll - > hide ( ) ;
m_portfolioWidget = new QWidget( m_portfolioScroll - > viewport ( ) , " pfWidget " ) ;
m_portfolioWidget = new T QWidget( m_portfolioScroll - > viewport ( ) , " pfWidget " ) ;
m_portfolioScroll - > addChild ( m_portfolioWidget ) ;
m_portfolioWidget - > show ( ) ;
m_portfolioLayout = new QVBoxLayout( m_portfolioWidget ) ;
m_portfolioLayout = new T QVBoxLayout( m_portfolioWidget ) ;
m_portfolioViews . setAutoDelete ( true ) ;
// Nice label
// m_portfolioLabel = new QLabel(i18n("Players"), m_portfolioWidget, "pfLabel");
// m_portfolioLabel = new T QLabel(i18n("Players"), m_portfolioWidget, "pfLabel");
// m_portfolioLayout->addWidget(m_portfolioLabel);
// m_portfolioLabel->show();
// Text view for chat and status messages from server.
m_serverMsgs = new LogTextEdit ( m_mainWidget , " serverMsgs " ) ;
m_serverMsgs - > setTextFormat ( QTextEdit: : PlainText ) ;
m_serverMsgs - > setTextFormat ( T QTextEdit: : PlainText ) ;
m_serverMsgs - > setReadOnly ( true ) ;
m_serverMsgs - > setHScrollBarMode ( QScrollView: : AlwaysOff ) ;
m_serverMsgs - > setHScrollBarMode ( T QScrollView: : AlwaysOff ) ;
m_serverMsgs - > setMinimumWidth ( 200 ) ;
m_mainLayout - > addWidget ( m_serverMsgs , 1 , 0 ) ;
// LineEdit to enter commands and chat messages.
m_input = new QLineEdit( m_mainWidget , " input " ) ;
m_input = new T QLineEdit( m_mainWidget , " input " ) ;
m_mainLayout - > addWidget ( m_input , 2 , 0 ) ;
m_serverMsgs - > setFocusProxy ( m_input ) ;
connect ( m_input , SIGNAL( returnPressed ( ) ) , this , SLOT( slotSendMsg ( ) ) ) ;
connect ( m_input , TQT_ SIGNAL( returnPressed ( ) ) , this , TQT_ SLOT( slotSendMsg ( ) ) ) ;
// Set stretching where we want it.
m_mainLayout - > setRowStretch ( 1 , 1 ) ; // make m_board+m_serverMsgs stretch vertically, not the rest
@ -201,8 +201,8 @@ Atlantik::Atlantik ()
// Check command-line args to see if we need to connect or show Monopigator window
KCmdLineArgs * args = KCmdLineArgs : : parsedArgs ( ) ;
QCString host = args - > getOption ( " host " ) ;
QCString port = args - > getOption ( " port " ) ;
T QCString host = args - > getOption ( " host " ) ;
T QCString port = args - > getOption ( " port " ) ;
if ( ! host . isNull ( ) & & ! port . isNull ( ) )
m_atlantikNetwork - > serverConnect ( host , port . toInt ( ) ) ;
else
@ -238,7 +238,7 @@ void Atlantik::readConfig()
// Portfolio colors
config - > setGroup ( " WM " ) ;
QColor activeDefault ( 204 , 204 , 204 ) , inactiveDefault ( 153 , 153 , 153 ) ;
T QColor activeDefault ( 204 , 204 , 204 ) , inactiveDefault ( 153 , 153 , 153 ) ;
m_config . activeColor = config - > readColorEntry ( " activeBackground " , & activeDefault ) ;
m_config . inactiveColor = config - > readColorEntry ( " inactiveBlend " , & inactiveDefault ) ;
}
@ -253,9 +253,9 @@ void Atlantik::newPlayer(Player *player)
// we'd better force an update.
playerChanged ( player ) ;
connect ( player , SIGNAL( changed ( Player * ) ) , this , SLOT( playerChanged ( Player * ) ) ) ;
connect ( player , SIGNAL( gainedTurn ( ) ) , this , SLOT( gainedTurn ( ) ) ) ;
connect ( player , SIGNAL( changed ( Player * ) ) , m_board , SLOT( playerChanged ( Player * ) ) ) ;
connect ( player , TQT_ SIGNAL( changed ( Player * ) ) , this , TQT_ SLOT( playerChanged ( Player * ) ) ) ;
connect ( player , TQT_ SIGNAL( gainedTurn ( ) ) , this , TQT_ SLOT( gainedTurn ( ) ) ) ;
connect ( player , TQT_ SIGNAL( changed ( Player * ) ) , m_board , TQT_ SLOT( playerChanged ( Player * ) ) ) ;
KNotifyClient : : event ( winId ( ) , " newplayer " ) ;
}
@ -314,8 +314,8 @@ void Atlantik::showSelectServer()
m_atlanticCore - > reset ( true ) ;
initNetworkObject ( ) ;
connect ( m_selectServer , SIGNAL( serverConnect ( const QString, int ) ) , m_atlantikNetwork , SLOT( serverConnect ( const QString, int ) ) ) ;
connect ( m_selectServer , SIGNAL( msgStatus ( const QString & ) ) , this , SLOT( slotMsgStatus ( const QString & ) ) ) ;
connect ( m_selectServer , TQT_ SIGNAL( serverConnect ( const T QString, int ) ) , m_atlantikNetwork , TQT_ SLOT( serverConnect ( const T QString, int ) ) ) ;
connect ( m_selectServer , TQT_ SIGNAL( msgStatus ( const T QString & ) ) , this , TQT_ SLOT( slotMsgStatus ( const T QString & ) ) ) ;
m_selectServer - > slotRefresh ( m_config . connectOnStart ) ;
}
@ -354,10 +354,10 @@ void Atlantik::showSelectGame()
m_selectConfiguration = 0 ;
}
connect ( m_selectGame , SIGNAL( joinGame ( int ) ) , m_atlantikNetwork , SLOT( joinGame ( int ) ) ) ;
connect ( m_selectGame , SIGNAL( newGame ( const QString & ) ) , m_atlantikNetwork , SLOT( newGame ( const QString & ) ) ) ;
connect ( m_selectGame , SIGNAL( leaveServer ( ) ) , this , SLOT( showSelectServer ( ) ) ) ;
connect ( m_selectGame , SIGNAL( msgStatus ( const QString & ) ) , this , SLOT( slotMsgStatus ( const QString & ) ) ) ;
connect ( m_selectGame , TQT_ SIGNAL( joinGame ( int ) ) , m_atlantikNetwork , TQT_ SLOT( joinGame ( int ) ) ) ;
connect ( m_selectGame , TQT_ SIGNAL( newGame ( const T QString & ) ) , m_atlantikNetwork , TQT_ SLOT( newGame ( const T QString & ) ) ) ;
connect ( m_selectGame , TQT_ SIGNAL( leaveServer ( ) ) , this , TQT_ SLOT( showSelectServer ( ) ) ) ;
connect ( m_selectGame , TQT_ SIGNAL( msgStatus ( const T QString & ) ) , this , TQT_ SLOT( slotMsgStatus ( const T QString & ) ) ) ;
}
void Atlantik : : showSelectConfiguration ( )
@ -375,15 +375,15 @@ void Atlantik::showSelectConfiguration()
m_mainLayout - > addMultiCellWidget ( m_selectConfiguration , 0 , 2 , 1 , 1 ) ;
m_selectConfiguration - > show ( ) ;
connect ( m_atlanticCore , SIGNAL( createGUI ( ConfigOption * ) ) , m_selectConfiguration , SLOT( addConfigOption ( ConfigOption * ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( gameOption ( QString, QString, QString, QString, QString) ) , m_selectConfiguration , SLOT( gameOption ( QString, QString, QString, QString, QString) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( gameInit ( ) ) , m_selectConfiguration , SLOT( initGame ( ) ) ) ;
connect ( m_selectConfiguration , SIGNAL( startGame ( ) ) , m_atlantikNetwork , SLOT( startGame ( ) ) ) ;
connect ( m_selectConfiguration , SIGNAL( leaveGame ( ) ) , m_atlantikNetwork , SLOT( leaveGame ( ) ) ) ;
connect ( m_selectConfiguration , SIGNAL( changeOption ( int , const QString & ) ) , m_atlantikNetwork , SLOT( changeOption ( int , const QString & ) ) ) ;
connect ( m_selectConfiguration , SIGNAL( buttonCommand ( QString) ) , m_atlantikNetwork , SLOT( writeData ( QString) ) ) ;
connect ( m_selectConfiguration , SIGNAL( iconSelected ( const QString & ) ) , m_atlantikNetwork , SLOT( setImage ( const QString & ) ) ) ;
connect ( m_selectConfiguration , SIGNAL( statusMessage ( const QString & ) ) , this , SLOT( slotMsgStatus ( const QString & ) ) ) ;
connect ( m_atlanticCore , TQT_ SIGNAL( createGUI ( ConfigOption * ) ) , m_selectConfiguration , TQT_ SLOT( addConfigOption ( ConfigOption * ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( gameOption ( T QString, T QString, T QString, T QString, T QString) ) , m_selectConfiguration , TQT_ SLOT( gameOption ( T QString, T QString, T QString, T QString, T QString) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( gameInit ( ) ) , m_selectConfiguration , TQT_ SLOT( initGame ( ) ) ) ;
connect ( m_selectConfiguration , TQT_ SIGNAL( startGame ( ) ) , m_atlantikNetwork , TQT_ SLOT( startGame ( ) ) ) ;
connect ( m_selectConfiguration , TQT_ SIGNAL( leaveGame ( ) ) , m_atlantikNetwork , TQT_ SLOT( leaveGame ( ) ) ) ;
connect ( m_selectConfiguration , TQT_ SIGNAL( changeOption ( int , const T QString & ) ) , m_atlantikNetwork , TQT_ SLOT( changeOption ( int , const T QString & ) ) ) ;
connect ( m_selectConfiguration , TQT_ SIGNAL( buttonCommand ( T QString) ) , m_atlantikNetwork , TQT_ SLOT( writeData ( T QString) ) ) ;
connect ( m_selectConfiguration , TQT_ SIGNAL( iconSelected ( const T QString & ) ) , m_atlantikNetwork , TQT_ SLOT( setImage ( const T QString & ) ) ) ;
connect ( m_selectConfiguration , TQT_ SIGNAL( statusMessage ( const T QString & ) ) , this , TQT_ SLOT( slotMsgStatus ( const T QString & ) ) ) ;
}
void Atlantik : : initBoard ( )
@ -394,11 +394,11 @@ void Atlantik::initBoard()
m_board = new AtlantikBoard ( m_atlanticCore , 40 , AtlantikBoard : : Play , m_mainWidget , " board " ) ;
m_board - > setViewProperties ( m_config . indicateUnowned , m_config . highliteUnowned , m_config . darkenMortgaged , m_config . quartzEffects , m_config . animateTokens ) ;
connect ( m_atlantikNetwork , SIGNAL( displayDetails ( QString, bool , bool , Estate * ) ) , m_board , SLOT( insertDetails ( QString, bool , bool , Estate * ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( addCommandButton ( QString, QString, bool ) ) , m_board , SLOT( displayButton ( QString, QString, bool ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( addCloseButton ( ) ) , m_board , SLOT( addCloseButton ( ) ) ) ;
connect ( m_board , SIGNAL( tokenConfirmation ( Estate * ) ) , m_atlantikNetwork , SLOT( tokenConfirmation ( Estate * ) ) ) ;
connect ( m_board , SIGNAL( buttonCommand ( QString) ) , m_atlantikNetwork , SLOT( writeData ( QString) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( displayDetails ( T QString, bool , bool , Estate * ) ) , m_board , TQT_ SLOT( insertDetails ( T QString, bool , bool , Estate * ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( addCommandButton ( T QString, T QString, bool ) ) , m_board , TQT_ SLOT( displayButton ( T QString, T QString, bool ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( addCloseButton ( ) ) , m_board , TQT_ SLOT( addCloseButton ( ) ) ) ;
connect ( m_board , TQT_ SIGNAL( tokenConfirmation ( Estate * ) ) , m_atlantikNetwork , TQT_ SLOT( tokenConfirmation ( Estate * ) ) ) ;
connect ( m_board , TQT_ SIGNAL( buttonCommand ( T QString) ) , m_atlantikNetwork , TQT_ SLOT( writeData ( T QString) ) ) ;
}
void Atlantik : : showBoard ( )
@ -425,7 +425,7 @@ void Atlantik::showBoard()
m_board - > show ( ) ;
PortfolioView * portfolioView = 0 ;
for ( QPtrListIterator< PortfolioView > it ( m_portfolioViews ) ; * it ; + + it )
for ( T QPtrListIterator< PortfolioView > it ( m_portfolioViews ) ; * it ; + + it )
if ( ( portfolioView = dynamic_cast < PortfolioView * > ( * it ) ) )
portfolioView - > buildPortfolio ( ) ;
}
@ -445,7 +445,7 @@ void Atlantik::slotNetworkConnected()
void Atlantik : : slotNetworkError ( int errnum )
{
QString errMsg ( i18n ( " Error connecting: " ) ) ;
T QString errMsg ( i18n ( " Error connecting: " ) ) ;
switch ( m_atlantikNetwork - > status ( ) )
{
@ -475,12 +475,12 @@ void Atlantik::networkClosed(int status)
switch ( status )
{
case KBufferedIO : : involuntary :
slotMsgStatus ( i18n ( " Connection with server %1:%2 lost. " ) . arg ( m_atlantikNetwork - > host ( ) ) . arg ( m_atlantikNetwork - > port ( ) ) , QString( " connect_no " ) ) ;
slotMsgStatus ( i18n ( " Connection with server %1:%2 lost. " ) . arg ( m_atlantikNetwork - > host ( ) ) . arg ( m_atlantikNetwork - > port ( ) ) , T QString( " connect_no " ) ) ;
showSelectServer ( ) ;
break ;
default :
if ( ! m_atlantikNetwork - > host ( ) . isEmpty ( ) )
slotMsgStatus ( i18n ( " Disconnected from %1:%2. " ) . arg ( m_atlantikNetwork - > host ( ) ) . arg ( m_atlantikNetwork - > port ( ) ) , QString( " connect_no " ) ) ;
slotMsgStatus ( i18n ( " Disconnected from %1:%2. " ) . arg ( m_atlantikNetwork - > host ( ) ) . arg ( m_atlantikNetwork - > port ( ) ) , T QString( " connect_no " ) ) ;
break ;
}
}
@ -491,7 +491,7 @@ void Atlantik::slotConfigure()
m_configDialog = new ConfigDialog ( this ) ;
m_configDialog - > show ( ) ;
connect ( m_configDialog , SIGNAL( okClicked ( ) ) , this , SLOT( slotUpdateConfig ( ) ) ) ;
connect ( m_configDialog , TQT_ SIGNAL( okClicked ( ) ) , this , TQT_ SLOT( slotUpdateConfig ( ) ) ) ;
}
void Atlantik : : showEventLog ( )
@ -510,7 +510,7 @@ void Atlantik::slotUpdateConfig()
{
KConfig * config = kapp - > config ( ) ;
bool optBool , configChanged = false ;
QString optStr ;
T QString optStr ;
optBool = m_configDialog - > chatTimestamps ( ) ;
if ( m_config . chatTimestamps ! = optBool )
@ -612,38 +612,38 @@ void Atlantik::slotUpdateConfig()
void Atlantik : : slotSendMsg ( )
{
m_atlantikNetwork - > cmdChat ( m_input - > text ( ) ) ;
m_input - > setText ( QString: : null ) ;
m_input - > setText ( T QString: : null ) ;
}
void Atlantik : : slotMsgInfo ( QString msg )
void Atlantik : : slotMsgInfo ( T QString msg )
{
serverMsgsAppend ( msg ) ;
}
void Atlantik : : slotMsgError ( QString msg )
void Atlantik : : slotMsgError ( T QString msg )
{
serverMsgsAppend ( " Error: " + msg ) ;
}
void Atlantik : : slotMsgStatus ( const QString & message , const QString & icon )
void Atlantik : : slotMsgStatus ( const T QString & message , const T QString & icon )
{
KMainWindow : : statusBar ( ) - > changeItem ( message , 1 ) ;
m_eventLog - > addEvent ( message , icon ) ;
}
void Atlantik : : slotMsgChat ( QString player , QString msg )
void Atlantik : : slotMsgChat ( T QString player , T QString msg )
{
if ( m_config . chatTimestamps )
{
QTime time = QTime: : currentTime ( ) ;
serverMsgsAppend ( QString( " [%1] %2: %3 " ) . arg ( time . toString ( " hh:mm " ) ) . arg ( player ) . arg ( msg ) ) ;
T QTime time = T QTime: : currentTime ( ) ;
serverMsgsAppend ( T QString( " [%1] %2: %3 " ) . arg ( time . toString ( " hh:mm " ) ) . arg ( player ) . arg ( msg ) ) ;
}
else
serverMsgsAppend ( player + " : " + msg ) ;
KNotifyClient : : event ( winId ( ) , " chat " ) ;
}
void Atlantik : : serverMsgsAppend ( QString msg )
void Atlantik : : serverMsgsAppend ( T QString msg )
{
// Use append, not setText(old+new) because that one doesn't wrap
m_serverMsgs - > append ( msg ) ;
@ -661,7 +661,7 @@ void Atlantik::playerChanged(Player *player)
{
// We changed ourselves..
PortfolioView * portfolioView = 0 ;
for ( QPtrListIterator< PortfolioView > it ( m_portfolioViews ) ; * it ; + + it )
for ( T QPtrListIterator< PortfolioView > it ( m_portfolioViews ) ; * it ; + + it )
if ( ( portfolioView = dynamic_cast < PortfolioView * > ( * it ) ) )
{
// Clear all portfolios if we're not in game
@ -728,38 +728,38 @@ void Atlantik::initNetworkObject()
}
m_atlantikNetwork = new AtlantikNetwork ( m_atlanticCore ) ;
connect ( m_atlantikNetwork , SIGNAL( msgInfo ( QString) ) , this , SLOT( slotMsgInfo ( QString) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( msgError ( QString) ) , this , SLOT( slotMsgError ( QString) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( msgStatus ( const QString & , const QString & ) ) , this , SLOT( slotMsgStatus ( const QString & , const QString & ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( msgChat ( QString, QString) ) , this , SLOT( slotMsgChat ( QString, QString) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( msgInfo ( T QString) ) , this , TQT_ SLOT( slotMsgInfo ( T QString) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( msgError ( T QString) ) , this , TQT_ SLOT( slotMsgError ( T QString) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( msgStatus ( const T QString & , const T QString & ) ) , this , TQT_ SLOT( slotMsgStatus ( const T QString & , const T QString & ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( msgChat ( T QString, T QString) ) , this , TQT_ SLOT( slotMsgChat ( T QString, T QString) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( connectionSuccess ( ) ) , this , SLOT( slotNetworkConnected ( ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( connectionFailed ( int ) ) , this , SLOT( slotNetworkError ( int ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( closed ( int ) ) , this , SLOT( networkClosed ( int ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( connectionSuccess ( ) ) , this , TQT_ SLOT( slotNetworkConnected ( ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( connectionFailed ( int ) ) , this , TQT_ SLOT( slotNetworkError ( int ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( closed ( int ) ) , this , TQT_ SLOT( networkClosed ( int ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( receivedHandshake ( ) ) , this , SLOT( sendHandshake ( ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( receivedHandshake ( ) ) , this , TQT_ SLOT( sendHandshake ( ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( gameConfig ( ) ) , this , SLOT( showSelectConfiguration ( ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( gameInit ( ) ) , this , SLOT( initBoard ( ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( gameRun ( ) ) , this , SLOT( showBoard ( ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( gameEnd ( ) ) , this , SLOT( freezeBoard ( ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( gameConfig ( ) ) , this , TQT_ SLOT( showSelectConfiguration ( ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( gameInit ( ) ) , this , TQT_ SLOT( initBoard ( ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( gameRun ( ) ) , this , TQT_ SLOT( showBoard ( ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( gameEnd ( ) ) , this , TQT_ SLOT( freezeBoard ( ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( newEstate ( Estate * ) ) , this , SLOT( newEstate ( Estate * ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( newAuction ( Auction * ) ) , this , SLOT( newAuction ( Auction * ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( newEstate ( Estate * ) ) , this , TQT_ SLOT( newEstate ( Estate * ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( newAuction ( Auction * ) ) , this , TQT_ SLOT( newAuction ( Auction * ) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( clientCookie ( QString) ) , this , SLOT( clientCookie ( QString) ) ) ;
connect ( m_atlantikNetwork , SIGNAL( networkEvent ( const QString & , const QString & ) ) , m_eventLog , SLOT( addEvent ( const QString & , const QString & ) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( clientCookie ( T QString) ) , this , TQT_ SLOT( clientCookie ( T QString) ) ) ;
connect ( m_atlantikNetwork , TQT_ SIGNAL( networkEvent ( const T QString & , const T QString & ) ) , m_eventLog , TQT_ SLOT( addEvent ( const T QString & , const T QString & ) ) ) ;
connect ( this , SIGNAL( rollDice ( ) ) , m_atlantikNetwork , SLOT( rollDice ( ) ) ) ;
connect ( this , SIGNAL( buyEstate ( ) ) , m_atlantikNetwork , SLOT( buyEstate ( ) ) ) ;
connect ( this , SIGNAL( auctionEstate ( ) ) , m_atlantikNetwork , SLOT( auctionEstate ( ) ) ) ;
connect ( this , SIGNAL( endTurn ( ) ) , m_atlantikNetwork , SLOT( endTurn ( ) ) ) ;
connect ( this , SIGNAL( jailCard ( ) ) , m_atlantikNetwork , SLOT( jailCard ( ) ) ) ;
connect ( this , SIGNAL( jailPay ( ) ) , m_atlantikNetwork , SLOT( jailPay ( ) ) ) ;
connect ( this , SIGNAL( jailRoll ( ) ) , m_atlantikNetwork , SLOT( jailRoll ( ) ) ) ;
connect ( this , TQT_ SIGNAL( rollDice ( ) ) , m_atlantikNetwork , TQT_ SLOT( rollDice ( ) ) ) ;
connect ( this , TQT_ SIGNAL( buyEstate ( ) ) , m_atlantikNetwork , TQT_ SLOT( buyEstate ( ) ) ) ;
connect ( this , TQT_ SIGNAL( auctionEstate ( ) ) , m_atlantikNetwork , TQT_ SLOT( auctionEstate ( ) ) ) ;
connect ( this , TQT_ SIGNAL( endTurn ( ) ) , m_atlantikNetwork , TQT_ SLOT( endTurn ( ) ) ) ;
connect ( this , TQT_ SIGNAL( jailCard ( ) ) , m_atlantikNetwork , TQT_ SLOT( jailCard ( ) ) ) ;
connect ( this , TQT_ SIGNAL( jailPay ( ) ) , m_atlantikNetwork , TQT_ SLOT( jailPay ( ) ) ) ;
connect ( this , TQT_ SIGNAL( jailRoll ( ) ) , m_atlantikNetwork , TQT_ SLOT( jailRoll ( ) ) ) ;
}
void Atlantik : : clientCookie ( QString cookie )
void Atlantik : : clientCookie ( T QString cookie )
{
KConfig * config = kapp - > config ( ) ;
@ -789,7 +789,7 @@ void Atlantik::sendHandshake()
// Check command-line args to see if we need to auto-join
KCmdLineArgs * args = KCmdLineArgs : : parsedArgs ( ) ;
QCString game = args - > getOption ( " game " ) ;
T QCString game = args - > getOption ( " game " ) ;
if ( ! game . isNull ( ) )
m_atlantikNetwork - > joinGame ( game . toInt ( ) ) ;
}
@ -812,10 +812,10 @@ PortfolioView *Atlantik::addPortfolioView(Player *player)
if ( m_portfolioViews . count ( ) > 0 & & m_portfolioScroll - > isHidden ( ) )
m_portfolioScroll - > show ( ) ;
connect ( player , SIGNAL( changed ( Player * ) ) , portfolioView , SLOT( playerChanged ( ) ) ) ;
connect ( portfolioView , SIGNAL( newTrade ( Player * ) ) , m_atlantikNetwork , SLOT( newTrade ( Player * ) ) ) ;
connect ( portfolioView , SIGNAL( kickPlayer ( Player * ) ) , m_atlantikNetwork , SLOT( kickPlayer ( Player * ) ) ) ;
connect ( portfolioView , SIGNAL( estateClicked ( Estate * ) ) , m_board , SLOT( prependEstateDetails ( Estate * ) ) ) ;
connect ( player , TQT_ SIGNAL( changed ( Player * ) ) , portfolioView , TQT_ SLOT( playerChanged ( ) ) ) ;
connect ( portfolioView , TQT_ SIGNAL( newTrade ( Player * ) ) , m_atlantikNetwork , TQT_ SLOT( newTrade ( Player * ) ) ) ;
connect ( portfolioView , TQT_ SIGNAL( kickPlayer ( Player * ) ) , m_atlantikNetwork , TQT_ SLOT( kickPlayer ( Player * ) ) ) ;
connect ( portfolioView , TQT_ SIGNAL( estateClicked ( Estate * ) ) , m_board , TQT_ SLOT( prependEstateDetails ( Estate * ) ) ) ;
m_portfolioLayout - > addWidget ( portfolioView ) ;
portfolioView - > show ( ) ;
@ -826,14 +826,14 @@ PortfolioView *Atlantik::addPortfolioView(Player *player)
PortfolioView * Atlantik : : findPortfolioView ( Player * player )
{
PortfolioView * portfolioView = 0 ;
for ( QPtrListIterator< PortfolioView > it ( m_portfolioViews ) ; ( portfolioView = * it ) ; + + it )
for ( T QPtrListIterator< PortfolioView > it ( m_portfolioViews ) ; ( portfolioView = * it ) ; + + it )
if ( player = = portfolioView - > player ( ) )
return portfolioView ;
return 0 ;
}
void Atlantik : : closeEvent ( QCloseEvent * e )
void Atlantik : : closeEvent ( T QCloseEvent * e )
{
Game * gameSelf = m_atlanticCore - > gameSelf ( ) ;
Player * playerSelf = m_atlanticCore - > playerSelf ( ) ;