- Timestamp:
- Jul 1, 2009, 7:01:23 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/i18n/en.ts
r30 r35 6 6 <name>CTSPModel</name> 7 7 <message> 8 <location filename="../src/tspmodel.cpp" line="5 2"/>8 <location filename="../src/tspmodel.cpp" line="51"/> 9 9 <source>City %1</source> 10 10 <translation type="unfinished"></translation> 11 11 </message> 12 12 <message> 13 <location filename="../src/tspmodel.cpp" line="5 4"/>13 <location filename="../src/tspmodel.cpp" line="53"/> 14 14 <source>%1</source> 15 <translation type="unfinished"></translation> 16 </message> 17 <message> 18 <location filename="../src/tspmodel.cpp" line="156"/> 19 <source>Unexpected end of file.</source> 20 <translation type="unfinished"></translation> 21 </message> 22 <message> 23 <location filename="../src/tspmodel.cpp" line="158"/> 24 <source>Corrupt data read. File possibly corrupted.</source> 25 <translation type="unfinished"></translation> 26 </message> 27 <message> 28 <location filename="../src/tspmodel.cpp" line="160"/> 29 <source>Unknown error.</source> 30 <translation type="unfinished"></translation> 31 </message> 32 <message> 33 <location filename="../src/tspmodel.cpp" line="161"/> 34 <location filename="../src/tspmodel.cpp" line="169"/> 35 <location filename="../src/tspmodel.cpp" line="184"/> 36 <location filename="../src/tspmodel.cpp" line="200"/> 37 <location filename="../src/tspmodel.cpp" line="213"/> 38 <location filename="../src/tspmodel.cpp" line="243"/> 39 <location filename="../src/tspmodel.cpp" line="252"/> 40 <source>Task Load</source> 41 <translation type="unfinished"></translation> 42 </message> 43 <message> 44 <location filename="../src/tspmodel.cpp" line="161"/> 45 <location filename="../src/tspmodel.cpp" line="184"/> 46 <location filename="../src/tspmodel.cpp" line="200"/> 47 <location filename="../src/tspmodel.cpp" line="213"/> 48 <location filename="../src/tspmodel.cpp" line="243"/> 49 <location filename="../src/tspmodel.cpp" line="252"/> 50 <source>Unable to load task:</source> 51 <translation type="unfinished"></translation> 52 </message> 53 <message> 54 <location filename="../src/tspmodel.cpp" line="169"/> 55 <source>Unable to open task file. 56 Error: %1</source> 57 <translation type="unfinished"></translation> 58 </message> 59 <message> 60 <location filename="../src/tspmodel.cpp" line="184"/> 61 <source>Unknown file format or file is corrupted.</source> 62 <translation type="unfinished"></translation> 63 </message> 64 <message> 65 <location filename="../src/tspmodel.cpp" line="200"/> 66 <location filename="../src/tspmodel.cpp" line="243"/> 67 <source>File version is newer than application supports. 68 Please, try to update application.</source> 69 <translation type="unfinished"></translation> 70 </message> 71 <message> 72 <location filename="../src/tspmodel.cpp" line="213"/> 73 <location filename="../src/tspmodel.cpp" line="252"/> 74 <source>Unexpected data read. 75 File is possibly corrupted.</source> 76 <translation type="unfinished"></translation> 77 </message> 78 <message> 79 <location filename="../src/tspmodel.cpp" line="282"/> 80 <location filename="../src/tspmodel.cpp" line="288"/> 81 <location filename="../src/tspmodel.cpp" line="295"/> 82 <location filename="../src/tspmodel.cpp" line="302"/> 83 <location filename="../src/tspmodel.cpp" line="309"/> 84 <location filename="../src/tspmodel.cpp" line="316"/> 85 <location filename="../src/tspmodel.cpp" line="323"/> 86 <location filename="../src/tspmodel.cpp" line="333"/> 87 <source>Task Save</source> 88 <translation type="unfinished"></translation> 89 </message> 90 <message> 91 <location filename="../src/tspmodel.cpp" line="282"/> 92 <source>Unable to create task file. 93 Error: %1 94 Maybe, file is read-only?</source> 95 <translation type="unfinished"></translation> 96 </message> 97 <message> 98 <location filename="../src/tspmodel.cpp" line="288"/> 99 <location filename="../src/tspmodel.cpp" line="295"/> 100 <location filename="../src/tspmodel.cpp" line="302"/> 101 <location filename="../src/tspmodel.cpp" line="309"/> 102 <location filename="../src/tspmodel.cpp" line="316"/> 103 <location filename="../src/tspmodel.cpp" line="323"/> 104 <location filename="../src/tspmodel.cpp" line="333"/> 105 <source>Unable to save task. 106 Error: %1</source> 15 107 <translation type="unfinished"></translation> 16 108 </message> … … 19 111 <name>MainWindow</name> 20 112 <message> 21 <location filename="../src/mainwindow.cpp" line="12 5"/>22 <location filename="../src/mainwindow.cpp" line="2 46"/>23 <location filename="../src/mainwindow.cpp" line=" 255"/>113 <location filename="../src/mainwindow.cpp" line="124"/> 114 <location filename="../src/mainwindow.cpp" line="292"/> 115 <location filename="../src/mainwindow.cpp" line="301"/> 24 116 <source>Language change</source> 25 117 <translation type="unfinished"></translation> 26 118 </message> 27 119 <message> 28 <location filename="../src/mainwindow.cpp" line="12 5"/>120 <location filename="../src/mainwindow.cpp" line="124"/> 29 121 <source>Unable to load translation language.</source> 30 122 <translation type="unfinished"></translation> 31 123 </message> 32 124 <message> 33 <location filename="../src/mainwindow.cpp" line="192"/> 125 <location filename="../src/mainwindow.cpp" line="159"/> 126 <source>All Supported Formats</source> 127 <translation type="unfinished"></translation> 128 </message> 129 <message> 130 <location filename="../src/mainwindow.cpp" line="160"/> 131 <location filename="../src/mainwindow.cpp" line="161"/> 132 <source>%1 Task Files</source> 133 <translation type="unfinished"></translation> 134 </message> 135 <message> 136 <location filename="../src/mainwindow.cpp" line="162"/> 137 <location filename="../src/mainwindow.cpp" line="177"/> 138 <source>All Files</source> 139 <translation type="unfinished"></translation> 140 </message> 141 <message> 142 <location filename="../src/mainwindow.cpp" line="176"/> 143 <source>%1 Task File</source> 144 <translation type="unfinished"></translation> 145 </message> 146 <message> 147 <location filename="../src/mainwindow.cpp" line="228"/> 34 148 <source>Data error</source> 35 149 <translation type="unfinished"></translation> 36 150 </message> 37 151 <message> 38 <location filename="../src/mainwindow.cpp" line=" 192"/>152 <location filename="../src/mainwindow.cpp" line="228"/> 39 153 <source>Error in cell [Row %1; Column %2]: Invalid data format.</source> 40 154 <translation type="unfinished"></translation> 41 155 </message> 42 156 <message> 43 <location filename="../src/mainwindow.cpp" line="2 01"/>157 <location filename="../src/mainwindow.cpp" line="237"/> 44 158 <source>Solution error</source> 45 159 <translation type="unfinished"></translation> 46 160 </message> 47 161 <message> 48 <location filename="../src/mainwindow.cpp" line="2 01"/>162 <location filename="../src/mainwindow.cpp" line="237"/> 49 163 <source>There was an error while solving the task.</source> 50 164 <translation type="unfinished"></translation> 51 165 </message> 52 166 <message> 53 <location filename="../src/mainwindow.cpp" line="2 46"/>167 <location filename="../src/mainwindow.cpp" line="292"/> 54 168 <source>Language will be autodetected on next application start.</source> 55 169 <translation type="unfinished"></translation> 56 170 </message> 57 171 <message> 58 <location filename="../src/mainwindow.cpp" line=" 255"/>172 <location filename="../src/mainwindow.cpp" line="301"/> 59 173 <source>You have language autodetection turned on. 60 174 It needs to be off. … … 153 267 </message> 154 268 <message> 269 <location filename="../ui/mainwindow.ce.ui" line="558"/> 270 <location filename="../ui/mainwindow.ui" line="571"/> 271 <source>&Save</source> 272 <translation type="unfinished"></translation> 273 </message> 274 <message> 275 <location filename="../ui/mainwindow.ce.ui" line="283"/> 276 <location filename="../ui/mainwindow.ui" line="264"/> 277 <source>&Settings</source> 278 <translation type="unfinished"></translation> 279 </message> 280 <message> 155 281 <location filename="../ui/mainwindow.ce.ui" line="262"/> 156 282 <location filename="../ui/mainwindow.ui" line="240"/> 157 <source>&Save</source> 158 <translation type="unfinished"></translation> 159 </message> 160 <message> 161 <location filename="../ui/mainwindow.ce.ui" line="282"/> 162 <location filename="../ui/mainwindow.ui" line="263"/> 163 <source>&Settings</source> 164 <translation type="unfinished"></translation> 165 </message> 166 <message> 167 <location filename="../ui/mainwindow.ce.ui" line="292"/> 168 <location filename="../ui/mainwindow.ui" line="273"/> 283 <source>Save &as...</source> 284 <translation type="unfinished"></translation> 285 </message> 286 <message> 287 <location filename="../ui/mainwindow.ce.ui" line="293"/> 288 <location filename="../ui/mainwindow.ui" line="274"/> 169 289 <source>&Language</source> 170 290 <translation type="unfinished"></translation> 171 291 </message> 172 292 <message> 173 <location filename="../ui/mainwindow.ce.ui" line="30 8"/>174 <location filename="../ui/mainwindow.ui" line="2 89"/>293 <location filename="../ui/mainwindow.ce.ui" line="309"/> 294 <location filename="../ui/mainwindow.ui" line="290"/> 175 295 <source>&Help</source> 176 296 <translation type="unfinished"></translation> 177 297 </message> 178 298 <message> 179 <location filename="../ui/mainwindow.ce.ui" line="34 8"/>180 <location filename="../ui/mainwindow.ui" line="36 1"/>299 <location filename="../ui/mainwindow.ce.ui" line="349"/> 300 <location filename="../ui/mainwindow.ui" line="362"/> 181 301 <source>Solution st&eps</source> 182 302 <translation type="unfinished"></translation> 183 303 </message> 184 304 <message> 185 <location filename="../ui/mainwindow.ce.ui" line="35 1"/>186 <location filename="../ui/mainwindow.ui" line="36 4"/>305 <location filename="../ui/mainwindow.ce.ui" line="352"/> 306 <location filename="../ui/mainwindow.ui" line="365"/> 187 307 <source>Save solution steps</source> 188 308 <translation type="unfinished"></translation> 189 309 </message> 190 310 <message> 191 <location filename="../ui/mainwindow.ce.ui" line="35 4"/>192 <location filename="../ui/mainwindow.ui" line="36 7"/>311 <location filename="../ui/mainwindow.ce.ui" line="355"/> 312 <location filename="../ui/mainwindow.ui" line="368"/> 193 313 <source>Save solution steps only</source> 194 314 <translation type="unfinished"></translation> 195 315 </message> 196 316 <message> 197 <location filename="../ui/mainwindow.ce.ui" line="36 2"/>198 <location filename="../ui/mainwindow.ui" line="37 5"/>317 <location filename="../ui/mainwindow.ce.ui" line="363"/> 318 <location filename="../ui/mainwindow.ui" line="376"/> 199 319 <source>Solution &graph</source> 200 320 <translation type="unfinished"></translation> 201 321 </message> 202 322 <message> 203 <location filename="../ui/mainwindow.ce.ui" line="36 5"/>204 <location filename="../ui/mainwindow.ui" line="37 8"/>323 <location filename="../ui/mainwindow.ce.ui" line="366"/> 324 <location filename="../ui/mainwindow.ui" line="379"/> 205 325 <source>Save solution graph</source> 206 326 <translation type="unfinished"></translation> 207 327 </message> 208 328 <message> 209 <location filename="../ui/mainwindow.ce.ui" line="36 8"/>210 <location filename="../ui/mainwindow.ui" line="38 1"/>329 <location filename="../ui/mainwindow.ce.ui" line="369"/> 330 <location filename="../ui/mainwindow.ui" line="382"/> 211 331 <source>Save solution graph only</source> 212 332 <translation type="unfinished"></translation> 213 333 </message> 214 334 <message> 215 <location filename="../ui/mainwindow.ce.ui" line="37 6"/>216 <location filename="../ui/mainwindow.ui" line="3 89"/>335 <location filename="../ui/mainwindow.ce.ui" line="377"/> 336 <location filename="../ui/mainwindow.ui" line="390"/> 217 337 <source>&Solution</source> 218 338 <translation type="unfinished"></translation> 219 339 </message> 220 340 <message> 221 <location filename="../ui/mainwindow.ce.ui" line="3 79"/>222 <location filename="../ui/mainwindow.ui" line="39 2"/>341 <location filename="../ui/mainwindow.ce.ui" line="380"/> 342 <location filename="../ui/mainwindow.ui" line="393"/> 223 343 <source>Save solution</source> 224 344 <translation type="unfinished"></translation> 225 345 </message> 226 346 <message> 227 <location filename="../ui/mainwindow.ce.ui" line="38 2"/>228 <location filename="../ui/mainwindow.ui" line="39 5"/>347 <location filename="../ui/mainwindow.ce.ui" line="383"/> 348 <location filename="../ui/mainwindow.ui" line="396"/> 229 349 <source>Save solution steps and graph</source> 230 350 <translation type="unfinished"></translation> 231 351 </message> 232 352 <message> 233 <location filename="../ui/mainwindow.ce.ui" line="39 1"/>234 <location filename="../ui/mainwindow.ui" line="40 4"/>353 <location filename="../ui/mainwindow.ce.ui" line="392"/> 354 <location filename="../ui/mainwindow.ui" line="405"/> 235 355 <source>&New</source> 236 356 <translation type="unfinished"></translation> 237 357 </message> 238 358 <message> 239 <location filename="../ui/mainwindow.ce.ui" line="39 4"/>240 <location filename="../ui/mainwindow.ui" line="40 7"/>359 <location filename="../ui/mainwindow.ce.ui" line="395"/> 360 <location filename="../ui/mainwindow.ui" line="408"/> 241 361 <source>New</source> 242 362 <translation type="unfinished"></translation> 243 363 </message> 244 364 <message> 245 <location filename="../ui/mainwindow.ce.ui" line="39 7"/>246 <location filename="../ui/mainwindow.ui" line="41 0"/>365 <location filename="../ui/mainwindow.ce.ui" line="398"/> 366 <location filename="../ui/mainwindow.ui" line="411"/> 247 367 <source>New task</source> 248 368 <translation type="unfinished"></translation> 249 369 </message> 250 370 <message> 251 <location filename="../ui/mainwindow.ce.ui" line="40 0"/>252 <location filename="../ui/mainwindow.ui" line="41 3"/>371 <location filename="../ui/mainwindow.ce.ui" line="401"/> 372 <location filename="../ui/mainwindow.ui" line="414"/> 253 373 <source>Create new task</source> 254 374 <translation type="unfinished"></translation> 255 375 </message> 256 376 <message> 257 <location filename="../ui/mainwindow.ce.ui" line="40 3"/>258 <location filename="../ui/mainwindow.ui" line="41 6"/>377 <location filename="../ui/mainwindow.ce.ui" line="404"/> 378 <location filename="../ui/mainwindow.ui" line="417"/> 259 379 <source>Ctrl+N</source> 260 380 <translation type="unfinished"></translation> 261 381 </message> 262 382 <message> 263 <location filename="../ui/mainwindow.ce.ui" line="41 5"/>264 <location filename="../ui/mainwindow.ui" line="42 8"/>383 <location filename="../ui/mainwindow.ce.ui" line="413"/> 384 <location filename="../ui/mainwindow.ui" line="426"/> 265 385 <source>&Open...</source> 266 386 <translation type="unfinished"></translation> 267 387 </message> 268 388 <message> 269 <location filename="../ui/mainwindow.ce.ui" line="41 8"/>270 <location filename="../ui/mainwindow.ui" line="4 31"/>389 <location filename="../ui/mainwindow.ce.ui" line="416"/> 390 <location filename="../ui/mainwindow.ui" line="429"/> 271 391 <source>Open...</source> 272 392 <translation type="unfinished"></translation> 273 393 </message> 274 394 <message> 275 <location filename="../ui/mainwindow.ce.ui" line="4 21"/>276 <location filename="../ui/mainwindow.ui" line="43 4"/>395 <location filename="../ui/mainwindow.ce.ui" line="419"/> 396 <location filename="../ui/mainwindow.ui" line="432"/> 277 397 <source>Open task</source> 278 398 <translation type="unfinished"></translation> 279 399 </message> 280 400 <message> 281 <location filename="../ui/mainwindow.ce.ui" line="42 4"/>282 <location filename="../ui/mainwindow.ui" line="43 7"/>401 <location filename="../ui/mainwindow.ce.ui" line="422"/> 402 <location filename="../ui/mainwindow.ui" line="435"/> 283 403 <source>Open saved task</source> 284 404 <translation type="unfinished"></translation> 285 405 </message> 286 406 <message> 287 <location filename="../ui/mainwindow.ce.ui" line="42 7"/>288 <location filename="../ui/mainwindow.ui" line="4 40"/>407 <location filename="../ui/mainwindow.ce.ui" line="425"/> 408 <location filename="../ui/mainwindow.ui" line="438"/> 289 409 <source>Ctrl+O</source> 290 410 <translation type="unfinished"></translation> 291 411 </message> 292 412 <message> 293 <location filename="../ui/mainwindow.ce.ui" line="43 6"/>294 <location filename="../ui/mainwindow.ui" line="44 9"/>413 <location filename="../ui/mainwindow.ce.ui" line="434"/> 414 <location filename="../ui/mainwindow.ui" line="447"/> 295 415 <source>&Preferences...</source> 296 416 <translation type="unfinished"></translation> 297 417 </message> 298 418 <message> 299 <location filename="../ui/mainwindow.ce.ui" line="43 9"/>300 <location filename="../ui/mainwindow.ui" line="45 2"/>419 <location filename="../ui/mainwindow.ce.ui" line="437"/> 420 <location filename="../ui/mainwindow.ui" line="450"/> 301 421 <source>Preferences...</source> 302 422 <translation type="unfinished"></translation> 303 423 </message> 304 424 <message> 305 <location filename="../ui/mainwindow.ce.ui" line="44 2"/>306 <location filename="../ui/mainwindow.ui" line="45 5"/>425 <location filename="../ui/mainwindow.ce.ui" line="440"/> 426 <location filename="../ui/mainwindow.ui" line="453"/> 307 427 <source>Application preferences</source> 308 428 <translation type="unfinished"></translation> 309 429 </message> 310 430 <message> 311 <location filename="../ui/mainwindow.ce.ui" line="45 4"/>312 <location filename="../ui/mainwindow.ui" line="46 7"/>431 <location filename="../ui/mainwindow.ce.ui" line="452"/> 432 <location filename="../ui/mainwindow.ui" line="465"/> 313 433 <source>&Contents</source> 314 434 <translation type="unfinished"></translation> 315 435 </message> 316 436 <message> 317 <location filename="../ui/mainwindow.ce.ui" line="45 7"/>318 <location filename="../ui/mainwindow.ui" line="4 70"/>437 <location filename="../ui/mainwindow.ce.ui" line="455"/> 438 <location filename="../ui/mainwindow.ui" line="468"/> 319 439 <source>Open help contents</source> 320 440 <translation type="unfinished"></translation> 321 441 </message> 322 442 <message> 323 <location filename="../ui/mainwindow.ce.ui" line="46 9"/>324 <location filename="../ui/mainwindow.ui" line="48 2"/>443 <location filename="../ui/mainwindow.ce.ui" line="467"/> 444 <location filename="../ui/mainwindow.ui" line="480"/> 325 445 <source>&Context help</source> 326 446 <translation type="unfinished"></translation> 327 447 </message> 328 448 <message> 329 <location filename="../ui/mainwindow.ce.ui" line="47 2"/>330 <location filename="../ui/mainwindow.ui" line="48 5"/>449 <location filename="../ui/mainwindow.ce.ui" line="470"/> 450 <location filename="../ui/mainwindow.ui" line="483"/> 331 451 <source>Open context help</source> 332 452 <translation type="unfinished"></translation> 333 453 </message> 334 454 <message> 335 <location filename="../ui/mainwindow.ce.ui" line="4 81"/>336 <location filename="../ui/mainwindow.ui" line="49 4"/>455 <location filename="../ui/mainwindow.ce.ui" line="479"/> 456 <location filename="../ui/mainwindow.ui" line="492"/> 337 457 <source>&About...</source> 338 458 <translation type="unfinished"></translation> 339 459 </message> 340 460 <message> 341 <location filename="../ui/mainwindow.ce.ui" line="48 4"/>342 <location filename="../ui/mainwindow.ui" line="49 7"/>461 <location filename="../ui/mainwindow.ce.ui" line="482"/> 462 <location filename="../ui/mainwindow.ui" line="495"/> 343 463 <source>About...</source> 344 464 <translation type="unfinished"></translation> 345 465 </message> 346 466 <message> 347 <location filename="../ui/mainwindow.ce.ui" line="48 7"/>348 <location filename="../ui/mainwindow.ui" line=" 500"/>467 <location filename="../ui/mainwindow.ce.ui" line="485"/> 468 <location filename="../ui/mainwindow.ui" line="498"/> 349 469 <source>About application</source> 350 470 <translation type="unfinished"></translation> 351 471 </message> 352 472 <message> 353 <location filename="../ui/mainwindow.ce.ui" line="49 6"/>354 <location filename="../ui/mainwindow.ui" line="50 9"/>473 <location filename="../ui/mainwindow.ce.ui" line="494"/> 474 <location filename="../ui/mainwindow.ui" line="507"/> 355 475 <source>E&xit</source> 356 476 <translation type="unfinished"></translation> 357 477 </message> 358 478 <message> 359 <location filename="../ui/mainwindow.ce.ui" line="49 9"/>360 <location filename="../ui/mainwindow.ui" line="51 2"/>479 <location filename="../ui/mainwindow.ce.ui" line="497"/> 480 <location filename="../ui/mainwindow.ui" line="510"/> 361 481 <source>Exit application</source> 362 482 <translation type="unfinished"></translation> 363 483 </message> 364 484 <message> 365 <location filename="../ui/mainwindow.ce.ui" line="5 11"/>366 <location filename="../ui/mainwindow.ui" line="5 24"/>485 <location filename="../ui/mainwindow.ce.ui" line="506"/> 486 <location filename="../ui/mainwindow.ui" line="519"/> 367 487 <source>&Task...</source> 368 488 <translation type="unfinished"></translation> 369 489 </message> 370 490 <message> 371 <location filename="../ui/mainwindow.ce.ui" line="5 14"/>372 <location filename="../ui/mainwindow.ui" line="52 7"/>491 <location filename="../ui/mainwindow.ce.ui" line="509"/> 492 <location filename="../ui/mainwindow.ui" line="522"/> 373 493 <source>Task...</source> 374 494 <translation type="unfinished"></translation> 375 495 </message> 376 496 <message> 377 <location filename="../ui/mainwindow.ce.ui" line="517"/> 378 <location filename="../ui/mainwindow.ui" line="530"/> 497 <location filename="../ui/mainwindow.ce.ui" line="512"/> 498 <location filename="../ui/mainwindow.ce.ui" line="561"/> 499 <location filename="../ui/mainwindow.ui" line="525"/> 500 <location filename="../ui/mainwindow.ui" line="577"/> 379 501 <source>Save task</source> 380 502 <translation type="unfinished"></translation> 381 503 </message> 382 504 <message> 383 <location filename="../ui/mainwindow.ce.ui" line="5 20"/>384 <location filename="../ui/mainwindow.ui" line="5 33"/>505 <location filename="../ui/mainwindow.ce.ui" line="515"/> 506 <location filename="../ui/mainwindow.ui" line="528"/> 385 507 <source>Save task to file</source> 386 508 <translation type="unfinished"></translation> 387 509 </message> 388 510 <message> 389 <location filename="../ui/mainwindow.ce.ui" line="5 23"/>390 <location filename="../ui/mainwindow.ui" line="53 6"/>511 <location filename="../ui/mainwindow.ce.ui" line="518"/> 512 <location filename="../ui/mainwindow.ui" line="531"/> 391 513 <source>Ctrl+S</source> 392 514 <translation type="unfinished"></translation> 393 515 </message> 394 516 <message> 395 <location filename="../ui/mainwindow.ce.ui" line="5 34"/>396 <location filename="../ui/mainwindow.ui" line="54 7"/>517 <location filename="../ui/mainwindow.ce.ui" line="529"/> 518 <location filename="../ui/mainwindow.ui" line="542"/> 397 519 <source>&Autodetect</source> 398 520 <translation type="unfinished"></translation> 399 521 </message> 400 522 <message> 401 <location filename="../ui/mainwindow.ce.ui" line="5 51"/>523 <location filename="../ui/mainwindow.ce.ui" line="546"/> 402 524 <source>English</source> 403 525 <translation type="unfinished"></translation> 404 526 </message> 405 527 <message> 406 <location filename="../ui/mainwindow.ce.ui" line="286"/> 407 <location filename="../ui/mainwindow.ui" line="267"/> 528 <location filename="../ui/mainwindow.ce.ui" line="564"/> 529 <location filename="../ui/mainwindow.ui" line="580"/> 530 <source>Save current task</source> 531 <translation type="unfinished"></translation> 532 </message> 533 <message> 534 <location filename="../ui/mainwindow.ce.ui" line="287"/> 535 <location filename="../ui/mainwindow.ui" line="268"/> 408 536 <source>Select language</source> 409 537 <translation type="unfinished"></translation> 410 538 </message> 411 539 <message> 412 <location filename="../ui/mainwindow.ce.ui" line="2 89"/>413 <location filename="../ui/mainwindow.ui" line="27 0"/>540 <location filename="../ui/mainwindow.ce.ui" line="290"/> 541 <location filename="../ui/mainwindow.ui" line="271"/> 414 542 <source>Select application language</source> 415 543 <translation type="unfinished"></translation> 416 544 </message> 417 545 <message> 418 <location filename="../ui/mainwindow.ui" line="33 2"/>546 <location filename="../ui/mainwindow.ui" line="333"/> 419 547 <source>P&rint setup...</source> 420 548 <translation type="unfinished"></translation> 421 549 </message> 422 550 <message> 423 <location filename="../ui/mainwindow.ui" line="33 5"/>551 <location filename="../ui/mainwindow.ui" line="336"/> 424 552 <source>Setup printing</source> 425 553 <translation type="unfinished"></translation> 426 554 </message> 427 555 <message> 428 <location filename="../ui/mainwindow.ui" line="34 7"/>556 <location filename="../ui/mainwindow.ui" line="348"/> 429 557 <source>&Print...</source> 430 558 <translation type="unfinished"></translation> 431 559 </message> 432 560 <message> 433 <location filename="../ui/mainwindow.ui" line="35 0"/>561 <location filename="../ui/mainwindow.ui" line="351"/> 434 562 <source>Print solution results</source> 435 563 <translation type="unfinished"></translation> 436 564 </message> 437 565 <message> 438 <location filename="../ui/mainwindow.ui" line="35 3"/>566 <location filename="../ui/mainwindow.ui" line="354"/> 439 567 <source>Ctrl+P</source> 440 568 <translation type="unfinished"></translation> 441 569 </message> 442 570 <message> 443 <location filename="../ui/mainwindow.ce.ui" line="537"/> 444 <location filename="../ui/mainwindow.ui" line="550"/> 571 <location filename="../ui/mainwindow.ui" line="574"/> 572 <source>Save</source> 573 <translation type="unfinished"></translation> 574 </message> 575 <message> 576 <location filename="../ui/mainwindow.ce.ui" line="532"/> 577 <location filename="../ui/mainwindow.ui" line="545"/> 445 578 <source>Detect language automatically</source> 446 579 <translation type="unfinished"></translation> 447 580 </message> 448 581 <message> 449 <location filename="../ui/mainwindow.ce.ui" line="5 40"/>450 <location filename="../ui/mainwindow.ui" line="5 53"/>582 <location filename="../ui/mainwindow.ce.ui" line="535"/> 583 <location filename="../ui/mainwindow.ui" line="548"/> 451 584 <source>Detect language automatically based on regional settings</source> 452 585 <translation type="unfinished"></translation> -
trunk/i18n/ru.ts
r31 r35 16 16 </message> 17 17 <message> 18 <location filename="../src/tspmodel.cpp" line="165"/> 19 <location filename="../src/tspmodel.cpp" line="177"/> 20 <location filename="../src/tspmodel.cpp" line="203"/> 18 <location filename="../src/tspmodel.cpp" line="156"/> 19 <source>Unexpected end of file.</source> 20 <translation type="unfinished"></translation> 21 </message> 22 <message> 23 <location filename="../src/tspmodel.cpp" line="158"/> 24 <source>Corrupt data read. File possibly corrupted.</source> 25 <translation type="unfinished"></translation> 26 </message> 27 <message> 28 <location filename="../src/tspmodel.cpp" line="160"/> 29 <source>Unknown error.</source> 30 <translation>Неизвестная ошибка.</translation> 31 </message> 32 <message> 33 <location filename="../src/tspmodel.cpp" line="161"/> 34 <location filename="../src/tspmodel.cpp" line="169"/> 35 <location filename="../src/tspmodel.cpp" line="184"/> 36 <location filename="../src/tspmodel.cpp" line="200"/> 37 <location filename="../src/tspmodel.cpp" line="213"/> 38 <location filename="../src/tspmodel.cpp" line="243"/> 39 <location filename="../src/tspmodel.cpp" line="252"/> 21 40 <source>Task Load</source> 22 41 <translation>Загрузка задания</translation> 23 42 </message> 24 43 <message> 25 <location filename="../src/tspmodel.cpp" line="165"/> 26 <source>Unable to load task: 27 Unknown file format or file is corrupted.</source> 28 <translation>Невозможно загрузить задание: 29 Неизвестный формат файла или файл поврежден.</translation> 30 </message> 31 <message> 32 <location filename="../src/tspmodel.cpp" line="177"/> 33 <location filename="../src/tspmodel.cpp" line="203"/> 34 <source>Unable to load task: 35 File version is newer than application supports. 44 <location filename="../src/tspmodel.cpp" line="161"/> 45 <location filename="../src/tspmodel.cpp" line="184"/> 46 <location filename="../src/tspmodel.cpp" line="200"/> 47 <location filename="../src/tspmodel.cpp" line="213"/> 48 <location filename="../src/tspmodel.cpp" line="243"/> 49 <location filename="../src/tspmodel.cpp" line="252"/> 50 <source>Unable to load task:</source> 51 <translation>Невозможно загрузить задание:</translation> 52 </message> 53 <message> 54 <location filename="../src/tspmodel.cpp" line="169"/> 55 <source>Unable to open task file. 56 Error: %1</source> 57 <translation type="unfinished"></translation> 58 </message> 59 <message> 60 <location filename="../src/tspmodel.cpp" line="184"/> 61 <source>Unknown file format or file is corrupted.</source> 62 <translation>Неизвестный формат файла или файл поврежден.</translation> 63 </message> 64 <message> 65 <location filename="../src/tspmodel.cpp" line="200"/> 66 <location filename="../src/tspmodel.cpp" line="243"/> 67 <source>File version is newer than application supports. 36 68 Please, try to update application.</source> 37 <translation>Невозможно загрузить задание: 38 Версия файла новее чем поддерживаемая приложением. 69 <translation>Версия файла новее чем поддерживаемая приложением. 39 70 Пожалуйста, попробуйте обновить приложение.</translation> 71 </message> 72 <message> 73 <location filename="../src/tspmodel.cpp" line="213"/> 74 <location filename="../src/tspmodel.cpp" line="252"/> 75 <source>Unexpected data read. 76 File is possibly corrupted.</source> 77 <translation type="unfinished"></translation> 78 </message> 79 <message> 80 <location filename="../src/tspmodel.cpp" line="282"/> 81 <location filename="../src/tspmodel.cpp" line="288"/> 82 <location filename="../src/tspmodel.cpp" line="295"/> 83 <location filename="../src/tspmodel.cpp" line="302"/> 84 <location filename="../src/tspmodel.cpp" line="309"/> 85 <location filename="../src/tspmodel.cpp" line="316"/> 86 <location filename="../src/tspmodel.cpp" line="323"/> 87 <location filename="../src/tspmodel.cpp" line="333"/> 88 <source>Task Save</source> 89 <translation>Сохранение задачи</translation> 90 </message> 91 <message> 92 <location filename="../src/tspmodel.cpp" line="282"/> 93 <source>Unable to create task file. 94 Error: %1 95 Maybe, file is read-only?</source> 96 <translation type="unfinished"></translation> 97 </message> 98 <message> 99 <location filename="../src/tspmodel.cpp" line="288"/> 100 <location filename="../src/tspmodel.cpp" line="295"/> 101 <location filename="../src/tspmodel.cpp" line="302"/> 102 <location filename="../src/tspmodel.cpp" line="309"/> 103 <location filename="../src/tspmodel.cpp" line="316"/> 104 <location filename="../src/tspmodel.cpp" line="323"/> 105 <location filename="../src/tspmodel.cpp" line="333"/> 106 <source>Unable to save task. 107 Error: %1</source> 108 <translation>Невозможно сохранить задание. 109 Ошибка: %1</translation> 40 110 </message> 41 111 </context> … … 44 114 <message> 45 115 <location filename="../src/mainwindow.cpp" line="124"/> 46 <location filename="../src/mainwindow.cpp" line="2 79"/>47 <location filename="../src/mainwindow.cpp" line=" 288"/>116 <location filename="../src/mainwindow.cpp" line="292"/> 117 <location filename="../src/mainwindow.cpp" line="301"/> 48 118 <source>Language change</source> 49 119 <translation>Смена языка</translation> … … 58 128 <source>All Supported Formats</source> 59 129 <translation>Все поддерживаемые форматы</translation> 60 </message>61 <message>62 <source>TSPSG Task Files</source>63 <translation type="obsolete">Файлы задачи TSPSG</translation>64 </message>65 <message>66 <source>ZKomModRd Task Files</source>67 <translation type="obsolete">Файлы задачи ZKomModRd</translation>68 130 </message> 69 131 <message> … … 74 136 </message> 75 137 <message> 76 <source>TSPSG Task File</source>77 <translation type="obsolete">Файл задачи TSPSG</translation>78 </message>79 <message>80 138 <location filename="../src/mainwindow.cpp" line="160"/> 81 139 <location filename="../src/mainwindow.cpp" line="161"/> … … 89 147 </message> 90 148 <message> 91 <location filename="../src/mainwindow.cpp" line="22 5"/>149 <location filename="../src/mainwindow.cpp" line="228"/> 92 150 <source>Data error</source> 93 151 <translation>Ошибка в данных</translation> 94 152 </message> 95 153 <message> 96 <location filename="../src/mainwindow.cpp" line="22 5"/>154 <location filename="../src/mainwindow.cpp" line="228"/> 97 155 <source>Error in cell [Row %1; Column %2]: Invalid data format.</source> 98 156 <translation>Ошибка в ячейке [Строка %1; Колонка %2]: Неверный формат данных.</translation> 99 157 </message> 100 158 <message> 101 <location filename="../src/mainwindow.cpp" line="23 4"/>159 <location filename="../src/mainwindow.cpp" line="237"/> 102 160 <source>Solution error</source> 103 161 <translation>Ошибка при решении</translation> 104 162 </message> 105 163 <message> 106 <location filename="../src/mainwindow.cpp" line="23 4"/>164 <location filename="../src/mainwindow.cpp" line="237"/> 107 165 <source>There was an error while solving the task.</source> 108 166 <translation>Во время решения задачи возникла ошибка.</translation> 109 167 </message> 110 168 <message> 111 <location filename="../src/mainwindow.cpp" line="2 79"/>169 <location filename="../src/mainwindow.cpp" line="292"/> 112 170 <source>Language will be autodetected on next application start.</source> 113 171 <translation>Язык будет автоматически определен при следующем запуске приложения.</translation> 114 172 </message> 115 173 <message> 116 <location filename="../src/mainwindow.cpp" line=" 288"/>174 <location filename="../src/mainwindow.cpp" line="301"/> 117 175 <source>You have language autodetection turned on. 118 176 It needs to be off. -
trunk/i18n/uk.ts
r31 r35 16 16 </message> 17 17 <message> 18 <location filename="../src/tspmodel.cpp" line="165"/> 19 <location filename="../src/tspmodel.cpp" line="177"/> 20 <location filename="../src/tspmodel.cpp" line="203"/> 18 <location filename="../src/tspmodel.cpp" line="156"/> 19 <source>Unexpected end of file.</source> 20 <translation type="unfinished"></translation> 21 </message> 22 <message> 23 <location filename="../src/tspmodel.cpp" line="158"/> 24 <source>Corrupt data read. File possibly corrupted.</source> 25 <translation type="unfinished"></translation> 26 </message> 27 <message> 28 <location filename="../src/tspmodel.cpp" line="160"/> 29 <source>Unknown error.</source> 30 <translation>Невідома помилка.</translation> 31 </message> 32 <message> 33 <location filename="../src/tspmodel.cpp" line="161"/> 34 <location filename="../src/tspmodel.cpp" line="169"/> 35 <location filename="../src/tspmodel.cpp" line="184"/> 36 <location filename="../src/tspmodel.cpp" line="200"/> 37 <location filename="../src/tspmodel.cpp" line="213"/> 38 <location filename="../src/tspmodel.cpp" line="243"/> 39 <location filename="../src/tspmodel.cpp" line="252"/> 21 40 <source>Task Load</source> 22 41 <translation>Завантаження завдання</translation> 23 42 </message> 24 43 <message> 25 <location filename="../src/tspmodel.cpp" line="165"/> 26 <source>Unable to load task: 27 Unknown file format or file is corrupted.</source> 28 <translation>Неможливо завантажити завдання: 29 Невідомий формат файлу або файл пошкоджено.</translation> 30 </message> 31 <message> 32 <location filename="../src/tspmodel.cpp" line="177"/> 33 <location filename="../src/tspmodel.cpp" line="203"/> 34 <source>Unable to load task: 35 File version is newer than application supports. 44 <location filename="../src/tspmodel.cpp" line="161"/> 45 <location filename="../src/tspmodel.cpp" line="184"/> 46 <location filename="../src/tspmodel.cpp" line="200"/> 47 <location filename="../src/tspmodel.cpp" line="213"/> 48 <location filename="../src/tspmodel.cpp" line="243"/> 49 <location filename="../src/tspmodel.cpp" line="252"/> 50 <source>Unable to load task:</source> 51 <translation>Неможливо завантажити завдання:</translation> 52 </message> 53 <message> 54 <location filename="../src/tspmodel.cpp" line="169"/> 55 <source>Unable to open task file. 56 Error: %1</source> 57 <translation type="unfinished"></translation> 58 </message> 59 <message> 60 <location filename="../src/tspmodel.cpp" line="184"/> 61 <source>Unknown file format or file is corrupted.</source> 62 <translation>Невідомий формат файлу або файл пошкоджено.</translation> 63 </message> 64 <message> 65 <location filename="../src/tspmodel.cpp" line="200"/> 66 <location filename="../src/tspmodel.cpp" line="243"/> 67 <source>File version is newer than application supports. 36 68 Please, try to update application.</source> 37 <translation>Неможливо завантажити завдання: 38 Версія файлу новіша ніж підримувана додатком. 69 <translation>Версія файлу новіша ніж підримувана додатком. 39 70 Будь-ласка, спробуйте оновити додаток.</translation> 71 </message> 72 <message> 73 <location filename="../src/tspmodel.cpp" line="213"/> 74 <location filename="../src/tspmodel.cpp" line="252"/> 75 <source>Unexpected data read. 76 File is possibly corrupted.</source> 77 <translation type="unfinished"></translation> 78 </message> 79 <message> 80 <location filename="../src/tspmodel.cpp" line="282"/> 81 <location filename="../src/tspmodel.cpp" line="288"/> 82 <location filename="../src/tspmodel.cpp" line="295"/> 83 <location filename="../src/tspmodel.cpp" line="302"/> 84 <location filename="../src/tspmodel.cpp" line="309"/> 85 <location filename="../src/tspmodel.cpp" line="316"/> 86 <location filename="../src/tspmodel.cpp" line="323"/> 87 <location filename="../src/tspmodel.cpp" line="333"/> 88 <source>Task Save</source> 89 <translation>Збереження завдання</translation> 90 </message> 91 <message> 92 <location filename="../src/tspmodel.cpp" line="282"/> 93 <source>Unable to create task file. 94 Error: %1 95 Maybe, file is read-only?</source> 96 <translation type="unfinished"></translation> 97 </message> 98 <message> 99 <location filename="../src/tspmodel.cpp" line="288"/> 100 <location filename="../src/tspmodel.cpp" line="295"/> 101 <location filename="../src/tspmodel.cpp" line="302"/> 102 <location filename="../src/tspmodel.cpp" line="309"/> 103 <location filename="../src/tspmodel.cpp" line="316"/> 104 <location filename="../src/tspmodel.cpp" line="323"/> 105 <location filename="../src/tspmodel.cpp" line="333"/> 106 <source>Unable to save task. 107 Error: %1</source> 108 <translation>Неможливо зберегти завдання. 109 Помилка: %1</translation> 40 110 </message> 41 111 </context> … … 453 523 <message> 454 524 <location filename="../src/mainwindow.cpp" line="124"/> 455 <location filename="../src/mainwindow.cpp" line="2 79"/>456 <location filename="../src/mainwindow.cpp" line=" 288"/>525 <location filename="../src/mainwindow.cpp" line="292"/> 526 <location filename="../src/mainwindow.cpp" line="301"/> 457 527 <source>Language change</source> 458 528 <translation>Зміна мови</translation> … … 467 537 <source>All Supported Formats</source> 468 538 <translation>Усі підтримувані формати</translation> 469 </message>470 <message>471 <source>TSPSG Task Files</source>472 <translation type="obsolete">Файли завдання TSPSG</translation>473 </message>474 <message>475 <source>ZKomModRd Task Files</source>476 <translation type="obsolete">Файли завдання ZKomModRd</translation>477 539 </message> 478 540 <message> … … 483 545 </message> 484 546 <message> 485 <source>TSPSG Task File</source>486 <translation type="obsolete">Файл завдання TSPSG</translation>487 </message>488 <message>489 547 <location filename="../src/mainwindow.cpp" line="160"/> 490 548 <location filename="../src/mainwindow.cpp" line="161"/> … … 498 556 </message> 499 557 <message> 500 <location filename="../src/mainwindow.cpp" line="22 5"/>558 <location filename="../src/mainwindow.cpp" line="228"/> 501 559 <source>Data error</source> 502 560 <translation>Помилка даних</translation> 503 561 </message> 504 562 <message> 505 <location filename="../src/mainwindow.cpp" line="22 5"/>563 <location filename="../src/mainwindow.cpp" line="228"/> 506 564 <source>Error in cell [Row %1; Column %2]: Invalid data format.</source> 507 565 <translation>Помилка у комірці [Рядок %1; Колонка %2]: Невірний формат даних.</translation> 508 566 </message> 509 567 <message> 510 <location filename="../src/mainwindow.cpp" line="23 4"/>568 <location filename="../src/mainwindow.cpp" line="237"/> 511 569 <source>Solution error</source> 512 570 <translation>Помилка розв'язку</translation> 513 571 </message> 514 572 <message> 515 <location filename="../src/mainwindow.cpp" line="23 4"/>573 <location filename="../src/mainwindow.cpp" line="237"/> 516 574 <source>There was an error while solving the task.</source> 517 575 <translation>Під час розв'язання задачі виникла помилка.</translation> 518 576 </message> 519 577 <message> 520 <location filename="../src/mainwindow.cpp" line="2 79"/>578 <location filename="../src/mainwindow.cpp" line="292"/> 521 579 <source>Language will be autodetected on next application start.</source> 522 580 <translation>Мову буде автоматично визначено при наступному запуску додатку.</translation> 523 581 </message> 524 582 <message> 525 <location filename="../src/mainwindow.cpp" line=" 288"/>583 <location filename="../src/mainwindow.cpp" line="301"/> 526 584 <source>You have language autodetection turned on. 527 585 It needs to be off. -
trunk/src/main.cpp
r33 r35 23 23 24 24 #include "mainwindow.h" 25 #if QT_VERSION < 0x040500 26 #ifdef _MSC_VER 27 #pragma message("WARNING: You are using Qt version < 4.5. Application will not support some non-critical features.") 28 #elif (defined(__GNUC__) || defined(__MINGW32__)) 29 #warning "WARNING: You are using Qt version < 4.5. Application will not support some non-critical features." 30 #endif 31 #endif 25 32 26 33 int main(int argc, char *argv[]) -
trunk/src/tspmodel.cpp
r34 r35 30 30 } 31 31 32 in t CTSPModel::rand(int min, int max)32 inline int CTSPModel::rand(int min, int max) const 33 33 { 34 34 return min + (int)(((float)qrand() / RAND_MAX) * max); 35 35 } 36 36 37 in t CTSPModel::rowCount(const QModelIndex &) const37 inline int CTSPModel::rowCount(const QModelIndex &) const 38 38 { 39 39 return nCities; 40 40 } 41 41 42 in t CTSPModel::columnCount(const QModelIndex &) const42 inline int CTSPModel::columnCount(const QModelIndex &) const 43 43 { 44 44 return nCities; … … 116 116 void CTSPModel::setNumCities(int n) 117 117 { 118 // int randMin = settings->value("MinCost",DEF_RAND_MIN).toInt();119 // int randMax = settings->value("MaxCost",DEF_RAND_MAX).toInt();120 118 if (n == nCities) 121 119 return; … … 127 125 table[r][c] = INFINITY; 128 126 else 129 table[r][c] = 0; // rand(randMin,randMax);127 table[r][c] = 0; 130 128 } 131 129 for (int r = nCities; r < n; r++) { … … 134 132 table[r][c] = INFINITY; 135 133 else 136 table[r][c] = 0; // rand(randMin,randMax);134 table[r][c] = 0; 137 135 } 138 136 } … … 150 148 } 151 149 150 inline bool CTSPModel::loadError(QDataStream::Status status) const 151 { 152 QString err; 153 if (status == QDataStream::Ok) 154 return false; 155 else if (status == QDataStream::ReadPastEnd) 156 err = trUtf8("Unexpected end of file."); 157 else if (status == QDataStream::ReadCorruptData) 158 err = trUtf8("Corrupt data read. File possibly corrupted."); 159 else 160 err = trUtf8("Unknown error."); 161 QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + err,QMessageBox::Ok).exec(); 162 return true; 163 } 164 152 165 void CTSPModel::loadTask(QString fname) 153 166 { 154 167 QFile f(fname); 155 f.open(QIODevice::ReadOnly); 168 if (!f.open(QIODevice::ReadOnly)) { 169 QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),QString(trUtf8("Unable to open task file.\nError: %1")).arg(f.errorString()),QMessageBox::Ok).exec(); 170 return; 171 } 156 172 QDataStream ds(&f); 157 173 ds.setVersion(QDataStream::Qt_4_4); 158 174 quint32 sig; 159 175 ds >> sig; 176 if (loadError(ds.status())) 177 return; 160 178 ds.device()->reset(); 161 179 if (sig == TSPT) … … 164 182 loadZKT(&ds); 165 183 else 166 QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task: \nUnknown file format or file is corrupted."),QMessageBox::Ok).exec();184 QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unknown file format or file is corrupted."),QMessageBox::Ok).exec(); 167 185 f.close(); 168 186 } … … 172 190 // Skipping signature 173 191 ds->skipRawData(sizeof(TSPT)); 192 if (loadError(ds->status())) 193 return; 174 194 // File version 175 195 quint8 version; 176 196 *ds >> version; 197 if (loadError(ds->status())) 198 return; 177 199 if (version > TSPT_VERSION) { 178 QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task: \nFile version is newer than application supports.\nPlease, try to update application."),QMessageBox::Ok).exec();200 QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("File version is newer than application supports.\nPlease, try to update application."),QMessageBox::Ok).exec(); 179 201 return; 180 202 } 181 203 // Skipping metadata 182 204 ds->skipRawData(TSPT_META_SIZE); 205 if (loadError(ds->status())) 206 return; 183 207 // Cities number 184 208 quint16 size; 185 209 *ds >> size; 210 if (loadError(ds->status())) 211 return; 212 if (size < 3) { 213 QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unexpected data read.\nFile is possibly corrupted."),QMessageBox::Ok).exec(); 214 return; 215 } 186 216 if (nCities != size) 187 217 emit numCitiesChanged(size); … … 189 219 for (int r = 0; r < size; r++) 190 220 for (int c = 0; c < size; c++) 191 if (r != c) 221 if (r != c) { 192 222 *ds >> table[r][c]; 223 if (loadError(ds->status())) { 224 clear(); 225 return; 226 } 227 } 193 228 emit dataChanged(index(0,0),index(nCities - 1,nCities - 1)); 194 229 } … … 198 233 // Skipping signature 199 234 ds->skipRawData(sizeof(ZKT)); 235 if (loadError(ds->status())) 236 return; 200 237 // File version 201 238 quint16 version; 202 239 ds->readRawData(reinterpret_cast<char *>(&version),2); 240 if (loadError(ds->status())) 241 return; 203 242 if (version > ZKT_VERSION) { 204 QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task: \nFile version is newer than application supports.\nPlease, try to update application."),QMessageBox::Ok).exec();243 QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("File version is newer than application supports.\nPlease, try to update application."),QMessageBox::Ok).exec(); 205 244 return; 206 245 } … … 208 247 quint8 size; 209 248 ds->readRawData(reinterpret_cast<char *>(&size),1); 249 if (loadError(ds->status())) 250 return; 251 if ((size < 3) || (size > 5)) { 252 QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unexpected data read.\nFile is possibly corrupted."),QMessageBox::Ok).exec(); 253 return; 254 } 210 255 if (nCities != size) 211 256 emit numCitiesChanged(size); … … 216 261 if (r != c) { 217 262 ds->readRawData(reinterpret_cast<char *>(&val),8); 263 if (loadError(ds->status())) { 264 clear(); 265 return; 266 } 218 267 table[r][c] = val; 219 } else 268 } else { 220 269 ds->skipRawData(8); 270 if (loadError(ds->status())) { 271 clear(); 272 return; 273 } 274 } 221 275 emit dataChanged(index(0,0),index(nCities - 1,nCities - 1)); 222 276 } … … 225 279 { 226 280 QFile f(fname); 227 f.open(QIODevice::WriteOnly); 281 if (!f.open(QIODevice::WriteOnly)) { 282 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),QString(trUtf8("Unable to create task file.\nError: %1\nMaybe, file is read-only?")).arg(f.errorString()),QMessageBox::Ok).exec(); 283 return; 284 } 228 285 QDataStream ds(&f); 229 286 ds.setVersion(QDataStream::Qt_4_4); 287 if (f.error() != QFile::NoError) { 288 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 289 f.close(); 290 return; 291 } 230 292 // File signature 231 293 ds << TSPT; 294 if (f.error() != QFile::NoError) { 295 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 296 f.close(); 297 return; 298 } 232 299 // File version 233 300 ds << TSPT_VERSION; 301 if (f.error() != QFile::NoError) { 302 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 303 f.close(); 304 return; 305 } 234 306 // File metadata version 235 307 ds << TSPT_META_VERSION; 308 if (f.error() != QFile::NoError) { 309 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 310 f.close(); 311 return; 312 } 236 313 // Metadata 237 314 ds << OSID; 315 if (f.error() != QFile::NoError) { 316 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 317 f.close(); 318 return; 319 } 238 320 // Number of cities 239 321 ds << nCities; 322 if (f.error() != QFile::NoError) { 323 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 324 f.close(); 325 return; 326 } 240 327 // Costs 241 328 for (int r = 0; r < nCities; r++) 242 329 for (int c = 0; c < nCities; c++) 243 if (r != c) 330 if (r != c) { 244 331 ds << table[r][c]; 332 if (f.error() != QFile::NoError) { 333 QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec(); 334 f.close(); 335 return; 336 } 337 } 245 338 f.close(); 246 339 } -
trunk/src/tspmodel.h
r31 r35 50 50 double table[MAX_CITIES][MAX_CITIES]; 51 51 quint16 nCities; 52 int rand(int, int); 52 int rand(int, int) const; 53 bool loadError(QDataStream::Status) const; 53 54 void loadZKT(QDataStream *); 54 55 void loadTSPT(QDataStream *);
Note: See TracChangeset
for help on using the changeset viewer.