This commit is contained in:
@@ -96,7 +96,8 @@ public:
|
|||||||
virtual void logNewGameHandMsg(int gameID, int HandID) =0;
|
virtual void logNewGameHandMsg(int gameID, int HandID) =0;
|
||||||
|
|
||||||
//connectToServerDialog
|
//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>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QLabel" name="label" >
|
<widget class="QLabel" name="label_actionMessage" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Connecting to Server ...</string>
|
<string>Connecting to Server ...</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton" >
|
<widget class="QPushButton" name="pushButton_cancel" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Cancel</string>
|
<string>Cancel</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>pushButton</sender>
|
<sender>pushButton_cancel</sender>
|
||||||
<signal>clicked()</signal>
|
<signal>clicked()</signal>
|
||||||
<receiver>connectToServerDialog</receiver>
|
<receiver>connectToServerDialog</receiver>
|
||||||
<slot>reject()</slot>
|
<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:
|
public slots:
|
||||||
|
|
||||||
void refresh(int messageID, int percent);
|
void refresh(int actionID);
|
||||||
|
void error(int errorID);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#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::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::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 logPlayerActionMsg(std::string playerName, int action, int setValue) ;
|
||||||
void logNewGameHandMsg(int gameID, int handID) ;
|
void logNewGameHandMsg(int gameID, int handID) ;
|
||||||
|
|
||||||
void refreshConnectToServerDialog(int messageID, int percent);
|
void showActionConnectToServerDialog(int actionID);
|
||||||
|
void showErrorConnectToServerDialog(int errorID);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -225,15 +225,15 @@
|
|||||||
<sender>pushButton</sender>
|
<sender>pushButton</sender>
|
||||||
<signal>clicked()</signal>
|
<signal>clicked()</signal>
|
||||||
<receiver>joinNetworkGameDialog</receiver>
|
<receiver>joinNetworkGameDialog</receiver>
|
||||||
<slot>hide()</slot>
|
<slot>close()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel" >
|
<hint type="sourcelabel" >
|
||||||
<x>531</x>
|
<x>513</x>
|
||||||
<y>430</y>
|
<y>431</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel" >
|
<hint type="destinationlabel" >
|
||||||
<x>411</x>
|
<x>449</x>
|
||||||
<y>429</y>
|
<y>431</y>
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
|||||||
@@ -1664,7 +1664,7 @@
|
|||||||
</palette>
|
</palette>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex" >
|
<property name="currentIndex" >
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab_log" >
|
<widget class="QWidget" name="tab_log" >
|
||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
@@ -1816,26 +1816,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</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>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2" >
|
<item row="1" column="2" >
|
||||||
|
|||||||
@@ -553,6 +553,11 @@ void mainWindowImpl::callJoinNetworkGameDialog() {
|
|||||||
connectToServerDialogImpl *w = new connectToServerDialogImpl();
|
connectToServerDialogImpl *w = new connectToServerDialogImpl();
|
||||||
w->exec();
|
w->exec();
|
||||||
|
|
||||||
|
if (w->result() == QDialog::Rejected ) {
|
||||||
|
callJoinNetworkGameDialog();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user