Diffstat (limited to 'noncore/games/backgammon/themedialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/backgammon/themedialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/games/backgammon/themedialog.cpp b/noncore/games/backgammon/themedialog.cpp index afd6a1b..9bdb6a9 100644 --- a/noncore/games/backgammon/themedialog.cpp +++ b/noncore/games/backgammon/themedialog.cpp @@ -50,112 +50,112 @@ ThemeDialog::ThemeDialog(QWidget* parent,const char* name,bool modal,WFlags f) boxodds->setGeometry(40,200,195,20); fillBox("odds",boxodds); boxodds->setEnabled(false); QLabel* labeltable=new QLabel("table",this); labeltable->setGeometry(0,225,40,20); boxtable=new QComboBox(this); boxtable->setGeometry(40,225,195,20); fillBox("table",boxtable); QPEApplication::showDialog( this ); } ThemeDialog::~ThemeDialog() {} ImageNames ThemeDialog::getNames() { ImageNames names; names.theme=lineName->text(); names.board=boxboard->currentText(); names.pieces1=boxpiecesA->currentText(); names.pieces2=boxpiecesB->currentText(); names.dice1=boxdiceA->currentText(); names.dice2=boxdiceB->currentText(); names.odds=boxodds->currentText(); names.table=boxtable->currentText(); return names; } void ThemeDialog::setCurrent(const ImageNames& current) { int a=0; lineName->setText(current.theme); for(a=0;a<boxboard->count();a++) { if(boxboard->text(a)==current.board) { boxboard->setCurrentItem(a); break; } } for(a=0;a<boxpiecesA->count();a++) { if(boxpiecesA->text(a)==current.pieces1) { boxpiecesA->setCurrentItem(a); break; } } for(a=0;a<boxpiecesB->count();a++) { if(boxpiecesB->text(a)==current.pieces2) { boxpiecesB->setCurrentItem(a); break; } } for(a=0;a<boxdiceA->count();a++) { if(boxdiceA->text(a)==current.dice1) { boxdiceA->setCurrentItem(a); break; } } for(a=0;a<boxdiceB->count();a++) { if(boxdiceB->text(a)==current.dice2) { boxdiceB->setCurrentItem(a); break; } } for(a=0;a<boxodds->count();a++) { if(boxodds->text(a)==current.odds) { boxodds->setCurrentItem(a); break; } } for(a=0;a<boxtable->count();a++) { if(boxtable->text(a)==current.table) { boxtable->setCurrentItem(a); break; } } } void ThemeDialog::fillBox(QString dirname,QComboBox* thebox) { thebox->clear(); - QDir dir(QPEApplication::qpeDir()+"/pics/backgammon/"+dirname); + QDir dir(QPEApplication::qpeDir()+"pics/backgammon/"+dirname); dir.setFilter(QDir::Dirs | QDir::Files); QFileInfoListIterator it(*(dir.entryInfoList())); QFileInfo* fi; while((fi=it.current())) // go through all file and subdirs { QString file=fi->fileName(); if(file.right(4)==".png") { thebox->insertItem(file.left(file.find(".png"))); } ++it; } delete fi; } |