Changeset 81 in tspsg-svn


Ignore:
Timestamp:
Jan 7, 2010, 2:24:18 AM (14 years ago)
Author:
laleppa
Message:

+ Added the ability to generate fractional random numbers.
+ Added "Scroll to the end of solution output after solving" option.

  • Set the accuracy for fractional numbers on output to 2 decimail places.
  • Updated translations to reflect changes.
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/i18n/en.ts

    r80 r81  
    153153    </message>
    154154    <message>
    155         <location filename="../src/mainwindow.cpp" line="627"/>
     155        <location filename="../src/mainwindow.cpp" line="632"/>
    156156        <source>Unable to load translation language.</source>
    157157        <translation type="unfinished"></translation>
    158158    </message>
    159159    <message>
    160         <location filename="../src/mainwindow.cpp" line="637"/>
     160        <location filename="../src/mainwindow.cpp" line="642"/>
    161161        <source>Would you like to save changes in current task?</source>
    162162        <translation type="unfinished"></translation>
     
    164164    <message>
    165165        <location filename="../ui/mainwindow.ui" line="15"/>
    166         <location filename="../src/mainwindow.cpp" line="746"/>
     166        <location filename="../src/mainwindow.cpp" line="751"/>
    167167        <source>Travelling Salesman Problem</source>
    168168        <translation type="unfinished"></translation>
    169169    </message>
    170170    <message>
    171         <location filename="../src/mainwindow.cpp" line="627"/>
     171        <location filename="../src/mainwindow.cpp" line="632"/>
    172172        <source>Language Change</source>
    173173        <translation type="unfinished"></translation>
    174174    </message>
    175175    <message>
    176         <location filename="../src/mainwindow.cpp" line="637"/>
     176        <location filename="../src/mainwindow.cpp" line="642"/>
    177177        <source>Unsaved Changes</source>
    178178        <translation type="unfinished"></translation>
     
    192192        <location filename="../src/mainwindow.cpp" line="129"/>
    193193        <location filename="../src/mainwindow.cpp" line="188"/>
    194         <location filename="../src/mainwindow.cpp" line="720"/>
     194        <location filename="../src/mainwindow.cpp" line="725"/>
    195195        <source>All Files</source>
    196196        <translation type="unfinished"></translation>
     
    231231    </message>
    232232    <message numerus="yes">
    233         <location filename="../src/mainwindow.cpp" line="452"/>
     233        <location filename="../src/mainwindow.cpp" line="453"/>
    234234        <source>The price is &lt;b&gt;%n&lt;/b&gt; unit(s).</source>
    235235        <translation>
     
    239239    </message>
    240240    <message>
    241         <location filename="../src/mainwindow.cpp" line="719"/>
     241        <location filename="../src/mainwindow.cpp" line="724"/>
    242242        <source>%1 Task File</source>
    243243        <translation type="unfinished"></translation>
     
    287287    <message>
    288288        <location filename="../src/mainwindow.cpp" line="416"/>
    289         <location filename="../src/mainwindow.cpp" line="460"/>
     289        <location filename="../src/mainwindow.cpp" line="463"/>
    290290        <source>Solution of Variant #%1 task</source>
    291291        <translation type="unfinished"></translation>
     
    308308    <message>
    309309        <location filename="../src/mainwindow.cpp" line="455"/>
     310        <source>The price is &lt;b&gt;%1&lt;/b&gt; units.</source>
     311        <translation type="unfinished"></translation>
     312    </message>
     313    <message>
     314        <location filename="../src/mainwindow.cpp" line="458"/>
    310315        <source>&lt;b&gt;WARNING!!!&lt;/b&gt;&lt;br&gt;This result is a record, but it may not be optimal.&lt;br&gt;Iterations need to be continued to check whether this result is optimal or get an optimal one.</source>
    311316        <translation type="unfinished"></translation>
    312317    </message>
    313318    <message>
    314         <location filename="../src/mainwindow.cpp" line="728"/>
    315         <location filename="../src/mainwindow.cpp" line="730"/>
     319        <location filename="../src/mainwindow.cpp" line="733"/>
     320        <location filename="../src/mainwindow.cpp" line="735"/>
    316321        <source>Task Save</source>
    317322        <translation type="unfinished"></translation>
     
    606611    </message>
    607612    <message>
    608         <location filename="../src/mainwindow.cpp" line="707"/>
     613        <location filename="../src/mainwindow.cpp" line="712"/>
    609614        <source>&amp;Print...</source>
    610615        <translation type="unfinished"></translation>
    611616    </message>
    612617    <message>
    613         <location filename="../src/mainwindow.cpp" line="714"/>
     618        <location filename="../src/mainwindow.cpp" line="719"/>
    614619        <source>Ctrl+P</source>
    615620        <translation type="unfinished"></translation>
     
    631636    </message>
    632637    <message>
    633         <location filename="../src/mainwindow.cpp" line="699"/>
     638        <location filename="../src/mainwindow.cpp" line="704"/>
    634639        <source>P&amp;rint Preview...</source>
    635640        <translation type="unfinished"></translation>
    636641    </message>
    637642    <message>
    638         <location filename="../src/mainwindow.cpp" line="701"/>
     643        <location filename="../src/mainwindow.cpp" line="706"/>
    639644        <source>Preview solution results</source>
    640645        <translation type="unfinished"></translation>
    641646    </message>
    642647    <message>
    643         <location filename="../src/mainwindow.cpp" line="704"/>
     648        <location filename="../src/mainwindow.cpp" line="709"/>
    644649        <source>Preview current solution results before printing</source>
    645650        <translation type="unfinished"></translation>
    646651    </message>
    647652    <message>
    648         <location filename="../src/mainwindow.cpp" line="709"/>
     653        <location filename="../src/mainwindow.cpp" line="714"/>
    649654        <source>Print solution</source>
    650655        <translation type="unfinished"></translation>
    651656    </message>
    652657    <message>
    653         <location filename="../src/mainwindow.cpp" line="712"/>
     658        <location filename="../src/mainwindow.cpp" line="717"/>
    654659        <source>Print current solution results</source>
    655660        <translation type="unfinished"></translation>
     
    730735    <message>
    731736        <location filename="../ui/settingsdialog.ui" line="283"/>
    732         <source>Use the number of cities in task to determine whether to show solution steps&apos; matrices</source>
     737        <source>Show or hide solution steps&apos; 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>
    733758        <translation type="unfinished"></translation>
    734759    </message>
     
    781806    </message>
    782807    <message>
    783         <location filename="../src/settingsdialog.cpp" line="97"/>
     808        <location filename="../src/settingsdialog.cpp" line="99"/>
    784809        <source>Restore main window state and position on application restart</source>
    785810        <translation type="unfinished"></translation>
    786811    </message>
    787812    <message>
    788         <location filename="../src/settingsdialog.cpp" line="99"/>
     813        <location filename="../src/settingsdialog.cpp" line="101"/>
    789814        <source>Save main window state and position</source>
    790815        <translation type="unfinished"></translation>
    791816    </message>
    792817    <message>
    793         <location filename="../src/settingsdialog.cpp" line="122"/>
     818        <location filename="../src/settingsdialog.cpp" line="124"/>
    794819        <source>Hover mouse pointer over dialog elements to get additional help</source>
    795820        <translation type="unfinished"></translation>
  • trunk/i18n/ru.ts

    r80 r81  
    161161    </message>
    162162    <message>
    163         <location filename="../src/mainwindow.cpp" line="627"/>
     163        <location filename="../src/mainwindow.cpp" line="632"/>
    164164        <source>Unable to load translation language.</source>
    165165        <translation>Невозможно загрузить перевод.</translation>
     
    167167    <message>
    168168        <location filename="../ui/mainwindow.ui" line="15"/>
    169         <location filename="../src/mainwindow.cpp" line="746"/>
     169        <location filename="../src/mainwindow.cpp" line="751"/>
    170170        <source>Travelling Salesman Problem</source>
    171171        <translation>Задача коммивояжера</translation>
    172172    </message>
    173173    <message>
    174         <location filename="../src/mainwindow.cpp" line="637"/>
     174        <location filename="../src/mainwindow.cpp" line="642"/>
    175175        <source>Unsaved Changes</source>
    176176        <translation>Несохраненные изменения</translation>
     
    184184        <location filename="../src/mainwindow.cpp" line="129"/>
    185185        <location filename="../src/mainwindow.cpp" line="188"/>
    186         <location filename="../src/mainwindow.cpp" line="720"/>
     186        <location filename="../src/mainwindow.cpp" line="725"/>
    187187        <source>All Files</source>
    188188        <translation>Все файлы</translation>
     
    195195    </message>
    196196    <message>
    197         <location filename="../src/mainwindow.cpp" line="627"/>
     197        <location filename="../src/mainwindow.cpp" line="632"/>
    198198        <source>Language Change</source>
    199199        <translation>Смена языка</translation>
    200200    </message>
    201201    <message>
    202         <location filename="../src/mainwindow.cpp" line="637"/>
     202        <location filename="../src/mainwindow.cpp" line="642"/>
    203203        <source>Would you like to save changes in current task?</source>
    204204        <translation>Желаете сохранить изменения в текущей задаче?</translation>
     
    240240    </message>
    241241    <message numerus="yes">
    242         <location filename="../src/mainwindow.cpp" line="452"/>
     242        <location filename="../src/mainwindow.cpp" line="453"/>
    243243        <source>The price is &lt;b&gt;%n&lt;/b&gt; unit(s).</source>
    244244        <translation>
     
    249249    </message>
    250250    <message>
    251         <location filename="../src/mainwindow.cpp" line="719"/>
     251        <location filename="../src/mainwindow.cpp" line="724"/>
    252252        <source>%1 Task File</source>
    253253        <translation>Файл условия %1</translation>
     
    298298    <message>
    299299        <location filename="../src/mainwindow.cpp" line="416"/>
    300         <location filename="../src/mainwindow.cpp" line="460"/>
     300        <location filename="../src/mainwindow.cpp" line="463"/>
    301301        <source>Solution of Variant #%1 task</source>
    302302        <translation>Решение варианта №%1</translation>
     
    319319    <message>
    320320        <location filename="../src/mainwindow.cpp" line="455"/>
     321        <source>The price is &lt;b&gt;%1&lt;/b&gt; units.</source>
     322        <translation>Стоимость - &lt;b&gt;%1&lt;/b&gt; единиц.</translation>
     323    </message>
     324    <message>
     325        <location filename="../src/mainwindow.cpp" line="458"/>
    321326        <source>&lt;b&gt;WARNING!!!&lt;/b&gt;&lt;br&gt;This result is a record, but it may not be optimal.&lt;br&gt;Iterations need to be continued to check whether this result is optimal or get an optimal one.</source>
    322327        <translation>&lt;b&gt;ВНИМАНИЕ!!!&lt;/b&gt;&lt;br&gt;Найденное решение является рекордом, но может оказаться не оптимальным.&lt;br&gt;Для получения оптимального решения, или проверки текущего на оптимальность, требуется продолжить итерации.</translation>
    323328    </message>
    324329    <message>
    325         <location filename="../src/mainwindow.cpp" line="728"/>
    326         <location filename="../src/mainwindow.cpp" line="730"/>
     330        <location filename="../src/mainwindow.cpp" line="733"/>
     331        <location filename="../src/mainwindow.cpp" line="735"/>
    327332        <source>Task Save</source>
    328333        <translation>Сохранение условия</translation>
     
    624629    </message>
    625630    <message>
    626         <location filename="../src/mainwindow.cpp" line="699"/>
     631        <location filename="../src/mainwindow.cpp" line="704"/>
    627632        <source>P&amp;rint Preview...</source>
    628633        <translation>П&amp;редварительный просмотр...</translation>
    629634    </message>
    630635    <message>
    631         <location filename="../src/mainwindow.cpp" line="701"/>
     636        <location filename="../src/mainwindow.cpp" line="706"/>
    632637        <source>Preview solution results</source>
    633638        <translation>Предварительный просмотр результатов решения</translation>
    634639    </message>
    635640    <message>
    636         <location filename="../src/mainwindow.cpp" line="704"/>
     641        <location filename="../src/mainwindow.cpp" line="709"/>
    637642        <source>Preview current solution results before printing</source>
    638643        <translation>Предварительный просмотр результатов решения перед печатью</translation>
    639644    </message>
    640645    <message>
    641         <location filename="../src/mainwindow.cpp" line="707"/>
     646        <location filename="../src/mainwindow.cpp" line="712"/>
    642647        <source>&amp;Print...</source>
    643648        <translation>&amp;Печать...</translation>
    644649    </message>
    645650    <message>
    646         <location filename="../src/mainwindow.cpp" line="709"/>
     651        <location filename="../src/mainwindow.cpp" line="714"/>
    647652        <source>Print solution</source>
    648653        <translation>Печать решения</translation>
    649654    </message>
    650655    <message>
    651         <location filename="../src/mainwindow.cpp" line="712"/>
     656        <location filename="../src/mainwindow.cpp" line="717"/>
    652657        <source>Print current solution results</source>
    653658        <translation>Распечатать текущие результаты решения</translation>
    654659    </message>
    655660    <message>
    656         <location filename="../src/mainwindow.cpp" line="714"/>
     661        <location filename="../src/mainwindow.cpp" line="719"/>
    657662        <source>Ctrl+P</source>
    658663        <translation></translation>
     
    743748    <message>
    744749        <location filename="../ui/settingsdialog.ui" line="283"/>
    745         <source>Use the number of cities in task to determine whether to show solution steps&apos; matrices</source>
     750        <source>Show or hide solution steps&apos; matrices based on number of cities in the task</source>
    746751        <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>
    747772    </message>
    748773    <message>
     
    794819    </message>
    795820    <message>
    796         <location filename="../src/settingsdialog.cpp" line="97"/>
     821        <location filename="../src/settingsdialog.cpp" line="99"/>
    797822        <source>Restore main window state and position on application restart</source>
    798823        <translation>Восстанавливать состояние и размеры главного окна после перезапуска приложения</translation>
    799824    </message>
    800825    <message>
    801         <location filename="../src/settingsdialog.cpp" line="99"/>
     826        <location filename="../src/settingsdialog.cpp" line="101"/>
    802827        <source>Save main window state and position</source>
    803828        <translation>Сохранять состояние и положение главного окна</translation>
    804829    </message>
    805830    <message>
    806         <location filename="../src/settingsdialog.cpp" line="122"/>
     831        <location filename="../src/settingsdialog.cpp" line="124"/>
    807832        <source>Hover mouse pointer over dialog elements to get additional help</source>
    808833        <translation>Наведите указатель мыши на элемент диалога, чтоб получить подсказку</translation>
  • trunk/i18n/uk.ts

    r80 r81  
    185185    </message>
    186186    <message>
    187         <location filename="../src/mainwindow.cpp" line="699"/>
     187        <location filename="../src/mainwindow.cpp" line="704"/>
    188188        <source>P&amp;rint Preview...</source>
    189189        <translation>&amp;Попередній перегляд...</translation>
    190190    </message>
    191191    <message>
    192         <location filename="../src/mainwindow.cpp" line="701"/>
     192        <location filename="../src/mainwindow.cpp" line="706"/>
    193193        <source>Preview solution results</source>
    194194        <translation>Попередній перегляд результатів розв&apos;язку</translation>
    195195    </message>
    196196    <message>
    197         <location filename="../src/mainwindow.cpp" line="704"/>
     197        <location filename="../src/mainwindow.cpp" line="709"/>
    198198        <source>Preview current solution results before printing</source>
    199199        <translation>Попередній перегляд результатів розв&apos;язку перед друком</translation>
    200200    </message>
    201201    <message>
    202         <location filename="../src/mainwindow.cpp" line="707"/>
     202        <location filename="../src/mainwindow.cpp" line="712"/>
    203203        <source>&amp;Print...</source>
    204204        <translation>&amp;Друк...</translation>
    205205    </message>
    206206    <message>
    207         <location filename="../src/mainwindow.cpp" line="709"/>
     207        <location filename="../src/mainwindow.cpp" line="714"/>
    208208        <source>Print solution</source>
    209209        <translation>Друк розв&apos;зку</translation>
    210210    </message>
    211211    <message>
    212         <location filename="../src/mainwindow.cpp" line="712"/>
     212        <location filename="../src/mainwindow.cpp" line="717"/>
    213213        <source>Print current solution results</source>
    214214        <translation>Роздрукувати поточний результат розв&apos;язку</translation>
    215215    </message>
    216216    <message>
    217         <location filename="../src/mainwindow.cpp" line="714"/>
     217        <location filename="../src/mainwindow.cpp" line="719"/>
    218218        <source>Ctrl+P</source>
    219219        <translation></translation>
     
    484484    </message>
    485485    <message>
    486         <location filename="../src/mainwindow.cpp" line="627"/>
     486        <location filename="../src/mainwindow.cpp" line="632"/>
    487487        <source>Unable to load translation language.</source>
    488488        <translation>Неможливо завантажити переклад.</translation>
     
    490490    <message>
    491491        <location filename="../ui/mainwindow.ui" line="15"/>
    492         <location filename="../src/mainwindow.cpp" line="746"/>
     492        <location filename="../src/mainwindow.cpp" line="751"/>
    493493        <source>Travelling Salesman Problem</source>
    494494        <translation>Задача комівояжера</translation>
    495495    </message>
    496496    <message>
    497         <location filename="../src/mainwindow.cpp" line="637"/>
     497        <location filename="../src/mainwindow.cpp" line="642"/>
    498498        <source>Unsaved Changes</source>
    499499        <translation>Незбережені зміни</translation>
     
    507507        <location filename="../src/mainwindow.cpp" line="129"/>
    508508        <location filename="../src/mainwindow.cpp" line="188"/>
    509         <location filename="../src/mainwindow.cpp" line="720"/>
     509        <location filename="../src/mainwindow.cpp" line="725"/>
    510510        <source>All Files</source>
    511511        <translation>Усі файли</translation>
     
    518518    </message>
    519519    <message>
    520         <location filename="../src/mainwindow.cpp" line="627"/>
     520        <location filename="../src/mainwindow.cpp" line="632"/>
    521521        <source>Language Change</source>
    522522        <translation>Зміна мови</translation>
    523523    </message>
    524524    <message>
    525         <location filename="../src/mainwindow.cpp" line="637"/>
     525        <location filename="../src/mainwindow.cpp" line="642"/>
    526526        <source>Would you like to save changes in current task?</source>
    527527        <translation>Бажаете зберегти зміни у поточній задачі?</translation>
     
    563563    </message>
    564564    <message numerus="yes">
    565         <location filename="../src/mainwindow.cpp" line="452"/>
     565        <location filename="../src/mainwindow.cpp" line="453"/>
    566566        <source>The price is &lt;b&gt;%n&lt;/b&gt; unit(s).</source>
    567567        <translation>
     
    572572    </message>
    573573    <message>
    574         <location filename="../src/mainwindow.cpp" line="719"/>
     574        <location filename="../src/mainwindow.cpp" line="724"/>
    575575        <source>%1 Task File</source>
    576576        <translation>Файл умови %1</translation>
     
    621621    <message>
    622622        <location filename="../src/mainwindow.cpp" line="416"/>
    623         <location filename="../src/mainwindow.cpp" line="460"/>
     623        <location filename="../src/mainwindow.cpp" line="463"/>
    624624        <source>Solution of Variant #%1 task</source>
    625625        <translation>Розв&apos;язок варіанту №%1</translation>
     
    642642    <message>
    643643        <location filename="../src/mainwindow.cpp" line="455"/>
     644        <source>The price is &lt;b&gt;%1&lt;/b&gt; units.</source>
     645        <translation>Вартість - &lt;b&gt;%1&lt;/b&gt; одиниць.</translation>
     646    </message>
     647    <message>
     648        <location filename="../src/mainwindow.cpp" line="458"/>
    644649        <source>&lt;b&gt;WARNING!!!&lt;/b&gt;&lt;br&gt;This result is a record, but it may not be optimal.&lt;br&gt;Iterations need to be continued to check whether this result is optimal or get an optimal one.</source>
    645650        <translation>&lt;b&gt;Увага!!!&lt;/b&gt;&lt;br&gt;Знайдений розв&apos;язок є рекордом, але може бути неоптимальним.&lt;br&gt;Для отримання оптимального розв&apos;зку, або перевірки поточного на оптимальність, потрібно продовжити ітерації.</translation>
    646651    </message>
    647652    <message>
    648         <location filename="../src/mainwindow.cpp" line="728"/>
    649         <location filename="../src/mainwindow.cpp" line="730"/>
     653        <location filename="../src/mainwindow.cpp" line="733"/>
     654        <location filename="../src/mainwindow.cpp" line="735"/>
    650655        <source>Task Save</source>
    651656        <translation>Збереження умови</translation>
     
    677682    <name>SettingsDialog</name>
    678683    <message>
    679         <location filename="../src/settingsdialog.cpp" line="97"/>
     684        <location filename="../src/settingsdialog.cpp" line="99"/>
    680685        <source>Restore main window state and position on application restart</source>
    681686        <translation>Відновлювати стан та розмір головного вікна після перезапуску додатку</translation>
    682687    </message>
    683688    <message>
    684         <location filename="../src/settingsdialog.cpp" line="99"/>
     689        <location filename="../src/settingsdialog.cpp" line="101"/>
    685690        <source>Save main window state and position</source>
    686691        <translation>Зберегти стан та розміщення головного вікна</translation>
    687692    </message>
    688693    <message>
    689         <location filename="../src/settingsdialog.cpp" line="122"/>
     694        <location filename="../src/settingsdialog.cpp" line="124"/>
    690695        <source>Hover mouse pointer over dialog elements to get additional help</source>
    691696        <translation>Наведіть покажчик миші на елемент ділогу, щоб отримати підказку</translation>
     
    758763    <message>
    759764        <location filename="../ui/settingsdialog.ui" line="283"/>
    760         <source>Use the number of cities in task to determine whether to show solution steps&apos; matrices</source>
     765        <source>Show or hide solution steps&apos; matrices based on number of cities in the task</source>
    761766        <translation>Показувати матриці кроків розв&apos;язку в залежності від кількості міст у задачі</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>Прокручувати в кінець виводу після закінчення розв&apos;язку задачі</translation>
     782    </message>
     783    <message>
     784        <location filename="../ui/settingsdialog.ui" line="319"/>
     785        <source>Scroll to solution end</source>
     786        <translation>Прокручувати в кінець</translation>
    762787    </message>
    763788    <message>
  • trunk/src/globals.h

    r78 r81  
    4646//! Default number of cities
    4747#define DEF_NUM_CITIES 5
     48//! Default value for generating fractional random values
     49#define DEF_FRACTIONAL_RANDOM false
    4850//! Default value for showing or not solution step matrices
    4951#define DEF_SHOW_MATRIX true
     
    5254//! Default maximum number of cities to show solution step matrices
    5355#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
    5458//! Default font name
    5559#define DEF_FONT_FAMILY "Courier New"
     
    108112#define INFSTR "---"
    109113
     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 */
     120inline bool isInteger(double x)
     121{
     122double i;
     123        return (modf(x, &i) == 0.0);
     124}
     125
    110126// Sanity checks
    111127// Check that default number of cities is sane (<= MAX_NUM_CITIES)
  • trunk/src/mainwindow.cpp

    r80 r81  
    450450                output.append("<p>" + trUtf8("Resulting path:") + "</p>");
    451451        output.append("<p>&nbsp;&nbsp;" + 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>");
    453456        if (!solver.isOptimal()) {
    454457                output.append("<p>&nbsp;</p>");
     
    460463        solutionText->setDocumentTitle(trUtf8("Solution of Variant #%1 task").arg(spinVariant->value()));
    461464
    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        }
    464469
    465470        toggleSolutionActions();
     
    655660                                line += "<td align=\"center\">"INFSTR"</td>";
    656661                        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);
    658663                }
    659664                line += "</tr>";
     
    674679                                line += "<td align=\"center\">"INFSTR"</td>";
    675680                        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);
    677682                        else {
    678683SCandidate cand;
     
    680685                                cand.nCol = c;
    681686                                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);
    683688                                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);
    685690                        }
    686691                }
  • trunk/src/settingsdialog.cpp

    r80 r81  
    6363        vbox2->addWidget(groupOutputSettings);
    6464        vbox2->addStretch();
     65        vbox2->addWidget(cbFractionalRandom);
    6566        vbox2->addWidget(cbShowMatrix);
    6667        vbox2->addLayout(layoutCitiesLimit);
     68        vbox2->addWidget(cbScrollToEnd);
    6769        vbox2->addWidget(cbAutosize);
    6870
     
    150152        vbox2->addStretch();
    151153        vbox2->addLayout(hbox2);
     154        vbox2->addWidget(cbFractionalRandom);
    152155        vbox2->addWidget(cbShowMatrix);
    153156        vbox2->addLayout(layoutCitiesLimit);
     157        vbox2->addWidget(cbScrollToEnd);
    154158        vbox2->addWidget(cbAutosize);
    155159        vbox2->addWidget(cbSaveState);
     
    188192        spinRandMax->setMaximum(MAX_RAND_VALUE);
    189193        spinRandMax->setValue(settings->value("MaxCost",DEF_RAND_MAX).toInt());
     194        cbFractionalRandom->setChecked(settings->value("FractionalRandom", DEF_FRACTIONAL_RANDOM).toBool());
    190195        cbAutosize->setChecked(settings->value("Autosize",true).toBool());
    191196#ifndef Q_OS_WINCE
     
    200205        spinCitiesLimit->setValue(settings->value("ShowMatrixCitiesLimit", DEF_SHOW_MATRIX_CITY_LIMIT).toInt());
    201206        spinCitiesLimit->setMaximum(MAX_NUM_CITIES);
     207        cbScrollToEnd->setChecked(settings->value("ScrollToEnd", DEF_SCROLL_TO_END).toBool());
    202208
    203209        font = settings->value("Font",QFont(DEF_FONT_FAMILY,DEF_FONT_SIZE)).value<QFont>();
     
    236242        settings->setValue("MinCost", spinRandMin->value());
    237243        settings->setValue("MaxCost", spinRandMax->value());
     244        settings->setValue("FractionalRandom", cbFractionalRandom->isChecked());
    238245
    239246        settings->beginGroup("Output");
     
    242249        if (cbCitiesLimit->isChecked())
    243250                settings->setValue("ShowMatrixCitiesLimit", spinCitiesLimit->value());
     251        settings->setValue("ScrollToEnd", cbScrollToEnd->isChecked());
    244252        if (newFont)
    245253                settings->setValue("Font", font);
  • trunk/src/tspmodel.cpp

    r80 r81  
    466466}
    467467
    468 inline int CTSPModel::rand(int min, int max) const
    469 {
    470         return min + (int)floor(((double)qrand() / RAND_MAX) * (max + 1 - min));
    471 }
     468inline double CTSPModel::rand(int min, int max) const
     469{
     470double 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  
    6969        bool loadTSPT(QDataStream *);
    7070        bool loadZKT(QDataStream *);
    71         int rand(int, int) const;
     71        double rand(int, int) const;
    7272};
    7373
  • trunk/ui/settingsdialog.ui

    r78 r81  
    281281    </property>
    282282    <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>
    284284    </property>
    285285    <property name="text">
     
    296296    <property name="minimum">
    297297     <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>
    298320    </property>
    299321   </widget>
Note: See TracChangeset for help on using the changeset viewer.