summaryrefslogtreecommitdiff
path: root/noncore/tools/calculator/calculatorimpl.cpp
Unidiff
Diffstat (limited to 'noncore/tools/calculator/calculatorimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/calculator/calculatorimpl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/tools/calculator/calculatorimpl.cpp b/noncore/tools/calculator/calculatorimpl.cpp
index 163b4da..dead03d 100644
--- a/noncore/tools/calculator/calculatorimpl.cpp
+++ b/noncore/tools/calculator/calculatorimpl.cpp
@@ -175,97 +175,97 @@ CalculatorImpl::CalculatorImpl( QWidget * parent, const char * name,
175 bgr_command.insert( PushButtonMR); 175 bgr_command.insert( PushButtonMR);
176 bgr_command.insert( PushButtonMC); 176 bgr_command.insert( PushButtonMC);
177 bgr_command.insert( PushButtonCE); 177 bgr_command.insert( PushButtonCE);
178 connect( &bgr_command, SIGNAL(clicked(int) ), this, SLOT(command_buttons(int))); 178 connect( &bgr_command, SIGNAL(clicked(int) ), this, SLOT(command_buttons(int)));
179 179
180 bgr_digits.insert(PushButton0); 180 bgr_digits.insert(PushButton0);
181 bgr_digits.insert(PushButton1); 181 bgr_digits.insert(PushButton1);
182 bgr_digits.insert(PushButton2); 182 bgr_digits.insert(PushButton2);
183 bgr_digits.insert(PushButton3); 183 bgr_digits.insert(PushButton3);
184 bgr_digits.insert(PushButton4); 184 bgr_digits.insert(PushButton4);
185 bgr_digits.insert(PushButton5); 185 bgr_digits.insert(PushButton5);
186 bgr_digits.insert(PushButton6); 186 bgr_digits.insert(PushButton6);
187 bgr_digits.insert(PushButton7); 187 bgr_digits.insert(PushButton7);
188 bgr_digits.insert(PushButton8); 188 bgr_digits.insert(PushButton8);
189 bgr_digits.insert(PushButton9); 189 bgr_digits.insert(PushButton9);
190 connect( &bgr_digits, SIGNAL(clicked(int) ), this, SLOT(enterNumber(int))); 190 connect( &bgr_digits, SIGNAL(clicked(int) ), this, SLOT(enterNumber(int)));
191 191
192 192
193 bgr_std.insert(PushButtonEquals); 193 bgr_std.insert(PushButtonEquals);
194 bgr_std.insert(PushButtonDecimal); 194 bgr_std.insert(PushButtonDecimal);
195 bgr_std.insert(PushButtonAdd); 195 bgr_std.insert(PushButtonAdd);
196 bgr_std.insert(PushButtonMinus); 196 bgr_std.insert(PushButtonMinus);
197 bgr_std.insert(PushButtonDivide); 197 bgr_std.insert(PushButtonDivide);
198 bgr_std.insert(PushButtonTimes); 198 bgr_std.insert(PushButtonTimes);
199 connect( &bgr_std, SIGNAL(clicked(int) ), this, SLOT(std_buttons(int))); 199 connect( &bgr_std, SIGNAL(clicked(int) ), this, SLOT(std_buttons(int)));
200 200
201// change the / to a proper division signal 201// change the / to a proper division signal
202 PushButtonDivide->setText(QChar(0xF7)); 202 PushButtonDivide->setText(QChar(0xF7));
203 203
204 func_buttons[0] = PushButtonF1; 204 func_buttons[0] = PushButtonF1;
205 func_buttons[1] = PushButtonF2; 205 func_buttons[1] = PushButtonF2;
206 func_buttons[2] = PushButtonF3; 206 func_buttons[2] = PushButtonF3;
207 func_buttons[3] = PushButtonF4; 207 func_buttons[3] = PushButtonF4;
208 func_buttons[4] = PushButtonF5; 208 func_buttons[4] = PushButtonF5;
209 func_buttons[5] = PushButtonF6; 209 func_buttons[5] = PushButtonF6;
210 func_buttons[6] = PushButtonF7; 210 func_buttons[6] = PushButtonF7;
211 func_buttons[7] = PushButtonF8; 211 func_buttons[7] = PushButtonF8;
212 func_buttons[8] = PushButtonF9; 212 func_buttons[8] = PushButtonF9;
213 func_buttons[9] = PushButtonF10; 213 func_buttons[9] = PushButtonF10;
214 func_buttons[10] = PushButtonF11; 214 func_buttons[10] = PushButtonF11;
215 func_buttons[11] = PushButtonF12; 215 func_buttons[11] = PushButtonF12;
216 216
217 for ( int x = 0 ; x < func_button_count ; x++ ) { 217 for ( int x = 0 ; x < func_button_count ; x++ ) {
218 QPushButton* tmpbutton = func_buttons[x]; 218 QPushButton* tmpbutton = func_buttons[x];
219 faces << tmpbutton->text(); 219 faces << tmpbutton->text();
220 bgr_function.insert(tmpbutton); 220 bgr_function.insert(tmpbutton);
221 } 221 }
222 connect( &bgr_function, SIGNAL(clicked(int) ) , this, SLOT(do_convert(int) ) ); 222 connect( &bgr_function, SIGNAL(clicked(int) ) , this, SLOT(do_convert(int) ) );
223 connect( &bgr_function, SIGNAL(clicked(int) ) , this, SLOT(std_funcs (int) ) ); 223 connect( &bgr_function, SIGNAL(clicked(int) ) , this, SLOT(std_funcs(int) ) );
224 224
225 connect(ComboBoxFunction, SIGNAL(activated(int) ), this, SLOT(function_button(int) ) ); 225 connect(ComboBoxFunction, SIGNAL(activated(int) ), this, SLOT(function_button(int) ) );
226 226
227 captions.append(tr("Standard")); 227 captions.append(tr("Standard"));
228 ComboBoxFunction->insertItem(captions.last()); 228 ComboBoxFunction->insertItem(captions.last());
229 229
230 // now add in the conversion modes 230 // now add in the conversion modes
231 // when the menu gets done, these should be in a submenu 231 // when the menu gets done, these should be in a submenu
232 QString tmp = QPEApplication::qpeDir(); 232 QString tmp = QPEApplication::qpeDir();
233 tmp += "etc/unit_conversion.dat"; 233 tmp += "etc/unit_conversion.dat";
234 QFile myfile(tmp); 234 QFile myfile(tmp);
235 if ( !myfile.open( IO_Translate | IO_ReadOnly ) ) { 235 if ( !myfile.open( IO_Translate | IO_ReadOnly ) ) {
236 qDebug("Data file unit_conversion.dat not found\nNo conversion features will be available\n"+tmp); 236 qDebug("Data file unit_conversion.dat not found\nNo conversion features will be available\n"+tmp);
237 // disable the f button if no conv file available 237 // disable the f button if no conv file available
238 ComboBoxFunction->setEnabled(FALSE); 238 ComboBoxFunction->setEnabled(FALSE);
239 } 239 }
240 else { 240 else {
241 QString line, line2; 241 QString line, line2;
242 QTextStream ts(&myfile); 242 QTextStream ts(&myfile);
243 243
244 // first pass, see how many conversion types there are in order to allocate for them 244 // first pass, see how many conversion types there are in order to allocate for them
245 while ( ! ts.eof() ) { 245 while ( ! ts.eof() ) {
246 line = ts.readLine(); 246 line = ts.readLine();
247 if ( line.contains ("STARTTYPE" ) ) 247 if ( line.contains ("STARTTYPE" ) )
248 conversion_mode_count++; 248 conversion_mode_count++;
249 } 249 }
250 250
251 entry_list = new double[conversion_mode_count*func_button_count]; 251 entry_list = new double[conversion_mode_count*func_button_count];
252 preoffset_list = new double[conversion_mode_count*func_button_count]; 252 preoffset_list = new double[conversion_mode_count*func_button_count];
253 postoffset_list = new double[conversion_mode_count*func_button_count]; 253 postoffset_list = new double[conversion_mode_count*func_button_count];
254 myfile.close(); 254 myfile.close();
255 myfile.open( IO_Translate | IO_ReadOnly ); 255 myfile.open( IO_Translate | IO_ReadOnly );
256 QTextStream ts2(&myfile); 256 QTextStream ts2(&myfile);
257 257
258 // second pass, read in values 258 // second pass, read in values
259 int x = 0; 259 int x = 0;
260 while ( ! ts2.eof() ) { 260 while ( ! ts2.eof() ) {
261 line = ts2.readLine(); 261 line = ts2.readLine();
262 if ( line.contains("STARTTYPE") ) { 262 if ( line.contains("STARTTYPE") ) {
263 captions << tr( line.remove(0,10) ); 263 captions << tr( line.remove(0,10) );
264 ComboBoxFunction->insertItem(captions.last()); 264 ComboBoxFunction->insertItem(captions.last());
265 while ( !line.contains("ENDTYPE") ) { 265 while ( !line.contains("ENDTYPE") ) {
266 line = ts2.readLine(); 266 line = ts2.readLine();
267 if ( line.contains("NAME") ) { 267 if ( line.contains("NAME") ) {
268 faces << tr( line.remove(0,5) ); 268 faces << tr( line.remove(0,5) );
269 line2 = ts2.readLine(); 269 line2 = ts2.readLine();
270 line2.remove(0,6); 270 line2.remove(0,6);
271 entry_list[x] = line2.toDouble(); 271 entry_list[x] = line2.toDouble();