Index: /trunk/i18n/en.ts
===================================================================
--- /trunk/i18n/en.ts	(revision 56)
+++ /trunk/i18n/en.ts	(revision 57)
@@ -140,6 +140,6 @@
     <name>MainWindow</name>
     <message>
-        <location filename="../src/mainwindow.cpp" line="558"/>
-        <location filename="../src/mainwindow.cpp" line="567"/>
+        <location filename="../src/mainwindow.cpp" line="551"/>
+        <location filename="../src/mainwindow.cpp" line="560"/>
         <source>Language change</source>
         <translation type="unfinished"></translation>
@@ -172,48 +172,48 @@
     </message>
     <message>
+        <location filename="../src/mainwindow.cpp" line="234"/>
+        <source>All Supported Formats</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../src/mainwindow.cpp" line="235"/>
         <location filename="../src/mainwindow.cpp" line="236"/>
-        <source>All Supported Formats</source>
+        <source>%1 Task Files</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../src/mainwindow.cpp" line="237"/>
-        <location filename="../src/mainwindow.cpp" line="238"/>
-        <source>%1 Task Files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="239"/>
-        <location filename="../src/mainwindow.cpp" line="297"/>
-        <location filename="../src/mainwindow.cpp" line="341"/>
+        <location filename="../src/mainwindow.cpp" line="293"/>
+        <location filename="../src/mainwindow.cpp" line="337"/>
         <source>All Files</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../src/mainwindow.cpp" line="287"/>
+        <source>PDF Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../src/mainwindow.cpp" line="289"/>
+        <source>HTML Files</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
         <location filename="../src/mainwindow.cpp" line="291"/>
-        <source>PDF Files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="293"/>
-        <source>HTML Files</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="295"/>
         <source>OpenDocument Files</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="340"/>
+        <location filename="../src/mainwindow.cpp" line="336"/>
         <source>%1 Task File</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="371"/>
+        <location filename="../src/mainwindow.cpp" line="367"/>
         <source>Settings Changed</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="371"/>
+        <location filename="../src/mainwindow.cpp" line="367"/>
         <source>You have changed color settings.
 Do you wish to apply them to current solution text?</source>
@@ -221,56 +221,56 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="456"/>
+        <location filename="../src/mainwindow.cpp" line="449"/>
         <source>Data error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="456"/>
+        <location filename="../src/mainwindow.cpp" line="449"/>
         <source>Error in cell [Row %1; Column %2]: Invalid data format.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="469"/>
+        <location filename="../src/mainwindow.cpp" line="462"/>
         <source>Variant #%1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="470"/>
+        <location filename="../src/mainwindow.cpp" line="463"/>
         <source>Task:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../src/mainwindow.cpp" line="466"/>
+        <location filename="../src/mainwindow.cpp" line="492"/>
+        <source>Solution of Variant #%1 task</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
         <location filename="../src/mainwindow.cpp" line="473"/>
-        <location filename="../src/mainwindow.cpp" line="499"/>
-        <source>Solution of Variant #%1 task</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="480"/>
         <source>Step #%1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="483"/>
+        <location filename="../src/mainwindow.cpp" line="476"/>
         <source>This step has alternate candidates for branching.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="495"/>
+        <location filename="../src/mainwindow.cpp" line="488"/>
         <source>Optimal path:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="497"/>
+        <location filename="../src/mainwindow.cpp" line="490"/>
         <source>The price is &lt;b&gt;%1&lt;/b&gt; units.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="558"/>
+        <location filename="../src/mainwindow.cpp" line="551"/>
         <source>Language will be autodetected on next application start.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="567"/>
+        <location filename="../src/mainwindow.cpp" line="560"/>
         <source>You have language autodetection turned on.
 It needs to be off.
@@ -279,7 +279,7 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.h" line="78"/>
-        <location filename="../src/mainwindow.cpp" line="263"/>
-        <location filename="../src/mainwindow.cpp" line="572"/>
+        <location filename="../src/mainwindow.cpp" line="259"/>
+        <location filename="../src/mainwindow.cpp" line="565"/>
+        <location filename="../src/mainwindow.h" line="79"/>
         <source>Untitled</source>
         <translation type="unfinished"></translation>
@@ -682,35 +682,45 @@
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="382"/>
+        <location filename="../ui/settingsdialog.ui" line="376"/>
         <source>Ma&amp;ximal:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="401"/>
