- Timestamp:
- Jan 7, 2010, 2:24:18 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/i18n/en.ts
r80 r81 153 153 </message> 154 154 <message> 155 <location filename="../src/mainwindow.cpp" line="6 27"/>155 <location filename="../src/mainwindow.cpp" line="632"/> 156 156 <source>Unable to load translation language.</source> 157 157 <translation type="unfinished"></translation> 158 158 </message> 159 159 <message> 160 <location filename="../src/mainwindow.cpp" line="6 37"/>160 <location filename="../src/mainwindow.cpp" line="642"/> 161 161 <source>Would you like to save changes in current task?</source> 162 162 <translation type="unfinished"></translation> … … 164 164 <message> 165 165 <location filename="../ui/mainwindow.ui" line="15"/> 166 <location filename="../src/mainwindow.cpp" line="7 46"/>166 <location filename="../src/mainwindow.cpp" line="751"/> 167 167 <source>Travelling Salesman Problem</source> 168 168 <translation type="unfinished"></translation> 169 169 </message> 170 170 <message> 171 <location filename="../src/mainwindow.cpp" line="6 27"/>171 <location filename="../src/mainwindow.cpp" line="632"/> 172 172 <source>Language Change</source> 173 173 <translation type="unfinished"></translation> 174 174 </message> 175 175 <message> 176 <location filename="../src/mainwindow.cpp" line="6 37"/>176 <location filename="../src/mainwindow.cpp" line="642"/> 177 177 <source>Unsaved Changes</source> 178 178 <translation type="unfinished"></translation> … … 192 192 <location filename="../src/mainwindow.cpp" line="129"/> 193 193 <location filename="../src/mainwindow.cpp" line="188"/> 194 <location filename="../src/mainwindow.cpp" line="72 0"/>194 <location filename="../src/mainwindow.cpp" line="725"/> 195 195 <source>All Files</source> 196 196 <translation type="unfinished"></translation> … … 231 231 </message> 232 232 <message numerus="yes"> 233 <location filename="../src/mainwindow.cpp" line="45 2"/>233 <location filename="../src/mainwindow.cpp" line="453"/> 234 234 <source>The price is <b>%n</b> unit(s).</source> 235 235 <translation> … … 239 239 </message> 240 240 <message> 241 <location filename="../src/mainwindow.cpp" line="7 19"/>241 <location filename="../src/mainwindow.cpp" line="724"/> 242 242 <source>%1 Task File</source> 243 243 <translation type="unfinished"></translation> … … 287 287 <message> 288 288 <location filename="../src/mainwindow.cpp" line="416"/> 289 <location filename="../src/mainwindow.cpp" line="46 0"/>289 <location filename="../src/mainwindow.cpp" line="463"/> 290 290 <source>Solution of Variant #%1 task</source> 291 291 <translation type="unfinished"></translation> … … 308 308 <message> 309 309 <location filename="../src/mainwindow.cpp" line="455"/> 310 <source>The price is <b>%1</b> units.</source> 311 <translation type="unfinished"></translation> 312 </message> 313 <message> 314 <location filename="../src/mainwindow.cpp" line="458"/> 310 315 <source><b>WARNING!!!</b><br>This result is a record, but it may not be optimal.<br>Iterations need to be continued to check whether this result is optimal or get an optimal one.</source> 311 316 <translation type="unfinished"></translation> 312 317 </message> 313 318 <message> 314 <location filename="../src/mainwindow.cpp" line="7 28"/>315 <location filename="../src/mainwindow.cpp" line="73 0"/>319 <location filename="../src/mainwindow.cpp" line="733"/> 320 <location filename="../src/mainwindow.cpp" line="735"/> 316 321 <source>Task Save</source> 317 322 <translation type="unfinished"></translation> … … 606 611 </message> 607 612 <message> 608 <location filename="../src/mainwindow.cpp" line="7 07"/>613 <location filename="../src/mainwindow.cpp" line="712"/> 609 614 <source>&Print...</source> 610 615 <translation type="unfinished"></translation> 611 616 </message> 612 617 <message> 613 <location filename="../src/mainwindow.cpp" line="71 4"/>618 <location filename="../src/mainwindow.cpp" line="719"/> 614 619 <source>Ctrl+P</source> 615 620 <translation type="unfinished"></translation> … … 631 636 </message> 632 637 <message> 633 <location filename="../src/mainwindow.cpp" line=" 699"/>638 <location filename="../src/mainwindow.cpp" line="704"/> 634 639 <source>P&rint Preview...</source> 635 640 <translation type="unfinished"></translation> 636 641 </message> 637 642 <message> 638 <location filename="../src/mainwindow.cpp" line="70 1"/>643 <location filename="../src/mainwindow.cpp" line="706"/> 639 644 <source>Preview solution results</source> 640 645 <translation type="unfinished"></translation> 641 646 </message> 642 647 <message> 643 <location filename="../src/mainwindow.cpp" line="70 4"/>648 <location filename="../src/mainwindow.cpp" line="709"/> 644 649 <source>Preview current solution results before printing</source> 645 650 <translation type="unfinished"></translation> 646 651 </message> 647 652 <message> 648 <location filename="../src/mainwindow.cpp" line="7 09"/>653 <location filename="../src/mainwindow.cpp" line="714"/> 649 654 <source>Print solution</source> 650 655 <translation type="unfinished"></translation> 651 656 </message> 652 657 <message> 653 <location filename="../src/mainwindow.cpp" line="71 2"/>658 <location filename="../src/mainwindow.cpp" line="717"/> 654 659 <source>Print current solution results</source> 655 660 <translation type="unfinished"></translation> … … 730 735 <message> 731 736 <location filename="../ui/settingsdialog.ui" line="283"/> 732 <source>Use the number of cities in task to determine whether to show solution steps' matrices</source> 737 <source>Show or hide solution steps' matrices based on number of cities in the task</source> 738 <translation type="unfinished"></translation> 739 </message> 740 <message> 741 <location filename="../ui/settingsdialog.ui" line="305"/> 742 <source>Generate fractional random values with the accuracy of 2 decimal places</source> 743 <translation type="unfinished"></translation> 744 </message> 745 <message> 746 <location filename="../ui/settingsdialog.ui" line="308"/> 747 <source>Fractional random values</source> 748 <translation type="unfinished"></translation> 749 </message> 750 <message> 751 <location filename="../ui/settingsdialog.ui" line="316"/> 752 <source>Scroll to the end of solution output after solving</source> 753 <translation type="unfinished"></translation> 754 </message> 755 <message> 756 <location filename="../ui/settingsdialog.ui" line="319"/> 757 <source>Scroll to solution end</source> 733 758 <translation type="unfinished"></translation> 734 759 </message> … … 781 806 </message> 782 807 <message> 783 <location filename="../src/settingsdialog.cpp" line="9 7"/>808 <location filename="../src/settingsdialog.cpp" line="99"/> 784 809 <source>Restore main window state and position on application restart</source> 785 810 <translation type="unfinished"></translation> 786 811 </message> 787 812 <message> 788 <location filename="../src/settingsdialog.cpp" line=" 99"/>813 <location filename="../src/settingsdialog.cpp" line="101"/> 789 814 <source>Save main window state and position</source> 790 815 <translation type="unfinished"></translation> 791 816 </message> 792 817 <message> 793 <location filename="../src/settingsdialog.cpp" line="12 2"/>818 <location filename="../src/settingsdialog.cpp" line="124"/> 794 819 <source>Hover mouse pointer over dialog elements to get additional help</source> 795 820 <translation type="unfinished"></translation> -
trunk/i18n/ru.ts
r80 r81 161 161 </message> 162 162 <message> 163 <location filename="../src/mainwindow.cpp" line="6 27"/>163 <location filename="../src/mainwindow.cpp" line="632"/> 164 164 <source>Unable to load translation language.</source> 165 165 <translation>Невозможно загрузить перевод.</translation> … … 167 167 <message> 168 168 <location filename="../ui/mainwindow.ui" line="15"/> 169 <location filename="../src/mainwindow.cpp" line="7 46"/>169 <location filename="../src/mainwindow.cpp" line="751"/> 170 170 <source>Travelling Salesman Problem</source> 171 171 <translation>Задача коммивояжера</translation> 172 172 </message> 173 173 <message> 174 <location filename="../src/mainwindow.cpp" line="6 37"/>174 <location filename="../src/mainwindow.cpp" line="642"/> 175 175 <source>Unsaved Changes</source> 176 176 <translation>Несохраненные изменения</translation> … … 184 184 <location filename="../src/mainwindow.cpp" line="129"/> 185 185 <location filename="../src/mainwindow.cpp" line="188"/> 186 <location filename="../src/mainwindow.cpp" line="72 0"/>186 <location filename="../src/mainwindow.cpp" line="725"/> 187 187 <source>All Files</source> 188 188 <translation>Все файлы</translation> … … 195 195 </message> 196 196 <message> 197 <location filename="../src/mainwindow.cpp" line="6 27"/>197 <location filename="../src/mainwindow.cpp" line="632"/> 198 198 <source>Language Change</source> 199 199 <translation>Смена языка</translation> 200 200 </message> 201 201 <message> 202 <location filename="../src/mainwindow.cpp" line="6 37"/>202 <location filename="../src/mainwindow.cpp" line="642"/> 203 203 <source>Would you like to save changes in current task?</source> 204 204 <translation>Желаете сохранить изменения в текущей задаче?</translation> … … 240 240 </message> 241 241 <message numerus="yes"> 242 <location filename="../src/mainwindow.cpp" line="45 2"/>242 <location filename="../src/mainwindow.cpp" line="453"/> 243 243 <source>The price is <b>%n</b> unit(s).</source> 244 244 <translation> … … 249 249 </message> 250 250 <message> 251 <location filename="../src/mainwindow.cpp" line="7 19"/>251 <location filename="../src/mainwindow.cpp" line="724"/> 252 252 <source>%1 Task File</source> 253 253 <translation>Файл условия %1</translation> … … 298 298 <message> 299 299 <location filename="../src/mainwindow.cpp" line="416"/> 300 <location filename="../src/mainwindow.cpp" line="46 0"/>300 <location filename="../src/mainwindow.cpp" line="463"/> 301 301 <source>Solution of Variant #%1 task</source> 302 302 <translation>Решение варианта №%1</translation> … … 319 319 <message> 320 320 <location filename="../src/mainwindow.cpp" line="455"/> 321 <source>The price is <b>%1</b> units.</source> 322 <translation>Стоимость - <b>%1</b> единиц.</translation> 323 </message> 324 <message> 325 <location filename="../src/mainwindow.cpp" line="458"/> 321 326 <source><b>WARNING!!!</b><br>This result is a record, but it may not be optimal.<br>Iterations need to be continued to check whether this result is optimal or get an optimal one.</source> 322 327 <translation><b>ВНИМАНИЕ!!!</b><br>Найденное решение является рекордом, но может оказаться не оптимальным.<br>Для получения оптимального решения, или проверки текущего на оптимальность, требуется продолжить итерации.</translation> 323 328 </message> 324 329 <message> 325 <location filename="../src/mainwindow.cpp" line="7 28"/>326 <location filename="../src/mainwindow.cpp" line="73 0"/>330 <location filename="../src/mainwindow.cpp" line="733"/> 331 <location filename="../src/mainwindow.cpp" line="735"/> 327 332 <source>Task Save</source> 328 333 <translation>Сохранение условия</translation> … … 624 629 </message> 625 630 <message> 626 <location filename="../src/mainwindow.cpp" line=" 699"/>631 <location filename="../src/mainwindow.cpp" line="704"/> 627 632 <source>P&rint Preview...</source> 628 633 <translation>П&редварительный просмотр...</translation> 629 634 </message> 630 635 <message> 631 <location filename="../src/mainwindow.cpp" line="70 1"/>636 <location filename="../src/mainwindow.cpp" line="706"/> 632 637 <source>Preview solution results</source> 633 638 <translation>Предварительный просмотр результатов решения</translation> 634 639 </message> 635 640 <message> 636 <location filename="../src/mainwindow.cpp" line="70 4"/>641 <location filename="../src/mainwindow.cpp" line="709"/> 637 642 <source>Preview current solution results before printing</source> 638 643 <translation>Предварительный просмотр результатов решения перед печатью</translation> 639 644 </message> 640 645 <message> 641 <location filename="../src/mainwindow.cpp" line="7 07"/>646 <location filename="../src/mainwindow.cpp" line="712"/> 642 647 <source>&Print...</source> 643 648 <translation>&Печать...</translation> 644 649 </message> 645 650 <message> 646 <location filename="../src/mainwindow.cpp" line="7 09"/>651 <location filename="../src/mainwindow.cpp" line="714"/> 647 652 <source>Print solution</source> 648 653 <translation>Печать решения</translation> 649 654 </message> 650 655 <message> 651 <location filename="../src/mainwindow.cpp" line="71 2"/>656 <location filename="../src/mainwindow.cpp" line="717"/> 652 657 <source>Print current solution results</source> 653 658 <translation>Распечатать текущие результаты решения</translation> 654 659 </message> 655 660 <message> 656 <location filename="../src/mainwindow.cpp" line="71 4"/>661 <location filename="../src/mainwindow.cpp" line="719"/> 657 662 <source>Ctrl+P</source> 658 663 <translation></translation> … … 743 748 <message> 744 749 <location filename="../ui/settingsdialog.ui" line="283"/> 745 <source> Use the number of cities in task to determine whether to show solution steps' matrices</source>750 <source>Show or hide solution steps' matrices based on number of cities in the task</source> 746 751 <translation>Показывать матрицы хода решения в зависимости от количества городов в задаче</translation> 752 </message> 753 <message> 754 <location filename="../ui/settingsdialog.ui" line="305"/> 755 <source>Generate fractional random values with the accuracy of 2 decimal places</source> 756 <translation>Генерировать дробные случайные числа с точностью до 2-о знака</translation> 757 </message> 758 <message> 759 <location filename="../ui/settingsdialog.ui" line="308"/> 760 <source>Fractional random values</source> 761 <translation>Дробные случайные числа</translation> 762 </message> 763 <message> 764 <location filename="../ui/settingsdialog.ui" line="316"/> 765 <source>Scroll to the end of solution output after solving</source> 766 <translation>Прокручивать в конец вывода после окончания решения задачи</translation> 767 </message> 768 <message> 769 <location filename="../ui/settingsdialog.ui" line="319"/> 770 <source>Scroll to solution end</source> 771 <translation>Прокручивать в конец</translation> 747 772 </message> 748 773 <message> … … 794 819 </message> 795 820 <message> 796 <location filename="../src/settingsdialog.cpp" line="9 7"/>821 <location filename="../src/settingsdialog.cpp" line="99"/> 797 822 <source>Restore main window state and position on application restart</source> 798 823 <translation>Восстанавливать состояние и размеры главного окна после перезапуска приложения</translation> 799 824 </message> 800 825 <message> 801 <location filename="../src/settingsdialog.cpp" line=" 99"/>826 <location filename="../src/settingsdialog.cpp" line="101"/> 802 827 <source>Save main window state and position</source> 803 828 <translation>Сохранять состояние и положение главного окна</translation> 804 829 </message> 805 830 <message> 806 <location filename="../src/settingsdialog.cpp" line="12 2"/>831 <location filename="../src/settingsdialog.cpp" line="124"/> 807 832 <source>Hover mouse pointer over dialog elements to get additional help</source> 808 833 <translation>Наведите указатель мыши на элемент диалога, чтоб получить подсказку</translation> -
trunk/i18n/uk.ts
r80 r81 185 185 </message> 186 186 <message> 187 <location filename="../src/mainwindow.cpp" line=" 699"/>187 <location filename="../src/mainwindow.cpp" line="704"/> 188 188 <source>P&rint Preview...</source> 189 189 <translation>&Попередній перегляд...</translation> 190 190 </message> 191 191 <message> 192 <location filename="../src/mainwindow.cpp" line="70 1"/>192 <location filename="../src/mainwindow.cpp" line="706"/> 193 193 <source>Preview solution results</source> 194 194 <translation>Попередній перегляд результатів розв'язку</translation> 195 195 </message> 196 196 <message> 197 <location filename="../src/mainwindow.cpp" line="70 4"/>197 <location filename="../src/mainwindow.cpp" line="709"/> 198 198 <source>Preview current solution results before printing</source> 199 199 <translation>Попередній перегляд результатів розв'язку перед друком</translation> 200 200 </message> 201 201 <message> 202 <location filename="../src/mainwindow.cpp" line="7 07"/>202 <location filename="../src/mainwindow.cpp" line="712"/> 203 203 <source>&Print...</source> 204 204 <translation>&Друк...</translation> 205 205 </message> 206 206 <message> 207 <location filename="../src/mainwindow.cpp" line="7 09"/>207 <location filename="../src/mainwindow.cpp" line="714"/> 208 208 <source>Print solution</source> 209 209 <translation>Друк розв'зку</translation> 210 210 </message> 211 211 <message> 212 <location filename="../src/mainwindow.cpp" line="71 2"/>212 <location filename="../src/mainwindow.cpp" line="717"/> 213 213 <source>Print current solution results</source> 214 214 <translation>Роздрукувати поточний результат розв'язку</translation> 215 215 </message> 216 216 <message> 217 <location filename="../src/mainwindow.cpp" line="71 4"/>217 <location filename="../src/mainwindow.cpp" line="719"/> 218 218 <source>Ctrl+P</source> 219 219 <translation></translation> … … 484 484 </message> 485 485 <message> 486 <location filename="../src/mainwindow.cpp" line="6 27"/>486 <location filename="../src/mainwindow.cpp" line="632"/> 487 487 <source>Unable to load translation language.</source> 488 488 <translation>Неможливо завантажити переклад.</translation> … … 490 490 <message> 491 491 <location filename="../ui/mainwindow.ui" line="15"/> 492 <location filename="../src/mainwindow.cpp" line="7 46"/>492 <location filename="../src/mainwindow.cpp" line="751"/> 493 493 <source>Travelling Salesman Problem</source> 494 494 <translation>Задача комівояжера</translation> 495 495 </message> 496 496 <message> 497 <location filename="../src/mainwindow.cpp" line="6 37"/>497 <location filename="../src/mainwindow.cpp" line="642"/> 498 498 <source>Unsaved Changes</source> 499 499 <translation>Незбережені зміни</translation> … … 507 507 <location filename="../src/mainwindow.cpp" line="129"/> 508 508 <location filename="../src/mainwindow.cpp" line="188"/> 509 <location filename="../src/mainwindow.cpp" line="72 0"/>509 <location filename="../src/mainwindow.cpp" line="725"/> 510 510 <source>All Files</source> 511 511 <translation>Усі файли</translation> … … 518 518 </message> 519 519 <message> 520 <location filename="../src/mainwindow.cpp" line="6 27"/>520 <location filename="../src/mainwindow.cpp" line="632"/> 521 521 <source>Language Change</source> 522 522 <translation>Зміна мови</translation> 523 523 </message> 524 524 <message> 525 <location filename="../src/mainwindow.cpp" line="6 37"/>525 <location filename="../src/mainwindow.cpp" line="642"/> 526 526 <source>Would you like to save changes in current task?</source> 527 527 <translation>Бажаете зберегти зміни у поточній задачі?</translation> … … 563 563 </message> 564 564 <message numerus="yes"> 565 <location filename="../src/mainwindow.cpp" line="45 2"/>565 <location filename="../src/mainwindow.cpp" line="453"/> 566 566 <source>The price is <b>%n</b> unit(s).</source> 567 567 <translation> … … 572 572 </message> 573 573 <message> 574 <location filename="../src/mainwindow.cpp" line="7 19"/>574 <location filename="../src/mainwindow.cpp" line="724"/> 575 575 <source>%1 Task File</source> 576 576 <translation>Файл умови %1</translation> … … 621 621 <message> 622 622 <location filename="../src/mainwindow.cpp" line="416"/> 623 <location filename="../src/mainwindow.cpp" line="46 0"/>623 <location filename="../src/mainwindow.cpp" line="463"/> 624 624 <source>Solution of Variant #%1 task</source> 625 625 <translation>Розв'язок варіанту №%1</translation> … … 642 642 <message> 643 643 <location filename="../src/mainwindow.cpp" line="455"/> 644 <source>The price is <b>%1</b> units.</source> 645 <translation>Вартість - <b>%1</b> одиниць.</translation> 646 </message> 647 <message> 648 <location filename="../src/mainwindow.cpp" line="458"/> 644 649 <source><b>WARNING!!!</b><br>This result is a record, but it may not be optimal.<br>Iterations need to be continued to check whether this result is optimal or get an optimal one.</source> 645 650 <translation><b>Увага!!!</b><br>Знайдений розв'язок є рекордом, але може бути неоптимальним.<br>Для отримання оптимального розв'зку, або перевірки поточного на оптимальність, потрібно продовжити ітерації.</translation> 646 651 </message> 647 652 <message> 648 <location filename="../src/mainwindow.cpp" line="7 28"/>649 <location filename="../src/mainwindow.cpp" line="73 0"/>653 <location filename="../src/mainwindow.cpp" line="733"/> 654 <location filename="../src/mainwindow.cpp" line="735"/> 650 655 <source>Task Save</source> 651 656 <translation>Збереження умови</translation> … … 677 682 <name>SettingsDialog</name> 678 683 <message> 679 <location filename="../src/settingsdialog.cpp" line="9 7"/>684 <location filename="../src/settingsdialog.cpp" line="99"/> 680 685 <source>Restore main window state and position on application restart</source> 681 686 <translation>Відновлювати стан та розмір головного вікна після перезапуску додатку</translation> 682 687 </message> 683 688 <message> 684 <location filename="../src/settingsdialog.cpp" line=" 99"/>689 <location filename="../src/settingsdialog.cpp" line="101"/> 685 690 <source>Save main window state and position</source> 686 691 <translation>Зберегти стан та розміщення головного вікна</translation> 687 692 </message> 688 693 <message> 689 <location filename="../src/settingsdialog.cpp" line="12 2"/>694 <location filename="../src/settingsdialog.cpp" line="124"/> 690 695 <source>Hover mouse pointer over dialog elements to get additional help</source> 691 696 <translation>Наведіть покажчик миші на елемент ділогу, щоб отримати підказку</translation> … … 758 763 <message> 759 764 <location filename="../ui/settingsdialog.ui" line="283"/> 760 <source> Use the number of cities in task to determine whether to show solution steps' matrices</source>765 <source>Show or hide solution steps' matrices based on number of cities in the task</source> 761 766 <translation>Показувати матриці кроків розв'язку в залежності від кількості міст у задачі</translation> 767 </message> 768 <message> 769 <location filename="../ui/settingsdialog.ui" line="305"/> 770 <source>Generate fractional random values with the accuracy of 2 decimal places</source> 771 <translation>Генерувати дробові випадкові числа з точністю до 2-го знаку</translation> 772 </message> 773 <message> 774 <location filename="../ui/settingsdialog.ui" line="308"/> 775 <source>Fractional random values</source> 776 <translation>Дробові випадкові числа</translation> 777 </message> 778 <message> 779 <location filename="../ui/settingsdialog.ui" line="316"/> 780 <source>Scroll to the end of solution output after solving</source> 781 <translation>Прокручувати в кінець виводу після закінчення розв'язку задачі</translation> 782 </message> 783 <message> 784 <location filename="../ui/settingsdialog.ui" line="319"/> 785 <source>Scroll to solution end</source> 786 <translation>Прокручувати в кінець</translation> 762 787 </message> 763 788 <message> -
trunk/src/globals.h
r78 r81 46 46 //! Default number of cities 47 47 #define DEF_NUM_CITIES 5 48 //! Default value for generating fractional random values 49 #define DEF_FRACTIONAL_RANDOM false 48 50 //! Default value for showing or not solution step matrices 49 51 #define DEF_SHOW_MATRIX true … … 52 54 //! Default maximum number of cities to show solution step matrices 53 55 #define DEF_SHOW_MATRIX_CITY_LIMIT 15 56 //! Default for scrolling to the end of output after solving 57 #define DEF_SCROLL_TO_END true 54 58 //! Default font name 55 59 #define DEF_FONT_FAMILY "Courier New" … … 108 112 #define INFSTR "---" 109 113 114 // FUNCTIONS 115 /*! 116 * \brief Checks whether \a x contains an integer value 117 * \param x A value to check 118 * \return \c true if \a x countains an integer, oherwise \c false 119 */ 120 inline bool isInteger(double x) 121 { 122 double i; 123 return (modf(x, &i) == 0.0); 124 } 125 110 126 // Sanity checks 111 127 // Check that default number of cities is sane (<= MAX_NUM_CITIES) -
trunk/src/mainwindow.cpp
r80 r81 450 450 output.append("<p>" + trUtf8("Resulting path:") + "</p>"); 451 451 output.append("<p> " + solver.getSortedPath() + "</p>"); 452 output.append("<p>" + trUtf8("The price is <b>%n</b> unit(s).", "", step->price) + "</p>"); 452 if (isInteger(step->price)) 453 output.append("<p>" + trUtf8("The price is <b>%n</b> unit(s).", "", step->price) + "</p>"); 454 else 455 output.append("<p>" + trUtf8("The price is <b>%1</b> units.").arg(step->price, 0, 'f', 2) + "</p>"); 453 456 if (!solver.isOptimal()) { 454 457 output.append("<p> </p>"); … … 460 463 solutionText->setDocumentTitle(trUtf8("Solution of Variant #%1 task").arg(spinVariant->value())); 461 464 462 // Scrolling to the end of text. 463 solutionText->moveCursor(QTextCursor::End); 465 if (settings->value("Output/ScrollToEnd", DEF_SCROLL_TO_END).toBool()) { 466 // Scrolling to the end of text. 467 solutionText->moveCursor(QTextCursor::End); 468 } 464 469 465 470 toggleSolutionActions(); … … 655 660 line += "<td align=\"center\">"INFSTR"</td>"; 656 661 else 657 line += "<td align=\"center\">" + QVariant(matrix.at(r).at(c)).toString() + "</td>";662 line += isInteger(matrix.at(r).at(c)) ? QString("<td align=\"center\">%1</td>").arg(matrix.at(r).at(c)) : QString("<td align=\"center\">%1</td>").arg(matrix.at(r).at(c), 0, 'f', 2); 658 663 } 659 664 line += "</tr>"; … … 674 679 line += "<td align=\"center\">"INFSTR"</td>"; 675 680 else if ((r == step.candidate.nRow) && (c == step.candidate.nCol)) 676 line += "<td align=\"center\" class=\"selected\">" + QVariant(step.matrix.at(r).at(c)).toString() + "</td>";681 line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\" class=\"selected\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\" class=\"selected\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', 2); 677 682 else { 678 683 SCandidate cand; … … 680 685 cand.nCol = c; 681 686 if (step.alts.contains(cand)) 682 line += "<td align=\"center\" class=\"alternate\">" + QVariant(step.matrix.at(r).at(c)).toString() + "</td>";687 line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\" class=\"alternate\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\" class=\"alternate\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', 2); 683 688 else 684 line += "<td align=\"center\">" + QVariant(step.matrix.at(r).at(c)).toString() + "</td>";689 line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', 2); 685 690 } 686 691 } -
trunk/src/settingsdialog.cpp
r80 r81 63 63 vbox2->addWidget(groupOutputSettings); 64 64 vbox2->addStretch(); 65 vbox2->addWidget(cbFractionalRandom); 65 66 vbox2->addWidget(cbShowMatrix); 66 67 vbox2->addLayout(layoutCitiesLimit); 68 vbox2->addWidget(cbScrollToEnd); 67 69 vbox2->addWidget(cbAutosize); 68 70 … … 150 152 vbox2->addStretch(); 151 153 vbox2->addLayout(hbox2); 154 vbox2->addWidget(cbFractionalRandom); 152 155 vbox2->addWidget(cbShowMatrix); 153 156 vbox2->addLayout(layoutCitiesLimit); 157 vbox2->addWidget(cbScrollToEnd); 154 158 vbox2->addWidget(cbAutosize); 155 159 vbox2->addWidget(cbSaveState); … … 188 192 spinRandMax->setMaximum(MAX_RAND_VALUE); 189 193 spinRandMax->setValue(settings->value("MaxCost",DEF_RAND_MAX).toInt()); 194 cbFractionalRandom->setChecked(settings->value("FractionalRandom", DEF_FRACTIONAL_RANDOM).toBool()); 190 195 cbAutosize->setChecked(settings->value("Autosize",true).toBool()); 191 196 #ifndef Q_OS_WINCE … … 200 205 spinCitiesLimit->setValue(settings->value("ShowMatrixCitiesLimit", DEF_SHOW_MATRIX_CITY_LIMIT).toInt()); 201 206 spinCitiesLimit->setMaximum(MAX_NUM_CITIES); 207 cbScrollToEnd->setChecked(settings->value("ScrollToEnd", DEF_SCROLL_TO_END).toBool()); 202 208 203 209 font = settings->value("Font",QFont(DEF_FONT_FAMILY,DEF_FONT_SIZE)).value<QFont>(); … … 236 242 settings->setValue("MinCost", spinRandMin->value()); 237 243 settings->setValue("MaxCost", spinRandMax->value()); 244 settings->setValue("FractionalRandom", cbFractionalRandom->isChecked()); 238 245 239 246 settings->beginGroup("Output"); … … 242 249 if (cbCitiesLimit->isChecked()) 243 250 settings->setValue("ShowMatrixCitiesLimit", spinCitiesLimit->value()); 251 settings->setValue("ScrollToEnd", cbScrollToEnd->isChecked()); 244 252 if (newFont) 245 253 settings->setValue("Font", font); -
trunk/src/tspmodel.cpp
r80 r81 466 466 } 467 467 468 inline int CTSPModel::rand(int min, int max) const 469 { 470 return min + (int)floor(((double)qrand() / RAND_MAX) * (max + 1 - min)); 471 } 468 inline double CTSPModel::rand(int min, int max) const 469 { 470 double r; 471 if (settings->value("FractionalRandom", DEF_FRACTIONAL_RANDOM).toBool()) 472 r = (double)qRound((double)qrand() / RAND_MAX * (max - min) * 100) / 100; 473 else 474 r = qRound((double)qrand() / RAND_MAX * (max - min)); 475 return min + r; 476 } -
trunk/src/tspmodel.h
r71 r81 69 69 bool loadTSPT(QDataStream *); 70 70 bool loadZKT(QDataStream *); 71 intrand(int, int) const;71 double rand(int, int) const; 72 72 }; 73 73 -
trunk/ui/settingsdialog.ui
r78 r81 281 281 </property> 282 282 <property name="statusTip"> 283 <string> Use the number of cities in task to determine whether to show solution steps' matrices</string>283 <string>Show or hide solution steps' matrices based on number of cities in the task</string> 284 284 </property> 285 285 <property name="text"> … … 296 296 <property name="minimum"> 297 297 <number>1</number> 298 </property> 299 </widget> 300 <widget class="QCheckBox" name="cbFractionalRandom"> 301 <property name="cursor"> 302 <cursorShape>PointingHandCursor</cursorShape> 303 </property> 304 <property name="statusTip"> 305 <string>Generate fractional random values with the accuracy of 2 decimal places</string> 306 </property> 307 <property name="text"> 308 <string>Fractional random values</string> 309 </property> 310 </widget> 311 <widget class="QCheckBox" name="cbScrollToEnd"> 312 <property name="cursor"> 313 <cursorShape>PointingHandCursor</cursorShape> 314 </property> 315 <property name="statusTip"> 316 <string>Scroll to the end of solution output after solving</string> 317 </property> 318 <property name="text"> 319 <string>Scroll to solution end</string> 298 320 </property> 299 321 </widget>
Note: See TracChangeset
for help on using the changeset viewer.