summaryrefslogtreecommitdiff
path: root/noncore/games/backgammon/themedialog.cpp
Unidiff
Diffstat (limited to 'noncore/games/backgammon/themedialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/backgammon/themedialog.cpp2
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)
50 boxodds->setGeometry(40,200,195,20); 50 boxodds->setGeometry(40,200,195,20);
51 fillBox("odds",boxodds); 51 fillBox("odds",boxodds);
52 boxodds->setEnabled(false); 52 boxodds->setEnabled(false);
53 53
54 QLabel* labeltable=new QLabel("table",this); 54 QLabel* labeltable=new QLabel("table",this);
55 labeltable->setGeometry(0,225,40,20); 55 labeltable->setGeometry(0,225,40,20);
56 boxtable=new QComboBox(this); 56 boxtable=new QComboBox(this);
57 boxtable->setGeometry(40,225,195,20); 57 boxtable->setGeometry(40,225,195,20);
58 fillBox("table",boxtable); 58 fillBox("table",boxtable);
59 59
60 QPEApplication::showDialog( this ); 60 QPEApplication::showDialog( this );
61} 61}
62 62
63ThemeDialog::~ThemeDialog() 63ThemeDialog::~ThemeDialog()
64{} 64{}
65 65
66 66
67ImageNames ThemeDialog::getNames() 67ImageNames ThemeDialog::getNames()
68{ 68{
69 ImageNames names; 69 ImageNames names;
70 names.theme=lineName->text(); 70 names.theme=lineName->text();
71 names.board=boxboard->currentText(); 71 names.board=boxboard->currentText();
72 names.pieces1=boxpiecesA->currentText(); 72 names.pieces1=boxpiecesA->currentText();
73 names.pieces2=boxpiecesB->currentText(); 73 names.pieces2=boxpiecesB->currentText();
74 names.dice1=boxdiceA->currentText(); 74 names.dice1=boxdiceA->currentText();
75 names.dice2=boxdiceB->currentText(); 75 names.dice2=boxdiceB->currentText();
76 names.odds=boxodds->currentText(); 76 names.odds=boxodds->currentText();
77 names.table=boxtable->currentText(); 77 names.table=boxtable->currentText();
78 return names; 78 return names;
79} 79}
80 80
81void ThemeDialog::setCurrent(const ImageNames& current) 81void ThemeDialog::setCurrent(const ImageNames& current)
82{ 82{
83 int a=0; 83 int a=0;
84 lineName->setText(current.theme); 84 lineName->setText(current.theme);
85 for(a=0;a<boxboard->count();a++) 85 for(a=0;a<boxboard->count();a++)
86 { 86 {
87 if(boxboard->text(a)==current.board) 87 if(boxboard->text(a)==current.board)
88 { 88 {
89 boxboard->setCurrentItem(a); 89 boxboard->setCurrentItem(a);
90 break; 90 break;
91 } 91 }
92 } 92 }
93 for(a=0;a<boxpiecesA->count();a++) 93 for(a=0;a<boxpiecesA->count();a++)
94 { 94 {
95 if(boxpiecesA->text(a)==current.pieces1) 95 if(boxpiecesA->text(a)==current.pieces1)
96 { 96 {
97 boxpiecesA->setCurrentItem(a); 97 boxpiecesA->setCurrentItem(a);
98 break; 98 break;
99 } 99 }
100 } 100 }
101 for(a=0;a<boxpiecesB->count();a++) 101 for(a=0;a<boxpiecesB->count();a++)
102 { 102 {
103 if(boxpiecesB->text(a)==current.pieces2) 103 if(boxpiecesB->text(a)==current.pieces2)
104 { 104 {
105 boxpiecesB->setCurrentItem(a); 105 boxpiecesB->setCurrentItem(a);
106 break; 106 break;
107 } 107 }
108 } 108 }
109 for(a=0;a<boxdiceA->count();a++) 109 for(a=0;a<boxdiceA->count();a++)
110 { 110 {
111 if(boxdiceA->text(a)==current.dice1) 111 if(boxdiceA->text(a)==current.dice1)
112 { 112 {
113 boxdiceA->setCurrentItem(a); 113 boxdiceA->setCurrentItem(a);
114 break; 114 break;
115 } 115 }
116 } 116 }
117 for(a=0;a<boxdiceB->count();a++) 117 for(a=0;a<boxdiceB->count();a++)
118 { 118 {
119 if(boxdiceB->text(a)==current.dice2) 119 if(boxdiceB->text(a)==current.dice2)
120 { 120 {
121 boxdiceB->setCurrentItem(a); 121 boxdiceB->setCurrentItem(a);
122 break; 122 break;
123 } 123 }
124 } 124 }
125 for(a=0;a<boxodds->count();a++) 125 for(a=0;a<boxodds->count();a++)
126 { 126 {
127 if(boxodds->text(a)==current.odds) 127 if(boxodds->text(a)==current.odds)
128 { 128 {
129 boxodds->setCurrentItem(a); 129 boxodds->setCurrentItem(a);
130 break; 130 break;
131 } 131 }
132 } 132 }
133 for(a=0;a<boxtable->count();a++) 133 for(a=0;a<boxtable->count();a++)
134 { 134 {
135 if(boxtable->text(a)==current.table) 135 if(boxtable->text(a)==current.table)
136 { 136 {
137 boxtable->setCurrentItem(a); 137 boxtable->setCurrentItem(a);
138 break; 138 break;
139 } 139 }
140 } 140 }
141} 141}
142 142
143void ThemeDialog::fillBox(QString dirname,QComboBox* thebox) 143void ThemeDialog::fillBox(QString dirname,QComboBox* thebox)
144{ 144{
145 thebox->clear(); 145 thebox->clear();
146 QDir dir(QPEApplication::qpeDir()+"/pics/backgammon/"+dirname); 146 QDir dir(QPEApplication::qpeDir()+"pics/backgammon/"+dirname);
147 dir.setFilter(QDir::Dirs | QDir::Files); 147 dir.setFilter(QDir::Dirs | QDir::Files);
148 QFileInfoListIterator it(*(dir.entryInfoList())); 148 QFileInfoListIterator it(*(dir.entryInfoList()));
149 QFileInfo* fi; 149 QFileInfo* fi;
150 150
151 while((fi=it.current())) // go through all file and subdirs 151 while((fi=it.current())) // go through all file and subdirs
152 { 152 {
153 QString file=fi->fileName(); 153 QString file=fi->fileName();
154 if(file.right(4)==".png") 154 if(file.right(4)==".png")
155 { 155 {
156 thebox->insertItem(file.left(file.find(".png"))); 156 thebox->insertItem(file.left(file.find(".png")));
157 } 157 }
158 ++it; 158 ++it;
159 } 159 }
160 delete fi; 160 delete fi;
161} 161}