+        <location filename="../ui/settingsdialog.ui" line="395"/>
         <source>Maximum for random number generation</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../ui/settingsdialog.ui" line="413"/>
+        <source>Output settings:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsdialog.ui" line="451"/>
+        <source>Font color for printing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsdialog.ui" line="454"/>
+        <source>&amp;Color...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsdialog.ui" line="472"/>
+        <source>Automatically resize rows and columns when content changes</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsdialog.ui" line="475"/>
+        <source>Automatically resize rows and columns</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
         <location filename="../ui/settingsdialog.ui" line="428"/>
-        <source>Output settings:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../ui/settingsdialog.ui" line="466"/>
-        <source>Font color for printing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../ui/settingsdialog.ui" line="469"/>
-        <source>&amp;Color...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../ui/settingsdialog.ui" line="443"/>
         <source>Font face for printing</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="446"/>
+        <location filename="../ui/settingsdialog.ui" line="431"/>
         <source>&amp;Font...</source>
         <translation type="unfinished"></translation>
@@ -748,15 +758,15 @@
     </message>
     <message>
-        <location filename="../src/settingsdialog.cpp" line="78"/>
+        <location filename="../src/settingsdialog.cpp" line="79"/>
         <source>Restore main window state and position on application restart</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingsdialog.cpp" line="80"/>
+        <location filename="../src/settingsdialog.cpp" line="81"/>
         <source>Save main window state and position</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingsdialog.cpp" line="100"/>
+        <location filename="../src/settingsdialog.cpp" line="101"/>
         <location filename="../ui/settingsdialog.ui" line="204"/>
         <source>Hover mouse pointer over dialog elements to get additional help</source>
Index: /trunk/i18n/ru.ts
===================================================================
--- /trunk/i18n/ru.ts	(revision 56)
+++ /trunk/i18n/ru.ts	(revision 57)
@@ -148,6 +148,6 @@
     <name>MainWindow</name>
     <message>
-        <location filename="../src/mainwindow.cpp" line="558"/>
-        <location filename="../src/mainwindow.cpp" line="567"/>
+        <location filename="../src/mainwindow.cpp" line="551"/>
+        <location filename="../src/mainwindow.cpp" line="560"/>
         <source>Language change</source>
         <translation>Смена языка</translation>
@@ -170,18 +170,18 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="236"/>
+        <location filename="../src/mainwindow.cpp" line="234"/>
         <source>All Supported Formats</source>
         <translation>Все поддерживаемые форматы</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="239"/>
-        <location filename="../src/mainwindow.cpp" line="297"/>
-        <location filename="../src/mainwindow.cpp" line="341"/>
+        <location filename="../src/mainwindow.cpp" line="237"/>
+        <location filename="../src/mainwindow.cpp" line="293"/>
+        <location filename="../src/mainwindow.cpp" line="337"/>
         <source>All Files</source>
         <translation>Все файлы</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="237"/>
-        <location filename="../src/mainwindow.cpp" line="238"/>
+        <location filename="../src/mainwindow.cpp" line="235"/>
+        <location filename="../src/mainwindow.cpp" line="236"/>
         <source>%1 Task Files</source>
         <translation>Файлы условий %1</translation>
@@ -198,30 +198,30 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="291"/>
+        <location filename="../src/mainwindow.cpp" line="287"/>
         <source>PDF Files</source>
         <translation>Файли PDF</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="293"/>
+        <location filename="../src/mainwindow.cpp" line="289"/>
         <source>HTML Files</source>
         <translation>Файлы HTML</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="295"/>
+        <location filename="../src/mainwindow.cpp" line="291"/>
         <source>OpenDocument Files</source>
         <translation>Файлы OpenDocument</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="340"/>
+        <location filename="../src/mainwindow.cpp" line="336"/>
         <source>%1 Task File</source>
         <translation>Файл условия %1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="371"/>
+        <location filename="../src/mainwindow.cpp" line="367"/>
         <source>Settings Changed</source>
         <translation>Параметры изменены</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="371"/>
+        <location filename="../src/mainwindow.cpp" line="367"/>
         <source>You have changed color settings.
 Do you wish to apply them to current solution text?</source>
@@ -230,56 +230,56 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="456"/>
+        <location filename="../src/mainwindow.cpp" line="449"/>
         <source>Data error</source>
         <translation>Ошибка в данных</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="456"/>
