From 6eb192f8466da142eca537fca6efe11d80bfb1a0 Mon Sep 17 00:00:00 2001 From: doitux Date: Sat, 17 Feb 2007 23:27:33 +0000 Subject: [PATCH] --- src/gui/guiinterface.h | 2 +- .../connecttoserverdialogimpl.cpp | 35 +++++++++++++++++-- .../connecttoserverdialogimpl.h | 2 +- src/gui/qt/guiwrapper.cpp | 2 +- src/gui/qt/guiwrapper.h | 2 +- 5 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/gui/guiinterface.h b/src/gui/guiinterface.h index 7d2e5dc1..25996fa2 100644 --- a/src/gui/guiinterface.h +++ b/src/gui/guiinterface.h @@ -97,7 +97,7 @@ public: //connectToServerDialog virtual void showActionConnectToServerDialog(int actionID) =0; - virtual void showErrorConnectToServerDialog(int errorID) =0; + virtual void showErrorConnectToServerDialog(int errorID, int osErrorID) =0; diff --git a/src/gui/qt/connecttoserverdialog/connecttoserverdialogimpl.cpp b/src/gui/qt/connecttoserverdialog/connecttoserverdialogimpl.cpp index d2f3902d..76b57929 100644 --- a/src/gui/qt/connecttoserverdialog/connecttoserverdialogimpl.cpp +++ b/src/gui/qt/connecttoserverdialog/connecttoserverdialogimpl.cpp @@ -32,7 +32,7 @@ connectToServerDialogImpl::connectToServerDialogImpl(QWidget *parent) void connectToServerDialogImpl::refresh(int actionID) { - int maxStateNumber = 10; + int maxStateNumber = 4; switch (actionID) { @@ -50,16 +50,45 @@ void connectToServerDialogImpl::refresh(int actionID) { } progressBar->setValue(actionID*(100/maxStateNumber)); + + if (actionID*(100/maxStateNumber == 100)) { QTimer::singleShot(500, this, SLOT(hide())); } } -void connectToServerDialogImpl::error(int errorID) { +void connectToServerDialogImpl::error(int errorID, int osErrorID) { - if(errorID) { + if(osErrorID) { QMessageBox::warning(this, tr("Connection Error"), tr("An Operating System Error occured during Connection"), QMessageBox::Close); } + switch (errorID) { + + case 0: { QMessageBox::warning(this, tr("Connection Error"), + tr("Error0 occured during Connection"), + QMessageBox::Close); } + break; + case 1: {QMessageBox::warning(this, tr("Connection Error"), + tr("Error1 occured during Connection"), + QMessageBox::Close); } + break; + case 2: { QMessageBox::warning(this, tr("Connection Error"), + tr("Error2 occured during Connection"), + QMessageBox::Close); } + break; + case 3: { QMessageBox::warning(this, tr("Connection Error"), + tr("Error3 occured during Connection"), + QMessageBox::Close); } + break; + case 4: { QMessageBox::warning(this, tr("Connection Error"), + tr("Error4 occured during Connection"), + QMessageBox::Close); } + break; + default: { QMessageBox::warning(this, tr("Connection Error"), + tr("DEFAULT ERROR"), + QMessageBox::Close); } + } + this->reject(); } diff --git a/src/gui/qt/connecttoserverdialog/connecttoserverdialogimpl.h b/src/gui/qt/connecttoserverdialog/connecttoserverdialogimpl.h index 819c0f2b..df72a425 100644 --- a/src/gui/qt/connecttoserverdialog/connecttoserverdialogimpl.h +++ b/src/gui/qt/connecttoserverdialog/connecttoserverdialogimpl.h @@ -36,7 +36,7 @@ public: public slots: void refresh(int actionID); - void error(int errorID); + void error(int errorID, int osErrorID); }; #endif diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp index f1edd001..20d5fde9 100644 --- a/src/gui/qt/guiwrapper.cpp +++ b/src/gui/qt/guiwrapper.cpp @@ -91,4 +91,4 @@ void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) void GuiWrapper::logNewGameHandMsg(int gameID, int handID) { myLog->logNewGameHandMsg(gameID, handID); } void GuiWrapper::showActionConnectToServerDialog(int actionID) { myConnectToServerDialog->refresh(actionID); } -void GuiWrapper::showErrorConnectToServerDialog(int errorID) { myConnectToServerDialog->error(errorID); } +void GuiWrapper::showErrorConnectToServerDialog(int errorID, int osErrorID) { myConnectToServerDialog->error(errorID, osErrorID); } diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h index fc9ccd49..23ce17c2 100644 --- a/src/gui/qt/guiwrapper.h +++ b/src/gui/qt/guiwrapper.h @@ -88,7 +88,7 @@ public: void logNewGameHandMsg(int gameID, int handID) ; void showActionConnectToServerDialog(int actionID); - void showErrorConnectToServerDialog(int errorID); + void showErrorConnectToServerDialog(int errorID, int osErrorID); private: