From 2649ee716c1a81084413707a11b6b25ea15ae4e8 Mon Sep 17 00:00:00 2001 From: doitux Date: Thu, 1 Mar 2007 21:30:40 +0000 Subject: [PATCH] --- src/gui/qt/aboutpokerth.ui | 6 +-- .../joinnetworkgamedialogimpl.cpp | 45 ++++++++++++++----- src/gui/qt/mainwindow/mainwindowimpl.cpp | 9 ++-- 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/src/gui/qt/aboutpokerth.ui b/src/gui/qt/aboutpokerth.ui index 9ff9bc8c..dc111dc7 100755 --- a/src/gui/qt/aboutpokerth.ui +++ b/src/gui/qt/aboutpokerth.ui @@ -96,9 +96,9 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> #pokerth (irc.freenode.net)</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Authors: </span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Felix Hammer (<a href="mailto:f.hammer@web.de"><span style=" text-decoration: underline; color:#0000ff;">f.hammer@web.de</span></a>)</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Florian Thauer (<a href="mailto:f.thauer@web.de"><span style=" text-decoration: underline; color:#0000ff;">f.thauer@web.de</span></a>)</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Lothar May (<a href="mailto:l-may@gmx.de"><span style=" text-decoration: underline; color:#0000ff;">l-may@gmx.de</span></a>)</p></body></html> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Felix Hammer (<a href="mailto:doitux@pokerth.net"><span style=" text-decoration: underline; color:#0000ff;">doitux@pokerth.net</span></a>)</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Florian Thauer (<a href="mailto:floty@pokerth.net"><span style=" text-decoration: underline; color:#0000ff;">floty@pokerth.net</span></a>)</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Lothar May (<a href="mailto:lotodore@pokerth.net"><span style=" text-decoration: underline; color:#0000ff;">lotodore@pokerth.net</span></a>)</p></body></html> diff --git a/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp b/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp index c0602fef..ad754275 100644 --- a/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp +++ b/src/gui/qt/joinnetworkgamedialog/joinnetworkgamedialogimpl.cpp @@ -165,20 +165,43 @@ void joinNetworkGameDialogImpl::saveServerProfile() { TiXmlElement * testProfile = docHandle.FirstChild( "PokerTH" ).FirstChild( "ServerProfiles" ).FirstChild( lineEdit_profileName->text().toStdString() ).ToElement(); if( testProfile ) { - // Wenn der Name schon existiert --> Hinweis und nicht speichern - QMessageBox::warning(this, tr("Save Server Profile Error"), - tr("A Profile with this Name already exists.\nPlease select another Profile Name!"), - QMessageBox::Close); + // Wenn der Name schon existiert --> Überschreiben? + QMessageBox msgBox(QMessageBox::Warning, tr("Save Server Profile Error"), + tr("A Profile with this Name already exists.\nDo you want to overwrite ?"), QMessageBox::Yes | QMessageBox::No, this); + switch (msgBox.exec()) { + + case QMessageBox::Yes: { + // yes was clicked + // remove the old + testProfile->Parent()->RemoveChild(testProfile); + // write the new + TiXmlElement * profile1 = new TiXmlElement( lineEdit_profileName->text().toStdString() ); + profiles->LinkEndChild( profile1 ); + profile1->SetAttribute("Name", lineEdit_profileName->text().toStdString()); + profile1->SetAttribute("Address", lineEdit_ipAddress->text().toStdString()); + profile1->SetAttribute("Password", lineEdit_password->text().toStdString()); + profile1->SetAttribute("Port", spinBox_port->value()); + profile1->SetAttribute("IsIpv6", checkBox_ipv6->isChecked()); + } + break; + case QMessageBox::No: + // no was clicked + break; + default: + // should never be reached + break; + } + } else { // Wenn der Name nicht existiert --> speichern - TiXmlElement * profile = new TiXmlElement( lineEdit_profileName->text().toStdString() ); - profiles->LinkEndChild( profile ); - profile->SetAttribute("Name", lineEdit_profileName->text().toStdString()); - profile->SetAttribute("Address", lineEdit_ipAddress->text().toStdString()); - profile->SetAttribute("Password", lineEdit_password->text().toStdString()); - profile->SetAttribute("Port", spinBox_port->value()); - profile->SetAttribute("IsIpv6", checkBox_ipv6->isChecked()); + TiXmlElement * profile2 = new TiXmlElement( lineEdit_profileName->text().toStdString() ); + profiles->LinkEndChild( profile2 ); + profile2->SetAttribute("Name", lineEdit_profileName->text().toStdString()); + profile2->SetAttribute("Address", lineEdit_ipAddress->text().toStdString()); + profile2->SetAttribute("Password", lineEdit_password->text().toStdString()); + profile2->SetAttribute("Port", spinBox_port->value()); + profile2->SetAttribute("IsIpv6", checkBox_ipv6->isChecked()); } } diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 944c6ace..47e99cdb 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -478,8 +478,8 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent) connect(this, SIGNAL(SignalNetClientSuccess(int)), myConnectToServerDialog, SLOT(refresh(int))); connect(this, SIGNAL(SignalNetClientError(int, int)), myConnectToServerDialog, SLOT(error(int, int))); - textBrowser_Log->append(QString::number(this->pos().x(),10)+" "+QString::number(this->pos().y(),10)); - textBrowser_Log->append(QString::number(this->x(),10)+" "+QString::number(this->y(),10)); +// textBrowser_Log->append(QString::number(this->pos().x(),10)+" "+QString::number(this->pos().y(),10)); +// textBrowser_Log->append(QString::number(this->x(),10)+" "+QString::number(this->y(),10)); } @@ -1977,8 +1977,9 @@ void mainWindowImpl::paintStartSplash() { StartSplash *mySplash = new StartSplash(this); - mySplash->setMaximumSize(400,250); - mySplash->setMinimumSize(400,250); +// mySplash->setMaximumSize(400,250); +// mySplash->setMinimumSize(400,250); + mySplash->setGeometry(237,210,400,250); // mySplash->setWindowFlags(Qt::SplashScreen); mySplash->show(); }