+        <location filename="../src/mainwindow.cpp" line="449"/>
         <source>Error in cell [Row %1; Column %2]: Invalid data format.</source>
         <translation>Ошибка в ячейке [Строка %1; Колонка %2]: Неверный формат данных.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="469"/>
+        <location filename="../src/mainwindow.cpp" line="462"/>
         <source>Variant #%1</source>
         <translation>Вариант №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="470"/>
+        <location filename="../src/mainwindow.cpp" line="463"/>
         <source>Task:</source>
         <translation>Условие:</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="473"/>
-        <location filename="../src/mainwindow.cpp" line="499"/>
+        <location filename="../src/mainwindow.cpp" line="466"/>
+        <location filename="../src/mainwindow.cpp" line="492"/>
         <source>Solution of Variant #%1 task</source>
         <translation>Решение варианта №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="480"/>
+        <location filename="../src/mainwindow.cpp" line="473"/>
         <source>Step #%1</source>
         <translation>Шаг №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="483"/>
+        <location filename="../src/mainwindow.cpp" line="476"/>
         <source>This step has alternate candidates for branching.</source>
         <translation>У этого шага есть альтернативные кандидаты на ветвление.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="495"/>
+        <location filename="../src/mainwindow.cpp" line="488"/>
         <source>Optimal path:</source>
         <translation>Оптимальный путь:</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="497"/>
+        <location filename="../src/mainwindow.cpp" line="490"/>
         <source>The price is &lt;b&gt;%1&lt;/b&gt; units.</source>
         <translation>Стоимость - &lt;b&gt;%1&lt;/b&gt; единиц.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="558"/>
+        <location filename="../src/mainwindow.cpp" line="551"/>
         <source>Language will be autodetected on next application start.</source>
         <translation>Язык будет автоматически определен при следующем запуске приложения.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="567"/>
+        <location filename="../src/mainwindow.cpp" line="560"/>
         <source>You have language autodetection turned on.
 It needs to be off.
@@ -290,7 +290,7 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.h" line="78"/>
-        <location filename="../src/mainwindow.cpp" line="263"/>
-        <location filename="../src/mainwindow.cpp" line="572"/>
+        <location filename="../src/mainwindow.cpp" line="259"/>
+        <location filename="../src/mainwindow.cpp" line="565"/>
+        <location filename="../src/mainwindow.h" line="79"/>
         <source>Untitled</source>
         <translation>Без имени</translation>
@@ -693,35 +693,45 @@
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="382"/>
+        <location filename="../ui/settingsdialog.ui" line="376"/>
         <source>Ma&amp;ximal:</source>
         <translation>М&amp;аксимум:</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="401"/>
+        <location filename="../ui/settingsdialog.ui" line="395"/>
         <source>Maximum for random number generation</source>
         <translation>Верхняя граница для генерации случайных значений</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="428"/>
+        <location filename="../ui/settingsdialog.ui" line="413"/>
         <source>Output settings:</source>
         <translation>Параметры вывода:</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="466"/>
+        <location filename="../ui/settingsdialog.ui" line="451"/>
         <source>Font color for printing</source>
         <translation>Цвет шрифта, используемого при печати</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="469"/>
+        <location filename="../ui/settingsdialog.ui" line="454"/>
         <source>&amp;Color...</source>
         <translation>&amp;Цвет...</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="443"/>
+        <location filename="../ui/settingsdialog.ui" line="472"/>
+        <source>Automatically resize rows and columns when content changes</source>
+        <translation>Автоматически подганять размер строк и колонок при изменении их содержания</translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsdialog.ui" line="475"/>
+        <source>Automatically resize rows and columns</source>
+        <translation>Автоматически подганять строки и колонки</translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsdialog.ui" line="428"/>
         <source>Font face for printing</source>
         <translation>Вид шрифта, используемого при печати</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="446"/>
+        <location filename="../ui/settingsdialog.ui" line="431"/>
         <source>&amp;Font...</source>
         <translation>&amp;Шрифт...</translation>
@@ -759,15 +769,15 @@
     </message>
     <message>
-        <location filename="../src/settingsdialog.cpp" line="78"/>
+        <location filename="../src/settingsdialog.cpp" line="79"/>
         <source>Restore main window state and position on application restart</source>
         <translation>Восстанавливать состояние и размеры главного окна после перезапуска приложения</translation>
     </message>
     <message>
