This commit is contained in:
doitux
2007-05-13 15:08:10 +00:00
parent 6d673793be
commit b4975dbea3
8 changed files with 62 additions and 33 deletions
@@ -35,6 +35,13 @@ createNetworkGameDialogImpl::createNetworkGameDialogImpl(QWidget *parent, Config
} }
void createNetworkGameDialogImpl::exec() {
fillFormular();
QDialog::exec();
}
void createNetworkGameDialogImpl::createGame() { void createNetworkGameDialogImpl::createGame() {
} }
@@ -34,6 +34,8 @@ Q_OBJECT
public: public:
createNetworkGameDialogImpl(QWidget *parent = 0, ConfigFile *c = 0); createNetworkGameDialogImpl(QWidget *parent = 0, ConfigFile *c = 0);
void exec();
public slots: public slots:
void createGame(); void createGame();
@@ -31,6 +31,19 @@ joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent, ConfigFile
setupUi(this); setupUi(this);
// QShortcut *connectKey = new QShortcut(QKeySequence(Qt::Key_Enter), this);
// connect( connectKey, SIGNAL(activated() ), pushButton_connect, SLOT( click() ) );
connect( pushButton_connect, SIGNAL( clicked() ), this, SLOT( startClient() ) );
connect( pushButton_save, SIGNAL( clicked() ), this, SLOT( saveServerProfile() ) );
connect( pushButton_delete, SIGNAL( clicked() ), this, SLOT( deleteServerProfile() ) );
connect( treeWidget, SIGNAL( itemClicked ( QTreeWidgetItem*, int) ), this, SLOT( itemFillForm (QTreeWidgetItem*, int) ) );
}
void joinNetworkGameDialogImpl::exec() {
spinBox_port->setValue(QString::fromUtf8(myConfig->readConfigString("ServerPort").c_str()).toInt(&toIntTrue, 10)); spinBox_port->setValue(QString::fromUtf8(myConfig->readConfigString("ServerPort").c_str()).toInt(&toIntTrue, 10));
//Profile Name darf nicht mit einer Zahl beginnen --> XML konform //Profile Name darf nicht mit einer Zahl beginnen --> XML konform
@@ -65,17 +78,7 @@ joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent, ConfigFile
//Liste Füllen //Liste Füllen
fillServerProfileList(); fillServerProfileList();
QDialog::exec();
// QShortcut *connectKey = new QShortcut(QKeySequence(Qt::Key_Enter), this);
// connect( connectKey, SIGNAL(activated() ), pushButton_connect, SLOT( click() ) );
connect( pushButton_connect, SIGNAL( clicked() ), this, SLOT( startClient() ) );
connect( pushButton_save, SIGNAL( clicked() ), this, SLOT( saveServerProfile() ) );
connect( pushButton_delete, SIGNAL( clicked() ), this, SLOT( deleteServerProfile() ) );
connect( treeWidget, SIGNAL( itemClicked ( QTreeWidgetItem*, int) ), this, SLOT( itemFillForm (QTreeWidgetItem*, int) ) );
} }
@@ -39,6 +39,8 @@ public:
ConfigFile *myConfig; ConfigFile *myConfig;
std::string myServerProfilesFile; std::string myServerProfilesFile;
void exec();
public slots: public slots:
void startClient(); void startClient();
@@ -26,12 +26,17 @@ newGameDialogImpl::newGameDialogImpl(QWidget *parent, ConfigFile *c)
setupUi(this); setupUi(this);
//Game Settings
}
void newGameDialogImpl::exec() {
spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NumberOfPlayers")); spinBox_quantityPlayers->setValue(myConfig->readConfigInt("NumberOfPlayers"));
spinBox_startCash->setValue(myConfig->readConfigInt("StartCash")); spinBox_startCash->setValue(myConfig->readConfigInt("StartCash"));
spinBox_smallBlind->setValue(myConfig->readConfigInt("SmallBlind")); spinBox_smallBlind->setValue(myConfig->readConfigInt("SmallBlind"));
spinBox_gameSpeed->setValue(myConfig->readConfigInt("GameSpeed")); spinBox_gameSpeed->setValue(myConfig->readConfigInt("GameSpeed"));
spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("HandsBeforeRaiseSmallBlind")); spinBox_handsBeforeRaiseSmallBlind->setValue(myConfig->readConfigInt("HandsBeforeRaiseSmallBlind"));
} QDialog::exec();
}
@@ -33,6 +33,8 @@ Q_OBJECT
public: public:
newGameDialogImpl(QWidget *parent = 0, ConfigFile* = 0); newGameDialogImpl(QWidget *parent = 0, ConfigFile* = 0);
void exec();
public slots: public slots:
private: private:
@@ -28,6 +28,29 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c)
setupUi(this); setupUi(this);
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( isAccepted() ) );
connect( lineEdit_humanPlayerName, SIGNAL( textChanged( const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent1Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent2Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent3Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent4Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent5Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent6Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( pushButton_openFlipsidePicture, SIGNAL( clicked() ), this, SLOT( setFlipsidePicFileName()) );
connect( pushButton_openLogDir, SIGNAL( clicked() ), this, SLOT( setLogDir()) );
connect( pushButton_openAvatarFile0, SIGNAL( clicked() ), this, SLOT( setAvatarFile0()) );
connect( pushButton_openAvatarFile1, SIGNAL( clicked() ), this, SLOT( setAvatarFile1()) );
connect( pushButton_openAvatarFile2, SIGNAL( clicked() ), this, SLOT( setAvatarFile2()) );
connect( pushButton_openAvatarFile3, SIGNAL( clicked() ), this, SLOT( setAvatarFile3()) );
connect( pushButton_openAvatarFile4, SIGNAL( clicked() ), this, SLOT( setAvatarFile4()) );
connect( pushButton_openAvatarFile5, SIGNAL( clicked() ), this, SLOT( setAvatarFile5()) );
connect( pushButton_openAvatarFile6, SIGNAL( clicked() ), this, SLOT( setAvatarFile6()) );
}
void settingsDialogImpl::exec() {
// stackedWidget->removeWidget(page_4); // stackedWidget->removeWidget(page_4);
// listWidget->takeItem(2); // listWidget->takeItem(2);
// page_4->hide(); // page_4->hide();
@@ -91,27 +114,10 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c)
lineEdit_logDir->setText(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str())); lineEdit_logDir->setText(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str()));
spinBox_logStoreDuration->setValue(myConfig->readConfigInt("LogStoreDuration")); spinBox_logStoreDuration->setValue(myConfig->readConfigInt("LogStoreDuration"));
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( isAccepted() ) ); QDialog::exec();
connect( lineEdit_humanPlayerName, SIGNAL( textChanged( const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent1Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent2Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent3Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent4Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent5Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( lineEdit_Opponent6Name, SIGNAL( textChanged(const QString &) ), this, SLOT( playerNickChanged() ) );
connect( pushButton_openFlipsidePicture, SIGNAL( clicked() ), this, SLOT( setFlipsidePicFileName()) );
connect( pushButton_openLogDir, SIGNAL( clicked() ), this, SLOT( setLogDir()) );
connect( pushButton_openAvatarFile0, SIGNAL( clicked() ), this, SLOT( setAvatarFile0()) );
connect( pushButton_openAvatarFile1, SIGNAL( clicked() ), this, SLOT( setAvatarFile1()) );
connect( pushButton_openAvatarFile2, SIGNAL( clicked() ), this, SLOT( setAvatarFile2()) );
connect( pushButton_openAvatarFile3, SIGNAL( clicked() ), this, SLOT( setAvatarFile3()) );
connect( pushButton_openAvatarFile4, SIGNAL( clicked() ), this, SLOT( setAvatarFile4()) );
connect( pushButton_openAvatarFile5, SIGNAL( clicked() ), this, SLOT( setAvatarFile5()) );
connect( pushButton_openAvatarFile6, SIGNAL( clicked() ), this, SLOT( setAvatarFile6()) );
} }
void settingsDialogImpl::isAccepted() { void settingsDialogImpl::isAccepted() {
settingsCorrect = TRUE; settingsCorrect = TRUE;
@@ -32,6 +32,8 @@ Q_OBJECT
public: public:
settingsDialogImpl(QWidget *parent = 0, ConfigFile *c = 0); settingsDialogImpl(QWidget *parent = 0, ConfigFile *c = 0);
void exec();
void setPlayerNickIsChanged(bool theValue){ playerNickIsChanged = theValue;} void setPlayerNickIsChanged(bool theValue){ playerNickIsChanged = theValue;}
bool getPlayerNickIsChanged() const{ return playerNickIsChanged;} bool getPlayerNickIsChanged() const{ return playerNickIsChanged;}