show login dialog with F6
This commit is contained in:
@@ -48,7 +48,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
|
|||||||
myQtToolsInterface = CreateQtToolsWrapper();
|
myQtToolsInterface = CreateQtToolsWrapper();
|
||||||
|
|
||||||
// !!!! Revisionsnummer der Configdefaults !!!!!
|
// !!!! Revisionsnummer der Configdefaults !!!!!
|
||||||
configRev = 72;
|
configRev = 74;
|
||||||
|
|
||||||
//standard defaults
|
//standard defaults
|
||||||
logOnOffDefault = "1";
|
logOnOffDefault = "1";
|
||||||
@@ -264,6 +264,9 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
|
|||||||
configList.push_back(ConfigInfo("GameTableFullScreenSave", CONFIG_TYPE_INT, "0"));
|
configList.push_back(ConfigInfo("GameTableFullScreenSave", CONFIG_TYPE_INT, "0"));
|
||||||
configList.push_back(ConfigInfo("GameTableHeightSave", CONFIG_TYPE_INT, "600"));
|
configList.push_back(ConfigInfo("GameTableHeightSave", CONFIG_TYPE_INT, "600"));
|
||||||
configList.push_back(ConfigInfo("GameTableWidthSave", CONFIG_TYPE_INT, "1024"));
|
configList.push_back(ConfigInfo("GameTableWidthSave", CONFIG_TYPE_INT, "1024"));
|
||||||
|
configList.push_back(ConfigInfo("InternetLoginUserName", CONFIG_TYPE_STRING, ""));
|
||||||
|
configList.push_back(ConfigInfo("InternetLoginPasswordMd5", CONFIG_TYPE_STRING, ""));
|
||||||
|
|
||||||
|
|
||||||
//fill tempList firstTime
|
//fill tempList firstTime
|
||||||
configBufferList = configList;
|
configBufferList = configList;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>288</width>
|
<width>292</width>
|
||||||
<height>230</height>
|
<height>230</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -41,7 +41,11 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<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">
|
||||||
|
<enum>QLineEdit::Password</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="checkBox_2">
|
<widget class="QCheckBox" name="checkBox_2">
|
||||||
|
|||||||
@@ -1,6 +1,30 @@
|
|||||||
#include "internetgamelogindialogimpl.h"
|
#include "internetgamelogindialogimpl.h"
|
||||||
|
#include "configfile.h"
|
||||||
|
#include <QtCore>
|
||||||
|
|
||||||
internetGameLoginDialog::internetGameLoginDialog(QWidget *parent) :
|
internetGameLoginDialogImpl::internetGameLoginDialogImpl(QWidget *parent, ConfigFile *c) :
|
||||||
QDialog(parent){
|
QDialog(parent), myConfig(c){
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void internetGameLoginDialogImpl::exec() {
|
||||||
|
|
||||||
|
lineEdit_username->setText(QString::fromUtf8(myConfig->readConfigString("InternetLoginUserName").c_str()));
|
||||||
|
// lineEdit_password->
|
||||||
|
qDebug() << QString::fromUtf8(myConfig->readConfigString("InternetLoginPasswordMd5").c_str());
|
||||||
|
|
||||||
|
QDialog::exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void internetGameLoginDialogImpl::accept() {
|
||||||
|
|
||||||
|
myConfig->writeConfigString("InternetLoginUserName", lineEdit_username->text().toUtf8().constData());
|
||||||
|
|
||||||
|
QByteArray myBytes = QCryptographicHash::hash(lineEdit_password->text().toUtf8(), QCryptographicHash::Md5).toHex();
|
||||||
|
std::string myPwMd5String (myBytes.constData(), myBytes.size());
|
||||||
|
myConfig->writeConfigString("InternetLoginPasswordMd5", myPwMd5String);
|
||||||
|
|
||||||
|
myConfig->writeBuffer();
|
||||||
|
|
||||||
|
QDialog::accept();
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,10 +3,20 @@
|
|||||||
|
|
||||||
#include "ui_internetgamelogindialog.h"
|
#include "ui_internetgamelogindialog.h"
|
||||||
|
|
||||||
class internetGameLoginDialog : public QDialog, private Ui::internetGameLoginDialog {
|
class ConfigFile;
|
||||||
|
|
||||||
|
class internetGameLoginDialogImpl : public QDialog, private Ui::internetGameLoginDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
internetGameLoginDialog(QWidget *parent = 0);
|
internetGameLoginDialogImpl(QWidget *parent = 0, ConfigFile *c =0);
|
||||||
|
|
||||||
|
void exec();
|
||||||
|
void accept();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
ConfigFile *myConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INTERNETGAMELOGINDIALOGIMPL_H
|
#endif // INTERNETGAMELOGINDIALOGIMPL_H
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
#include "timeoutmsgboximpl.h"
|
#include "timeoutmsgboximpl.h"
|
||||||
#include "chattools.h"
|
#include "chattools.h"
|
||||||
#include "serverlistdialogimpl.h"
|
#include "serverlistdialogimpl.h"
|
||||||
|
#include "internetgamelogindialogimpl.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -94,6 +95,7 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
|
|||||||
|
|
||||||
myTimeoutDialog = new timeoutMsgBoxImpl(this);
|
myTimeoutDialog = new timeoutMsgBoxImpl(this);
|
||||||
myServerListDialog = new serverListDialogImpl(this, this, myConfig);
|
myServerListDialog = new serverListDialogImpl(this, this, myConfig);
|
||||||
|
myInternetGameLoginDialog = new internetGameLoginDialogImpl(this, myConfig);
|
||||||
|
|
||||||
connect( actionStart_Local_Game, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) );
|
connect( actionStart_Local_Game, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) );
|
||||||
connect( pushButtonStart_Local_Game, SIGNAL( clicked() ), this, SLOT( callNewGameDialog() ) );
|
connect( pushButtonStart_Local_Game, SIGNAL( clicked() ), this, SLOT( callNewGameDialog() ) );
|
||||||
@@ -869,3 +871,14 @@ QStringList startWindowImpl::getPlayerNicksList() {
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void startWindowImpl::showInternetGameLoginDialog() {
|
||||||
|
|
||||||
|
myInternetGameLoginDialog->exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void startWindowImpl::keyPressEvent ( QKeyEvent * event ) {
|
||||||
|
|
||||||
|
if (event->key() == Qt::Key_F6) { showInternetGameLoginDialog(); }
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class changeHumanPlayerNameDialogImpl;
|
|||||||
class gameLobbyDialogImpl;
|
class gameLobbyDialogImpl;
|
||||||
class timeoutMsgBoxImpl;
|
class timeoutMsgBoxImpl;
|
||||||
class serverListDialogImpl;
|
class serverListDialogImpl;
|
||||||
|
class internetGameLoginDialogImpl;
|
||||||
|
|
||||||
class startWindowImpl: public QMainWindow, public Ui::startWindow {
|
class startWindowImpl: public QMainWindow, public Ui::startWindow {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -54,6 +55,8 @@ public:
|
|||||||
boost::shared_ptr< GuiInterface > getMyServerGuiInterface() const { return myServerGuiInterface; }
|
boost::shared_ptr< GuiInterface > getMyServerGuiInterface() const { return myServerGuiInterface; }
|
||||||
connectToServerDialogImpl* getMyConnectToServerDialog() const { return myConnectToServerDialog; }
|
connectToServerDialogImpl* getMyConnectToServerDialog() const { return myConnectToServerDialog; }
|
||||||
|
|
||||||
|
void keyPressEvent( QKeyEvent *);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void signalShowClientDialog();
|
void signalShowClientDialog();
|
||||||
|
|
||||||
@@ -109,6 +112,7 @@ public slots:
|
|||||||
void joinGameLobby();
|
void joinGameLobby();
|
||||||
void showClientDialog();
|
void showClientDialog();
|
||||||
void showNetworkStartDialog();
|
void showNetworkStartDialog();
|
||||||
|
void showInternetGameLoginDialog();
|
||||||
|
|
||||||
void startNewLocalGame(newGameDialogImpl* =0);
|
void startNewLocalGame(newGameDialogImpl* =0);
|
||||||
|
|
||||||
@@ -143,7 +147,7 @@ private:
|
|||||||
timeoutMsgBoxImpl *myTimeoutDialog;
|
timeoutMsgBoxImpl *myTimeoutDialog;
|
||||||
startWindowImpl *myStartWindow;
|
startWindowImpl *myStartWindow;
|
||||||
serverListDialogImpl *myServerListDialog;
|
serverListDialogImpl *myServerListDialog;
|
||||||
|
internetGameLoginDialogImpl *myInternetGameLoginDialog;
|
||||||
|
|
||||||
friend class GuiWrapper;
|
friend class GuiWrapper;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user