-        <location filename="../src/settingsdialog.cpp" line="80"/>
+        <location filename="../src/settingsdialog.cpp" line="81"/>
         <source>Save main window state and position</source>
         <translation>Сохранять состояние и положение главного окна</translation>
     </message>
     <message>
-        <location filename="../src/settingsdialog.cpp" line="100"/>
+        <location filename="../src/settingsdialog.cpp" line="101"/>
         <location filename="../ui/settingsdialog.ui" line="204"/>
         <source>Hover mouse pointer over dialog elements to get additional help</source>
Index: /trunk/i18n/uk.ts
===================================================================
--- /trunk/i18n/uk.ts	(revision 56)
+++ /trunk/i18n/uk.ts	(revision 57)
@@ -521,6 +521,6 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="558"/>
-        <location filename="../src/mainwindow.cpp" line="567"/>
+        <location filename="../src/mainwindow.cpp" line="551"/>
+        <location filename="../src/mainwindow.cpp" line="560"/>
         <source>Language change</source>
         <translation>Зміна мови</translation>
@@ -543,18 +543,18 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="236"/>
+        <location filename="../src/mainwindow.cpp" line="234"/>
         <source>All Supported Formats</source>
         <translation>Усі підтримувані формати</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="239"/>
-        <location filename="../src/mainwindow.cpp" line="297"/>
-        <location filename="../src/mainwindow.cpp" line="341"/>
+        <location filename="../src/mainwindow.cpp" line="237"/>
+        <location filename="../src/mainwindow.cpp" line="293"/>
+        <location filename="../src/mainwindow.cpp" line="337"/>
         <source>All Files</source>
         <translation>Усі файли</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="237"/>
-        <location filename="../src/mainwindow.cpp" line="238"/>
+        <location filename="../src/mainwindow.cpp" line="235"/>
+        <location filename="../src/mainwindow.cpp" line="236"/>
         <source>%1 Task Files</source>
         <translation>Файли умов %1</translation>
@@ -571,30 +571,30 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="291"/>
+        <location filename="../src/mainwindow.cpp" line="287"/>
         <source>PDF Files</source>
         <translation>Файлы PDF</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="293"/>
+        <location filename="../src/mainwindow.cpp" line="289"/>
         <source>HTML Files</source>
         <translation>Файли HTML</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="295"/>
+        <location filename="../src/mainwindow.cpp" line="291"/>
         <source>OpenDocument Files</source>
         <translation>Файли OpenDocument</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="340"/>
+        <location filename="../src/mainwindow.cpp" line="336"/>
         <source>%1 Task File</source>
         <translation>Файл умови %1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="371"/>
+        <location filename="../src/mainwindow.cpp" line="367"/>
         <source>Settings Changed</source>
         <translation>Параметри змінено</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="371"/>
+        <location filename="../src/mainwindow.cpp" line="367"/>
         <source>You have changed color settings.
 Do you wish to apply them to current solution text?</source>
@@ -603,56 +603,56 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="456"/>
+        <location filename="../src/mainwindow.cpp" line="449"/>
         <source>Data error</source>
         <translation>Помилка у даних</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="456"/>
+        <location filename="../src/mainwindow.cpp" line="449"/>
         <source>Error in cell [Row %1; Column %2]: Invalid data format.</source>
         <translation>Помилка у комірці  [Рядок %1; Колонка %2]: Невірний формат даних.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="469"/>
+        <location filename="../src/mainwindow.cpp" line="462"/>
         <source>Variant #%1</source>
         <translation>Варіант №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="470"/>
+        <location filename="../src/mainwindow.cpp" line="463"/>
         <source>Task:</source>
         <translation>Умова:</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="473"/>
-        <location filename="../src/mainwindow.cpp" line="499"/>
+        <location filename="../src/mainwindow.cpp" line="466"/>
+        <location filename="../src/mainwindow.cpp" line="492"/>
         <source>Solution of Variant #%1 task</source>
         <translation>Розв&apos;язок варіанту №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="480"/>
+        <location filename="../src/mainwindow.cpp" line="473"/>
         <source>Step #%1</source>
         <translation>Крок №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="483"/>
+        <location filename="../src/mainwindow.cpp" line="476"/>
         <source>This step has alternate candidates for branching.</source>
         <translation>У цьому кроці є альтернативні кандидати на розгалудження.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="495"/>
+        <location filename="../src/mainwindow.cpp" line="488"/>
         <source>Optimal path:</source>
         <translation>Оптимальний шлях:</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="497"/>
