login dialog changes
This commit is contained in:
@@ -396,10 +396,6 @@ void gameLobbyDialogImpl::addGame(unsigned gameId)
|
|||||||
|
|
||||||
updateGameItem(itemList, gameId);
|
updateGameItem(itemList, gameId);
|
||||||
|
|
||||||
delete item1;
|
|
||||||
delete item2;
|
|
||||||
delete item3;
|
|
||||||
delete item4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void gameLobbyDialogImpl::updateGameMode(unsigned gameId, int /*newMode*/)
|
void gameLobbyDialogImpl::updateGameMode(unsigned gameId, int /*newMode*/)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox_reguser">
|
<widget class="QGroupBox" name="groupBox_reguser">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Registered User</string>
|
<string>Registered user</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -43,14 +43,14 @@
|
|||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLineEdit" name="lineEdit_password">
|
<widget class="QLineEdit" name="lineEdit_password">
|
||||||
<property name="echoMode">
|
<property name="echoMode">
|
||||||
<enum>QLineEdit::Normal</enum>
|
<enum>QLineEdit::Password</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="checkBox_rememberPassword">
|
<widget class="QCheckBox" name="checkBox_rememberPassword">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Remember Password (not recommended)</string>
|
<string>Remember password (not recommended)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="checkBox_guest">
|
<widget class="QCheckBox" name="checkBox_guest">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Login as Guest</string>
|
<string>Login as guest</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -80,14 +80,14 @@
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton">
|
<widget class="QPushButton" name="pushButton_login">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Login</string>
|
<string>Login</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_2">
|
<widget class="QPushButton" name="pushButton_cancel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Cancel</string>
|
<string>Cancel</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -101,8 +101,8 @@
|
|||||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style="font-weight:400; font-style:normal;">
|
</style></head><body style=" font-family:'Nimbus Sans L'; font-size:8pt; font-weight:400; font-style:normal;">
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#0000ff;">Create an user account ...</span></p></body></html></string>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#0000ff;">Create new user account ...</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -111,7 +111,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>pushButton</sender>
|
<sender>pushButton_login</sender>
|
||||||
<signal>clicked()</signal>
|
<signal>clicked()</signal>
|
||||||
<receiver>internetGameLoginDialog</receiver>
|
<receiver>internetGameLoginDialog</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
@@ -127,7 +127,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>pushButton_2</sender>
|
<sender>pushButton_cancel</sender>
|
||||||
<signal>clicked()</signal>
|
<signal>clicked()</signal>
|
||||||
<receiver>internetGameLoginDialog</receiver>
|
<receiver>internetGameLoginDialog</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ internetGameLoginDialogImpl::internetGameLoginDialogImpl(QWidget *parent, Config
|
|||||||
|
|
||||||
connect(groupBox_reguser, SIGNAL(toggled(bool)), this, SLOT(regUserToggled(bool)));
|
connect(groupBox_reguser, SIGNAL(toggled(bool)), this, SLOT(regUserToggled(bool)));
|
||||||
connect(checkBox_guest, SIGNAL(toggled(bool)), this, SLOT(guestUserToggled(bool)));
|
connect(checkBox_guest, SIGNAL(toggled(bool)), this, SLOT(guestUserToggled(bool)));
|
||||||
|
connect(lineEdit_password, SIGNAL(textEdited(QString)), this, SLOT(okButtonCheck()));
|
||||||
|
connect(lineEdit_username, SIGNAL(textEdited(QString)), this, SLOT(okButtonCheck()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void internetGameLoginDialogImpl::regUserToggled(bool b) {
|
void internetGameLoginDialogImpl::regUserToggled(bool b) {
|
||||||
@@ -18,11 +20,13 @@ void internetGameLoginDialogImpl::regUserToggled(bool b) {
|
|||||||
void internetGameLoginDialogImpl::guestUserToggled(bool b) {
|
void internetGameLoginDialogImpl::guestUserToggled(bool b) {
|
||||||
|
|
||||||
groupBox_reguser->setChecked(!b);
|
groupBox_reguser->setChecked(!b);
|
||||||
|
|
||||||
|
if(b) {
|
||||||
|
checkBox_rememberPassword->setChecked(false);
|
||||||
|
lineEdit_password->clear();
|
||||||
|
lineEdit_username->clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void internetGameLoginDialogImpl::exec() {
|
void internetGameLoginDialogImpl::exec() {
|
||||||
|
|
||||||
@@ -38,6 +42,7 @@ void internetGameLoginDialogImpl::exec() {
|
|||||||
checkBox_guest->setChecked(true);
|
checkBox_guest->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
okButtonCheck();
|
||||||
|
|
||||||
QDialog::exec();
|
QDialog::exec();
|
||||||
}
|
}
|
||||||
@@ -64,3 +69,18 @@ void internetGameLoginDialogImpl::accept() {
|
|||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void internetGameLoginDialogImpl::okButtonCheck() {
|
||||||
|
|
||||||
|
if(groupBox_reguser->isChecked()) {
|
||||||
|
if(!lineEdit_password->text().isEmpty() && !lineEdit_username->text().isEmpty()) {
|
||||||
|
pushButton_login->setEnabled(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pushButton_login->setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pushButton_login->setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void regUserToggled(bool);
|
void regUserToggled(bool);
|
||||||
void guestUserToggled(bool);
|
void guestUserToggled(bool);
|
||||||
|
void okButtonCheck();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -302,7 +302,6 @@ void startWindowImpl::joinGameLobby() {
|
|||||||
// Stop local game.
|
// Stop local game.
|
||||||
myGuiInterface->getMyW()->stopTimer();
|
myGuiInterface->getMyW()->stopTimer();
|
||||||
|
|
||||||
// Join Lobby
|
|
||||||
mySession->terminateNetworkClient();
|
mySession->terminateNetworkClient();
|
||||||
if (myServerGuiInterface)
|
if (myServerGuiInterface)
|
||||||
myServerGuiInterface->getSession()->terminateNetworkServer();
|
myServerGuiInterface->getSession()->terminateNetworkServer();
|
||||||
@@ -313,16 +312,20 @@ void startWindowImpl::joinGameLobby() {
|
|||||||
// Clear Lobby dialog.
|
// Clear Lobby dialog.
|
||||||
myGameLobbyDialog->clearDialog();
|
myGameLobbyDialog->clearDialog();
|
||||||
|
|
||||||
showInternetGameLoginDialog();
|
//login
|
||||||
|
myInternetGameLoginDialog->exec();
|
||||||
|
if(myInternetGameLoginDialog->result() == QDialog::Accepted) {
|
||||||
|
//send login infos
|
||||||
|
mySession->startInternetClient(std::string(myInternetGameLoginDialog->lineEdit_username->text().toUtf8().constData()), std::string(myInternetGameLoginDialog->lineEdit_password->text().toUtf8().constData()));
|
||||||
|
|
||||||
//Dialog mit Statusbalken
|
//Dialog mit Statusbalken
|
||||||
myConnectToServerDialog->exec();
|
myConnectToServerDialog->exec();
|
||||||
|
if (myConnectToServerDialog->result() == QDialog::Accepted ) {
|
||||||
if (myConnectToServerDialog->result() == QDialog::Rejected ) {
|
showLobbyDialog();
|
||||||
mySession->terminateNetworkClient();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
showLobbyDialog();
|
mySession->terminateNetworkClient();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -871,18 +874,3 @@ QStringList startWindowImpl::getPlayerNicksList() {
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
void startWindowImpl::showInternetGameLoginDialog() {
|
|
||||||
|
|
||||||
myInternetGameLoginDialog->exec();
|
|
||||||
|
|
||||||
// send login infos
|
|
||||||
mySession->startInternetClient(std::string(myInternetGameLoginDialog->lineEdit_username->text().toUtf8().constData()), std::string(myInternetGameLoginDialog->lineEdit_password->text().toUtf8().constData()));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//void startWindowImpl::keyPressEvent ( QKeyEvent * event ) {
|
|
||||||
//
|
|
||||||
// if (event->key() == Qt::Key_F6) { showInternetGameLoginDialog(); }
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ public slots:
|
|||||||
void joinGameLobby();
|
void joinGameLobby();
|
||||||
void showClientDialog();
|
void showClientDialog();
|
||||||
void showNetworkStartDialog();
|
void showNetworkStartDialog();
|
||||||
void showInternetGameLoginDialog();
|
|
||||||
|
|
||||||
void startNewLocalGame(newGameDialogImpl* =0);
|
void startNewLocalGame(newGameDialogImpl* =0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user