[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Camino-devel] camino/src/server ServerDialog.h ServerDialog.cpp
From: |
Philippe Fremy |
Subject: |
[Camino-devel] camino/src/server ServerDialog.h ServerDialog.cpp |
Date: |
Thu, 27 Feb 2003 17:58:40 -0500 |
CVSROOT: /cvsroot/camino
Module name: camino
Changes by: Philippe Fremy <address@hidden> 03/02/27 17:58:40
Modified files:
src/server : ServerDialog.h ServerDialog.cpp
Log message:
Do not display team selection choice in 2 players mode
Patches:
Index: camino/src/server/ServerDialog.cpp
diff -u camino/src/server/ServerDialog.cpp:1.10
camino/src/server/ServerDialog.cpp:1.11
--- camino/src/server/ServerDialog.cpp:1.10 Mon Feb 17 17:03:41 2003
+++ camino/src/server/ServerDialog.cpp Thu Feb 27 17:58:39 2003
@@ -2,7 +2,7 @@
**
** Camino
**
-** Version : $Id: ServerDialog.cpp,v 1.10 2003/02/17 22:03:41 pfremy Exp $
+** Version : $Id: ServerDialog.cpp,v 1.11 2003/02/27 22:58:39 pfremy Exp $
**
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 14/01/2003
@@ -43,11 +43,10 @@
{
slot_2players();
slot_team1();
- setFinishEnabled( _pageTeam, true );
- setNextEnabled( _pageWaitConnection, false );
helpButton()->hide();
backButton()->hide();
+ setFinishEnabled( _pageTeam, true );
_server = 0L;
_serverWidget = 0L;
@@ -57,51 +56,35 @@
connect( _team1, SIGNAL( clicked() ), SLOT( slot_team1() ) );
connect( _team2, SIGNAL( clicked() ), SLOT( slot_team2() ) );
connect( _team3, SIGNAL( clicked() ), SLOT( slot_team3() ) );
- connect( this, SIGNAL( selected( const QString & ) ), SLOT(
slot_selection( const QString & ) ) );
-}
-
-void ServerDialog::slot_2players()
-{
- _2players->setChecked( true );
- _4players->setChecked( false );
- _nb = 2;
-}
-
-void ServerDialog::slot_4players()
-{
- _2players->setChecked( false );
- _4players->setChecked( true );
- _nb = 4;
-}
-
-void ServerDialog::slot_team1()
-{
- _team1->setChecked( true );
- _team2->setChecked( false );
- _team3->setChecked( false );
- _team = 1;
+ connect( this, SIGNAL( selected( const QString & ) ), SLOT(
slot_pageSelected( const QString & ) ) );
}
-void ServerDialog::slot_team2()
+void ServerDialog::slot_pageSelected( const QString & pageTitle )
{
- _team1->setChecked( false );
- _team2->setChecked( true );
- _team3->setChecked( false );
- _team = 2;
+ if ( pageTitle == title( _pageChoosePort ) ) {
+ } else if( pageTitle == title( _pageWaitConnection ) ) {
+ if ( _nb == 2) {
+ nextButton()->hide();
+ setFinishEnabled( _pageWaitConnection, true );
+ setFinishEnabled( _pageWaitConnection, false );
+ setNextEnabled( _pageWaitConnection, false );
+ nextButton()->hide();
+ finishButton()->show();
+ } else {
+ setNextEnabled( _pageWaitConnection, false );
+ }
+ startServer();
+ }
}
-void ServerDialog::slot_team3()
-{
- _team1->setChecked( false );
- _team2->setChecked( false );
- _team3->setChecked( true );
- _team = 3;
-}
-
-void ServerDialog::slot_selection( const QString & pageTitle )
+void ServerDialog::slot_selectTeam()
{
- if( pageTitle == title( _pageWaitConnection ) ) {
- startServer();
+ Q_ASSERT( _playerList->childCount() >= _nb);
+ if ( _nb == 2) {
+ setFinishEnabled( _pageWaitConnection, true );
+ nextButton()->hide();
+ } else {
+ setNextEnabled( _pageWaitConnection, true );
}
}
@@ -139,12 +122,6 @@
new QListViewItem( _playerList, playerName, hostName );
}
-void ServerDialog::slot_selectTeam()
-{
- Q_ASSERT( _playerList->childCount() >= _nb);
- setNextEnabled( _pageWaitConnection, true );
-}
-
void ServerDialog::accept()
{
if (_nb != 2) {
@@ -172,3 +149,42 @@
ServerDialogUI::reject();
emit sig_quit();
}
+
+void ServerDialog::slot_2players()
+{
+ _2players->setChecked( true );
+ _4players->setChecked( false );
+ _nb = 2;
+}
+
+void ServerDialog::slot_4players()
+{
+ _2players->setChecked( false );
+ _4players->setChecked( true );
+ _nb = 4;
+}
+
+void ServerDialog::slot_team1()
+{
+ _team1->setChecked( true );
+ _team2->setChecked( false );
+ _team3->setChecked( false );
+ _team = 1;
+}
+
+void ServerDialog::slot_team2()
+{
+ _team1->setChecked( false );
+ _team2->setChecked( true );
+ _team3->setChecked( false );
+ _team = 2;
+}
+
+void ServerDialog::slot_team3()
+{
+ _team1->setChecked( false );
+ _team2->setChecked( false );
+ _team3->setChecked( true );
+ _team = 3;
+}
+
Index: camino/src/server/ServerDialog.h
diff -u camino/src/server/ServerDialog.h:1.8
camino/src/server/ServerDialog.h:1.9
--- camino/src/server/ServerDialog.h:1.8 Tue Jan 28 16:54:27 2003
+++ camino/src/server/ServerDialog.h Thu Feb 27 17:58:39 2003
@@ -5,7 +5,7 @@
** ServerDialog.h
** Main dialog of the server
**
-** Version : $Id: ServerDialog.h,v 1.8 2003/01/28 21:54:27 pfremy Exp $
+** Version : $Id: ServerDialog.h,v 1.9 2003/02/27 22:58:39 pfremy Exp $
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 15/01/2003
** Copyright: Pascal Audoux, Philippe Fremy 2003
@@ -62,7 +62,7 @@
void slot_team2();
void slot_team3();
- void slot_selection( const QString & title );
+ void slot_pageSelected( const QString & title );
void slot_selectTeam(); // advance to select team
signals:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Camino-devel] camino/src/server ServerDialog.h ServerDialog.cpp,
Philippe Fremy <=