advanced error handling for style readers
This commit is contained in:
@@ -3535,9 +3535,6 @@
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuView">
|
||||
<property name="title">
|
||||
<string>&View</string>
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
MyMenuBar::MyMenuBar(QMainWindow* parent)
|
||||
: QMenuBar(parent)
|
||||
{
|
||||
//this->setAttribute(Qt::WA_TranslucentBackground);
|
||||
}
|
||||
|
||||
void MyMenuBar::paintEvent(QPaintEvent * event) {
|
||||
void MyMenuBar::paintEvent(QPaintEvent *e) {
|
||||
|
||||
QMenuBar::paintEvent(event);
|
||||
QMenuBar::paintEvent(e);
|
||||
}
|
||||
|
||||
@@ -63,6 +63,14 @@ void CardDeckStyleReader::readStyleFile(QString file) {
|
||||
if(doc.RootElement()) {
|
||||
TiXmlHandle docHandle( &doc );
|
||||
|
||||
TiXmlElement *GameTableElement = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).ToElement();
|
||||
if(GameTableElement) {
|
||||
QMessageBox::warning(myW, tr("Card Deck Style Error"),
|
||||
tr("You wanna add a card deck style but selected a game table style.\nPlease choose a card deck style and try again!"),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
else {
|
||||
|
||||
TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "CardDeck" ).FirstChild().ToElement();
|
||||
for( ; itemsList; itemsList=itemsList->NextSiblingElement()) {
|
||||
const char *tmpStr1 = itemsList->Attribute("value");
|
||||
@@ -117,7 +125,7 @@ void CardDeckStyleReader::readStyleFile(QString file) {
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
loadedSuccessfull = 0;
|
||||
|
||||
@@ -100,6 +100,13 @@ void GameTableStyleReader::readStyleFile(QString file) {
|
||||
if(doc.RootElement()) {
|
||||
TiXmlHandle docHandle( &doc );
|
||||
|
||||
TiXmlElement *CardDeckElement = docHandle.FirstChild( "PokerTH" ).FirstChild( "CardDeck" ).ToElement();
|
||||
if(CardDeckElement) {
|
||||
QMessageBox::warning(myW, tr("Game Table Style Error"),
|
||||
tr("You wanna add a game table style but selected a card deck style.\nPlease choose a game table style and try again!"),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
else {
|
||||
TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).FirstChild().ToElement();
|
||||
for( ; itemsList; itemsList=itemsList->NextSiblingElement()) {
|
||||
const char *tmpStr1 = itemsList->Attribute("value");
|
||||
@@ -477,6 +484,7 @@ void GameTableStyleReader::readStyleFile(QString file) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
loadedSuccessfull = 0;
|
||||
QMessageBox::warning(myW, tr("Game Table Style Error"),
|
||||
|
||||
Reference in New Issue
Block a user