+        <location filename="../src/mainwindow.cpp" line="490"/>
         <source>The price is &lt;b&gt;%1&lt;/b&gt; units.</source>
         <translation>Вартість - &lt;b&gt;%1&lt;/b&gt; одиниць.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="558"/>
+        <location filename="../src/mainwindow.cpp" line="551"/>
         <source>Language will be autodetected on next application start.</source>
         <translation>Мову буде автоматично визначено при наступному запуску додатку.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="567"/>
+        <location filename="../src/mainwindow.cpp" line="560"/>
         <source>You have language autodetection turned on.
 It needs to be off.
@@ -663,7 +663,7 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.h" line="78"/>
-        <location filename="../src/mainwindow.cpp" line="263"/>
-        <location filename="../src/mainwindow.cpp" line="572"/>
+        <location filename="../src/mainwindow.cpp" line="259"/>
+        <location filename="../src/mainwindow.cpp" line="565"/>
+        <location filename="../src/mainwindow.h" line="79"/>
         <source>Untitled</source>
         <translation>Без імені</translation>
@@ -673,15 +673,15 @@
     <name>SettingsDialog</name>
     <message>
-        <location filename="../src/settingsdialog.cpp" line="78"/>
+        <location filename="../src/settingsdialog.cpp" line="79"/>
         <source>Restore main window state and position on application restart</source>
         <translation>Відновлювати стан та розмір головного вікна після перезапуску додатку</translation>
     </message>
     <message>
-        <location filename="../src/settingsdialog.cpp" line="80"/>
+        <location filename="../src/settingsdialog.cpp" line="81"/>
         <source>Save main window state and position</source>
         <translation>Зберегти стан та розміщення головного вікна</translation>
     </message>
     <message>
-        <location filename="../src/settingsdialog.cpp" line="100"/>
+        <location filename="../src/settingsdialog.cpp" line="101"/>
         <location filename="../ui/settingsdialog.ui" line="204"/>
         <source>Hover mouse pointer over dialog elements to get additional help</source>
@@ -709,35 +709,45 @@
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="382"/>
+        <location filename="../ui/settingsdialog.ui" line="376"/>
         <source>Ma&amp;ximal:</source>
         <translation>М&amp;аксимум:</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="401"/>
+        <location filename="../ui/settingsdialog.ui" line="395"/>
         <source>Maximum for random number generation</source>
         <translation>Верхня межа для генерації випадкових значень</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="428"/>
+        <location filename="../ui/settingsdialog.ui" line="413"/>
         <source>Output settings:</source>
         <translation>Параметри виводу:</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="466"/>
+        <location filename="../ui/settingsdialog.ui" line="451"/>
         <source>Font color for printing</source>
         <translation>Колір шрифта для друку</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="469"/>
+        <location filename="../ui/settingsdialog.ui" line="454"/>
         <source>&amp;Color...</source>
         <translation>&amp;Колір...</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="443"/>
+        <location filename="../ui/settingsdialog.ui" line="472"/>
+        <source>Automatically resize rows and columns when content changes</source>
+        <translation>Автоматично підганяти розмір рядків та колонок при зміні їх змісту</translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsdialog.ui" line="475"/>
+        <source>Automatically resize rows and columns</source>
+        <translation>Автоматично підганяти рядки та колонки</translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsdialog.ui" line="428"/>
         <source>Font face for printing</source>
         <translation>Вигляд шрифта для друку</translation>
     </message>
     <message>
-        <location filename="../ui/settingsdialog.ui" line="446"/>
+        <location filename="../ui/settingsdialog.ui" line="431"/>
         <source>&amp;Font...</source>
         <translation>&amp;Шрифт...</translation>
Index: /trunk/src/globals.h
===================================================================
--- /trunk/src/globals.h	(revision 56)
+++ /trunk/src/globals.h	(revision 57)
@@ -43,4 +43,18 @@
 #define DEF_FONT_COLOR Qt::black
 
+// Maximum available number of cities
+#define MAX_NUM_CITIES 30
+// Maximum for random generation limit settings
+#define MAX_RAND_VALUE 1000
+
+// Paths
+#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
+	#define PATH_I18N "/usr/share/tspsg/i18n"
+	#define PATH_DOCS "/usr/share/doc/tspsg"
+#else
+	#define PATH_I18N "i18n"
+	#define PATH_DOCS "help"
+#endif // Q_OS_LINUX
+
 // TSPSG Task file signature - letters TSPT
 #define TSPT quint32(0x54535054)
