show login dialog with F6
This commit is contained in:
@@ -48,7 +48,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
|
||||
myQtToolsInterface = CreateQtToolsWrapper();
|
||||
|
||||
// !!!! Revisionsnummer der Configdefaults !!!!!
|
||||
configRev = 72;
|
||||
configRev = 74;
|
||||
|
||||
//standard defaults
|
||||
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("GameTableHeightSave", CONFIG_TYPE_INT, "600"));
|
||||
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
|
||||
configBufferList = configList;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>288</width>
|
||||
<width>292</width>
|
||||
<height>230</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -41,7 +41,11 @@
|
||||
</widget>
|
||||
</item>
|
||||
<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 row="2" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
|
||||
@@ -1,6 +1,30 @@
|
||||
#include "internetgamelogindialogimpl.h"
|
||||
#include "configfile.h"
|
||||
#include <QtCore>
|
||||
|
||||
internetGameLoginDialog::internetGameLoginDialog(QWidget *parent) :
|
||||
QDialog(parent){
|
||||
internetGameLoginDialogImpl::internetGameLoginDialogImpl(QWidget *parent, ConfigFile *c) :
|
||||
QDialog(parent), myConfig(c){
|
||||
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"
|
||||
|
||||
class internetGameLoginDialog : public QDialog, private Ui::internetGameLoginDialog {
|
||||
class ConfigFile;
|
||||
|
||||
class internetGameLoginDialogImpl : public QDialog, private Ui::internetGameLoginDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
internetGameLoginDialog(QWidget *parent = 0);
|
||||
internetGameLoginDialogImpl(QWidget *parent = 0, ConfigFile *c =0);
|
||||
|
||||
void exec();
|
||||
void accept();
|
||||
|
||||
private:
|
||||
|
||||
ConfigFile *myConfig;
|
||||
};
|
||||
|
||||
#endif // INTERNETGAMELOGINDIALOGIMPL_H
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "timeoutmsgboximpl.h"
|
||||
#include "chattools.h"
|
||||
#include "serverlistdialogimpl.h"
|
||||
#include "internetgamelogindialogimpl.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -94,6 +95,7 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
|
||||
|
||||
myTimeoutDialog = new timeoutMsgBoxImpl(this);
|
||||
myServerListDialog = new serverListDialogImpl(this, this, myConfig);
|
||||
myInternetGameLoginDialog = new internetGameLoginDialogImpl(this, myConfig);
|
||||
|
||||
connect( actionStart_Local_Game, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) );
|
||||
connect( pushButtonStart_Local_Game, SIGNAL( clicked() ), this, SLOT( callNewGameDialog() ) );
|
||||
@@ -869,3 +871,14 @@ QStringList startWindowImpl::getPlayerNicksList() {
|
||||
|
||||
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 timeoutMsgBoxImpl;
|
||||
class serverListDialogImpl;
|
||||
class internetGameLoginDialogImpl;
|
||||
|
||||
class startWindowImpl: public QMainWindow, public Ui::startWindow {
|
||||
Q_OBJECT
|
||||
@@ -54,6 +55,8 @@ public:
|
||||
boost::shared_ptr< GuiInterface > getMyServerGuiInterface() const { return myServerGuiInterface; }
|
||||
connectToServerDialogImpl* getMyConnectToServerDialog() const { return myConnectToServerDialog; }
|
||||
|
||||
void keyPressEvent( QKeyEvent *);
|
||||
|
||||
signals:
|
||||
void signalShowClientDialog();
|
||||
|
||||
@@ -109,6 +112,7 @@ public slots:
|
||||
void joinGameLobby();
|
||||
void showClientDialog();
|
||||
void showNetworkStartDialog();
|
||||
void showInternetGameLoginDialog();
|
||||
|
||||
void startNewLocalGame(newGameDialogImpl* =0);
|
||||
|
||||
@@ -143,7 +147,7 @@ private:
|
||||
timeoutMsgBoxImpl *myTimeoutDialog;
|
||||
startWindowImpl *myStartWindow;
|
||||
serverListDialogImpl *myServerListDialog;
|
||||
|
||||
internetGameLoginDialogImpl *myInternetGameLoginDialog;
|
||||
|
||||
friend class GuiWrapper;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user