This commit is contained in:
@@ -96,7 +96,8 @@ public:
|
||||
virtual void logNewGameHandMsg(int gameID, int HandID) =0;
|
||||
|
||||
//connectToServerDialog
|
||||
virtual void refreshConnectToServerDialog(int messageID, int percent) =0;
|
||||
virtual void showActionConnectToServerDialog(int actionID) =0;
|
||||
virtual void showErrorConnectToServerDialog(int errorID) =0;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<widget class="QLabel" name="label_actionMessage" >
|
||||
<property name="text" >
|
||||
<string>Connecting to Server ...</string>
|
||||
</property>
|
||||
@@ -61,7 +61,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton" >
|
||||
<widget class="QPushButton" name="pushButton_cancel" >
|
||||
<property name="text" >
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
@@ -87,7 +87,7 @@
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>pushButton</sender>
|
||||
<sender>pushButton_cancel</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>connectToServerDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
|
||||
@@ -30,8 +30,36 @@ connectToServerDialogImpl::connectToServerDialogImpl(QWidget *parent)
|
||||
|
||||
}
|
||||
|
||||
void connectToServerDialogImpl::refresh(int messageID, int percent) {
|
||||
void connectToServerDialogImpl::refresh(int actionID) {
|
||||
|
||||
int maxStateNumber = 10;
|
||||
|
||||
switch (actionID) {
|
||||
|
||||
case 0: { label_actionMessage->setText("msg0"); }
|
||||
break;
|
||||
case 1: { label_actionMessage->setText("msg1"); }
|
||||
break;
|
||||
case 2: { label_actionMessage->setText("msg2"); }
|
||||
break;
|
||||
case 3: { label_actionMessage->setText("msg3"); }
|
||||
break;
|
||||
case 4: { label_actionMessage->setText("msg4"); }
|
||||
break;
|
||||
default: { label_actionMessage->setText("ERROR"); }
|
||||
}
|
||||
|
||||
progressBar->setValue(actionID*(100/maxStateNumber));
|
||||
}
|
||||
|
||||
void connectToServerDialogImpl::error(int errorID) {
|
||||
|
||||
if(errorID) {
|
||||
QMessageBox::warning(this, tr("Connection Error"),
|
||||
tr("An Operating System Error occured during Connection"),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
|
||||
this->reject();
|
||||
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ public:
|
||||
|
||||
public slots:
|
||||
|
||||
void refresh(int messageID, int percent);
|
||||
|
||||
void refresh(int actionID);
|
||||
void error(int errorID);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -90,4 +90,5 @@ void GuiWrapper::meInAction() const { myW->meInAction(); }
|
||||
void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->logPlayerActionMsg(playerName, action, setValue); }
|
||||
void GuiWrapper::logNewGameHandMsg(int gameID, int handID) { myLog->logNewGameHandMsg(gameID, handID); }
|
||||
|
||||
void GuiWrapper::refreshConnectToServerDialog(int messageID, int percent) { myConnectToServerDialog->refresh(messageID, percent); }
|
||||
void GuiWrapper::showActionConnectToServerDialog(int actionID) { myConnectToServerDialog->refresh(actionID); }
|
||||
void GuiWrapper::showErrorConnectToServerDialog(int errorID) { myConnectToServerDialog->error(errorID); }
|
||||
|
||||
@@ -87,7 +87,8 @@ public:
|
||||
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
|
||||
void logNewGameHandMsg(int gameID, int handID) ;
|
||||
|
||||
void refreshConnectToServerDialog(int messageID, int percent);
|
||||
void showActionConnectToServerDialog(int actionID);
|
||||
void showErrorConnectToServerDialog(int errorID);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -225,15 +225,15 @@
|
||||
<sender>pushButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>joinNetworkGameDialog</receiver>
|
||||
<slot>hide()</slot>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>531</x>
|
||||
<y>430</y>
|
||||
<x>513</x>
|
||||
<y>431</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>411</x>
|
||||
<y>429</y>
|
||||
<x>449</x>
|
||||
<y>431</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
|
||||
@@ -1664,7 +1664,7 @@
|
||||
</palette>
|
||||
</property>
|
||||
<property name="currentIndex" >
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_log" >
|
||||
<attribute name="title" >
|
||||
@@ -1816,26 +1816,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab" >
|
||||
<attribute name="title" >
|
||||
<string>Page</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="label_3" >
|
||||
<property name="text" >
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" >
|
||||
|
||||
@@ -553,6 +553,11 @@ void mainWindowImpl::callJoinNetworkGameDialog() {
|
||||
connectToServerDialogImpl *w = new connectToServerDialogImpl();
|
||||
w->exec();
|
||||
|
||||
if (w->result() == QDialog::Rejected ) {
|
||||
callJoinNetworkGameDialog();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user