@@ -56,6 +70,4 @@
 #define ZKT_VERSION quint8(1)
 
-// Maximum available number of cities
-#define MAX_NUM_CITIES 30
 // This value means infinity :-)
 #ifndef INFINITY
@@ -65,9 +77,19 @@
 #define INFSTR "---"
 
-// Let's check that default number of cities is sane (<= MAX_NUM_CITIES)
+// Check that default number of cities is sane (<= MAX_NUM_CITIES)
 #if DEF_NUM_CITIES > MAX_NUM_CITIES
 	#undef DEF_NUM_CITIES
 	#define DEF_NUM_CITIES MAX_NUM_CITIES
 #endif
+// Check that maximum for random generation is sane (<= MAX_RAND_VALUE)
+#if DEF_RAND_MAX > MAX_RAND_VALUE
+	#undef DEF_RAND_MAX
+	#define DEF_RAND_MAX MAX_RAND_VALUE
+#endif
+// Check that DEF_RAND_MIN <= DEF_RAND_MAX
+#if DEF_RAND_MIN > DEF_RAND_MAX
+	#undef DEF_RAND_MIN
+	#define DEF_RAND_MIN DEF_RAND_MAX
+#endif
 
 #endif // GLOBALS_H
Index: /trunk/src/main.cpp
===================================================================
--- /trunk/src/main.cpp	(revision 56)
+++ /trunk/src/main.cpp	(revision 57)
@@ -43,4 +43,5 @@
 	app.setOrganizationDomain("l-homes.org");
 	app.setApplicationName("TSPSG");
+	app.setApplicationVersion(BUILD_VERSION);
 MainWindow mainwindow;
 	mainwindow.show();
Index: /trunk/src/mainwindow.cpp
===================================================================
--- /trunk/src/mainwindow.cpp	(revision 56)
+++ /trunk/src/mainwindow.cpp	(revision 57)
@@ -96,5 +96,5 @@
 	taskView->setModel(tspmodel);
 	connect(tspmodel,SIGNAL(numCitiesChanged(int)),this,SLOT(numCitiesChanged(int)));
-	connect(tspmodel,SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),this,SLOT(dataChanged()));
+	connect(tspmodel,SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),this,SLOT(dataChanged(const QModelIndex &, const QModelIndex &)));
 	connect(tspmodel,SIGNAL(layoutChanged()),this,SLOT(dataChanged()));
 	if ((QCoreApplication::arguments().count() > 1) && (tspmodel->loadTask(QCoreApplication::arguments().at(1))))
@@ -148,5 +148,5 @@
 		else
 			// No luck. Let's try to load bundled one.
-			if (qtTranslator->load("qt_" + lang,"i18n"))
+			if (qtTranslator->load("qt_" + lang,PATH_I18N))
 				qApp->installTranslator(qtTranslator);
 			else {
@@ -156,5 +156,5 @@
 			}
 		// Now let's load application translation.
-		if (translator->load(lang,"i18n"))
+		if (translator->load(lang,PATH_I18N))
 			qApp->installTranslator(translator);
 		else {
@@ -191,5 +191,5 @@
 int count = tspmodel->numCities();
 	tspmodel->setNumCities(n);
-	if (n > count)
+	if ((n > count) && settings->value("Autosize",true).toBool())
 		for (int k = count; k < n; k++) {
 			taskView->resizeColumnToContents(k);
@@ -217,6 +217,4 @@
 	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 	tspmodel->clear();
-	taskView->resizeColumnsToContents();
-	taskView->resizeRowsToContents();
 	setFileName();
 	setWindowModified(false);
@@ -250,6 +248,4 @@
 	}
 	setFileName(files.first());
-	taskView->resizeColumnsToContents();
-	taskView->resizeRowsToContents();
 	tabWidget->setCurrentIndex(0);
 	setWindowModified(false);
@@ -411,7 +407,4 @@
 	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 	tspmodel->randomize();
-	setWindowModified(true);
-	taskView->resizeColumnsToContents();
-	taskView->resizeRowsToContents();
 	QApplication::restoreOverrideCursor();
 }
@@ -521,10 +514,10 @@
 void MainWindow::loadLangList()
 {
-QSettings langinfo("i18n/languages.ini",QSettings::IniFormat);
+QSettings langinfo(PATH_I18N"/languages.ini",QSettings::IniFormat);
 #if QT_VERSION >= 0x040500
 	// In Qt < 4.5 QSettings doesn't have method setIniCodec.
 	langinfo.setIniCodec("UTF-8");
 #endif
-QDir dir("i18n","*.qm",QDir::Name | QDir::IgnoreCase,QDir::Files);
+QDir dir(PATH_I18N,"*.qm",QDir::Name | QDir::IgnoreCase,QDir::Files);
 	if (!dir.exists())
 		return;
@@ -606,4 +599,15 @@
 }
 
+void MainWindow::dataChanged(const QModelIndex &tl, const QModelIndex &br)
+{
+	setWindowModified(true);
+	if (settings->value("Autosize",true).toBool()) {
+		for (int k = tl.row(); k <= br.row(); k++)
+			taskView->resizeRowToContents(k);
+		for (int k = tl.column(); k <= br.column(); k++)
+			taskView->resizeColumnToContents(k);
+	}
+}
+
 void MainWindow::numCitiesChanged(int nCities)
 {
Index: /trunk/src/mainwindow.h
===================================================================
--- /trunk/src/mainwindow.h	(revision 56)
+++ /trunk/src/mainwindow.h	(revision 57)
@@ -50,4 +50,5 @@
 	void actionHelpAboutTriggered();
 	void dataChanged();
+	void dataChanged(const QModelIndex &, const QModelIndex &);
 #ifndef QT_NO_PRINTER
 	void printPreview(QPrinter *);
Index: /trunk/src/settingsdialog.cpp
===================================================================
--- /trunk/src/settingsdialog.cpp	(revision 56)
+++ /trunk/src/settingsdialog.cpp	(revision 57)
@@ -44,4 +44,5 @@
 	spacer = new QSpacerItem(0,0,QSizePolicy::Minimum,QSizePolicy::Expanding);
 	vbox2->addItem(spacer);
+	vbox2->addWidget(cbAutosize);
 
 	// Output settings group
@@ -92,5 +93,5 @@
 	labelHint->setObjectName("labelHint");
 	labelHint->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
-	labelHint->setMinimumSize(QSize(175,28));
+	labelHint->setMinimumSize(QSize(190,28));
 	labelHint->setMaximumSize(QSize(0xFFFFFF,28));
 	labelHint->setTextFormat(Qt::PlainText);
@@ -130,4 +131,5 @@
 	vbox2->addItem(spacer);
 	vbox2->addLayout(hbox2);
+	vbox2->addWidget(cbAutosize);
 	vbox2->addWidget(cbSaveState);
 	spacer = new QSpacerItem(0,0,QSizePolicy::Minimum,QSizePolicy::Expanding);
@@ -164,6 +166,9 @@
 #endif // Q_OS_WINCE
 	settings = new QSettings(QSettings::IniFormat,QSettings::UserScope,"TSPSG","tspsg");
+	spinRandMin->setMaximum(MAX_RAND_VALUE);
 	spinRandMin->setValue(settings->value("MinCost",DEF_RAND_MIN).toInt());
+	spinRandMax->setMaximum(MAX_RAND_VALUE);
 	spinRandMax->setValue(settings->value("MaxCost",DEF_RAND_MAX).toInt());
+	cbAutosize->setChecked(settings->value("Autosize",true).toBool());
 #ifndef Q_OS_WINCE
 	cbSaveState->setChecked(settings->value("SavePos",false).toBool());
@@ -180,4 +185,5 @@
 	settings->setValue("SavePos",cbSaveState->isChecked());
 #endif // Q_OS_WINCE
+	settings->setValue("Autosize",cbAutosize->isChecked());
 	settings->setValue("MinCost",spinRandMin->value());
 	settings->setValue("MaxCost",spinRandMax->value());
Index: /trunk/src/settingsdialog.h
===================================================================
--- /trunk/src/settingsdialog.h	(revision 56)
+++ /trunk/src/settingsdialog.h	(revision 57)
@@ -57,5 +57,5 @@
 	void buttonColorClicked();
 	void buttonFontClicked();
-	void spinRandMinValueChanged(int val) { spinRandMax->setMinimum(val + 1); }
+	void spinRandMinValueChanged(int val) { spinRandMax->setMinimum(val); }
 };
 
Index: /trunk/tspsg.pro
===================================================================
--- /trunk/tspsg.pro	(revision 56)
+++ /trunk/tspsg.pro	(revision 57)
@@ -32,10 +32,47 @@
 include(tspsg.pri)
 
-# For wince: we are deploying to storage card because Qt libraries
-# (especially debug) are big enough for internal memory.
-deploy.path = "\Storage Card\tspsg"
-i18n.sources = i18n\languages.ini i18n\*.qm
-i18n.path = "\Storage Card\tspsg\i18n"
-DEPLOYMENT += deploy i18n
+# For *nix:
+#   - executable goes to $(INSTALL_ROOT)/bin
+#   - COPYING and README go to $(INSTALL_ROOT)/share/tspsg
+#   - translations go to $(INSTALL_ROOT)/share/tspsg/i18n
+#   - docs (none, yet) go to $(INSTALL_ROOT)/share/doc/tspsg
+# Usually, $(INSTALL_ROOT) is /usr or /usr/local
+unix {
+	target.path = /bin
+	share.path = /share/tspsg
+	share.files = COPYING README
+	i18n.path = /share/tspsg/i18n
+	i18n.files = i18n/languages.ini i18n/*.qm
+	docs.path = /share/doc/tspsg
+#	docs.files = docs/*
+	INSTALLS += target i18n docs share
+}
+
+# For win32: everything goes to $(INSTALL_ROOT)\tspsg and subfolders.
+# Usually, $(INSTALL_ROOT) is "C:\Program Files"
+win32 {
+	target.path = "\tspsg"
+	share.path = "\tspsg"
+	share.files = COPYING README
+	i18n.path = "\tspsg\i18n"
+	i18n.files = i18n\languages.ini i18n\*.qm
+	docs.path = "\tspsg\help"
+#	docs.files = docs\*
+	INSTALLS += target i18n docs share
+}
+
+# TODO: MacOSX
+
+# For wince: we are deploying to \Storage Card\Program Files\tspsg.
+wince {
+	deploy.path = "\Storage Card\Program Files\tspsg"
+	share.sources = COPYING README
+	share.path = "\Storage Card\Program Files\tspsg"
+	i18n.sources = i18n\languages.ini i18n\*.qm
+	i18n.path = "\Storage Card\Program Files\tspsg\i18n"
+#	docs.sources = docs\*
+#	docs.path = "\Storage Card\Program Files\tspsg\help"
+	DEPLOYMENT += deploy share i18n # docs
+}
 
 #Windows resource file
Index: /trunk/ui/settingsdialog.ui
===================================================================
--- /trunk/ui/settingsdialog.ui	(revision 56)
+++ /trunk/ui/settingsdialog.ui	(revision 57)
@@ -7,6 +7,6 @@
     <x>0</x>
     <y>0</y>
-    <width>243</width>
-    <height>174</height>
+    <width>241</width>
+    <height>182</height>
    </rect>
   </property>
@@ -22,5 +22,5 @@
     <rect>
      <x>0</x>
-     <y>120</y>
+     <y>130</y>
      <width>241</width>
      <height>2</height>
@@ -47,5 +47,5 @@
     <rect>
      <x>0</x>
-     <y>130</y>
+     <y>140</y>
      <width>241</width>
      <height>41</height>
@@ -256,5 +256,5 @@
      <y>0</y>
      <width>239</width>
-     <height>111</height>
+     <height>121</height>
     </rect>
    </property>
@@ -364,10 +364,4 @@
          <property name="statusTip">
           <string>Minimum for random number generation</string>
-         </property>
-         <property name="maximum">
-          <number>1000</number>
-         </property>
-         <property name="value">
-          <number>1</number>
          </property>
         </widget>
@@ -401,13 +395,4 @@
           <string>Maximum for random number generation</string>
          </property>
-         <property name="minimum">
-          <number>1</number>
-         </property>
-         <property name="maximum">
-          <number>1000</number>
-         </property>
-         <property name="value">
-          <number>10</number>
-         </property>
         </widget>
        </item>
@@ -475,4 +460,20 @@
     </widget>
    </widget>
+   <widget class="QCheckBox" name="cbAutosize">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>90</y>
+      <width>247</width>
+      <height>19</height>
+     </rect>
+    </property>
+    <property name="statusTip">
+     <string>Automatically resize rows and columns when content changes</string>
+    </property>
+    <property name="text">
+     <string>Automatically resize rows and columns</string>
+    </property>
+   </widget>
   </widget>
  </widget>
