Index: /trunk/README
===================================================================
--- /trunk/README	(revision 46)
+++ /trunk/README	(revision 47)
@@ -5,17 +5,16 @@
 $URL$
 
-This software is intended to generate and solve Travelling
-Salesman Problem (TSP) tasks. It uses Branch and Bound method
-for solving. An input is a number of cities and a matrix of
-city-to-city travel prices. The matrix can be populated with
-random values in a given range (useful for generating tasks).
-The result is an optimal route, its price, step-by-step matrices
-of solving and solving graph. The task can be saved in internal
-binary format and opened later. The result can be printed without
-the answer (only input matrix) or with it.
+TSPSG is intended to generate and solve Travelling Salesman Problem
+(TSP) tasks. It uses Branch and Bound method for solving. An input
+is number of cities and matrix of city-to-city travel prices.
+The matrix can be populated with random values in a given range
+(useful for generating tasks). The result is an optimal route, its
+price, step-by-step matrices of solving and solving graph. The task
+can be saved in internal binary format and opened later. The result
+can be printed without the answer (only input matrix) or with it.
 
-TSPSG may be useful for teachers to generate tasks for tests or
-just for regular users to solve TSPs. It is also may be used as an
-example of using Branch and bound method to solve particular task.
+TSPSG may be useful for teachers to generate test tasks or just for
+regular users to solve TSPs. Also, it may be used as an example of
+using Branch and bound method to solve particular task.
 
 TSPSG is free software: you can redistribute it and/or modify it
Index: /trunk/i18n/en.ts
===================================================================
--- /trunk/i18n/en.ts	(revision 46)
+++ /trunk/i18n/en.ts	(revision 47)
@@ -33,9 +33,9 @@
         <location filename="../src/tspmodel.cpp" line="152"/>
         <location filename="../src/tspmodel.cpp" line="160"/>
-        <location filename="../src/tspmodel.cpp" line="175"/>
-        <location filename="../src/tspmodel.cpp" line="191"/>
-        <location filename="../src/tspmodel.cpp" line="204"/>
-        <location filename="../src/tspmodel.cpp" line="234"/>
-        <location filename="../src/tspmodel.cpp" line="243"/>
+        <location filename="../src/tspmodel.cpp" line="181"/>
+        <location filename="../src/tspmodel.cpp" line="201"/>
+        <location filename="../src/tspmodel.cpp" line="214"/>
+        <location filename="../src/tspmodel.cpp" line="245"/>
+        <location filename="../src/tspmodel.cpp" line="254"/>
         <source>Task Load</source>
         <translation type="unfinished"></translation>
@@ -43,9 +43,9 @@
     <message>
         <location filename="../src/tspmodel.cpp" line="152"/>
-        <location filename="../src/tspmodel.cpp" line="175"/>
-        <location filename="../src/tspmodel.cpp" line="191"/>
-        <location filename="../src/tspmodel.cpp" line="204"/>
-        <location filename="../src/tspmodel.cpp" line="234"/>
-        <location filename="../src/tspmodel.cpp" line="243"/>
+        <location filename="../src/tspmodel.cpp" line="181"/>
+        <location filename="../src/tspmodel.cpp" line="201"/>
+        <location filename="../src/tspmodel.cpp" line="214"/>
+        <location filename="../src/tspmodel.cpp" line="245"/>
+        <location filename="../src/tspmodel.cpp" line="254"/>
         <source>Unable to load task:</source>
         <translation type="unfinished"></translation>
@@ -58,11 +58,11 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="175"/>
+        <location filename="../src/tspmodel.cpp" line="181"/>
         <source>Unknown file format or file is corrupted.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="191"/>
-        <location filename="../src/tspmodel.cpp" line="234"/>
+        <location filename="../src/tspmodel.cpp" line="201"/>
+        <location filename="../src/tspmodel.cpp" line="245"/>
         <source>File version is newer than application supports.
 Please, try to update application.</source>
@@ -70,6 +70,6 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="204"/>
-        <location filename="../src/tspmodel.cpp" line="243"/>
+        <location filename="../src/tspmodel.cpp" line="214"/>
+        <location filename="../src/tspmodel.cpp" line="254"/>
         <source>Unexpected data read.
 File is possibly corrupted.</source>
@@ -77,17 +77,17 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="273"/>
-        <location filename="../src/tspmodel.cpp" line="279"/>
-        <location filename="../src/tspmodel.cpp" line="286"/>
-        <location filename="../src/tspmodel.cpp" line="293"/>
-        <location filename="../src/tspmodel.cpp" line="300"/>
-        <location filename="../src/tspmodel.cpp" line="307"/>
-        <location filename="../src/tspmodel.cpp" line="314"/>
-        <location filename="../src/tspmodel.cpp" line="324"/>
+        <location filename="../src/tspmodel.cpp" line="285"/>
+        <location filename="../src/tspmodel.cpp" line="291"/>
+        <location filename="../src/tspmodel.cpp" line="298"/>
+        <location filename="../src/tspmodel.cpp" line="305"/>
+        <location filename="../src/tspmodel.cpp" line="312"/>
+        <location filename="../src/tspmodel.cpp" line="319"/>
+        <location filename="../src/tspmodel.cpp" line="326"/>
+        <location filename="../src/tspmodel.cpp" line="336"/>
         <source>Task Save</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="273"/>
+        <location filename="../src/tspmodel.cpp" line="285"/>
         <source>Unable to create task file.
 Error: %1
@@ -96,11 +96,11 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="279"/>
-        <location filename="../src/tspmodel.cpp" line="286"/>
-        <location filename="../src/tspmodel.cpp" line="293"/>
-        <location filename="../src/tspmodel.cpp" line="300"/>
-        <location filename="../src/tspmodel.cpp" line="307"/>
-        <location filename="../src/tspmodel.cpp" line="314"/>
-        <location filename="../src/tspmodel.cpp" line="324"/>
+        <location filename="../src/tspmodel.cpp" line="291"/>
+        <location filename="../src/tspmodel.cpp" line="298"/>
+        <location filename="../src/tspmodel.cpp" line="305"/>
+        <location filename="../src/tspmodel.cpp" line="312"/>
+        <location filename="../src/tspmodel.cpp" line="319"/>
+        <location filename="../src/tspmodel.cpp" line="326"/>
+        <location filename="../src/tspmodel.cpp" line="336"/>
         <source>Unable to save task.
 Error: %1</source>
@@ -139,72 +139,70 @@
     <name>MainWindow</name>
     <message>
-        <location filename="../src/mainwindow.cpp" line="141"/>
-        <location filename="../src/mainwindow.cpp" line="439"/>
-        <location filename="../src/mainwindow.cpp" line="448"/>
+        <location filename="../src/mainwindow.cpp" line="146"/>
+        <location filename="../src/mainwindow.cpp" line="492"/>
+        <location filename="../src/mainwindow.cpp" line="501"/>
         <source>Language change</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="141"/>
+        <location filename="../src/mainwindow.cpp" line="146"/>
         <source>Unable to load translation language.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="181"/>
-        <source>New Task</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="181"/>
-        <location filename="../src/mainwindow.cpp" line="195"/>
-        <location filename="../src/mainwindow.cpp" line="462"/>
+        <location filename="../src/mainwindow.cpp" line="192"/>
         <source>Would you like to save changes in current task?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="195"/>
-        <source>Task Open</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="202"/>
+        <location filename="../src/mainwindow.cpp" line="170"/>
+        <source>Travelling Salesman Problem</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../src/mainwindow.cpp" line="192"/>
+        <source>Unsaved Changes</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../src/mainwindow.cpp" line="224"/>
         <source>All Supported Formats</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="203"/>
-        <location filename="../src/mainwindow.cpp" line="204"/>
+        <location filename="../src/mainwindow.cpp" line="225"/>
+        <location filename="../src/mainwindow.cpp" line="226"/>
         <source>%1 Task Files</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="205"/>
-        <location filename="../src/mainwindow.cpp" line="232"/>
-        <location filename="../src/mainwindow.cpp" line="251"/>
+        <location filename="../src/mainwindow.cpp" line="227"/>
+        <location filename="../src/mainwindow.cpp" line="267"/>
+        <location filename="../src/mainwindow.cpp" line="296"/>
         <source>All Files</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="230"/>
+        <location filename="../src/mainwindow.cpp" line="263"/>
         <source>HTML Files</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="231"/>
+        <location filename="../src/mainwindow.cpp" line="265"/>
         <source>OpenDocument Files</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="250"/>
+        <location filename="../src/mainwindow.cpp" line="295"/>
         <source>%1 Task File</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="273"/>
+        <location filename="../src/mainwindow.cpp" line="326"/>
         <source>Settings Changed</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="273"/>
+        <location filename="../src/mainwindow.cpp" line="326"/>
         <source>You have changed color settings.
 Do you wish to apply them to current solution text?</source>
@@ -212,56 +210,56 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="337"/>
+        <location filename="../src/mainwindow.cpp" line="390"/>
         <source>Data error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="337"/>
+        <location filename="../src/mainwindow.cpp" line="390"/>
         <source>Error in cell [Row %1; Column %2]: Invalid data format.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="350"/>
+        <location filename="../src/mainwindow.cpp" line="403"/>
         <source>Variant #%1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="351"/>
+        <location filename="../src/mainwindow.cpp" line="404"/>
         <source>Task:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="354"/>
-        <location filename="../src/mainwindow.cpp" line="380"/>
+        <location filename="../src/mainwindow.cpp" line="407"/>
+        <location filename="../src/mainwindow.cpp" line="433"/>
         <source>Solution of Variant #%1 task</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="361"/>
+        <location filename="../src/mainwindow.cpp" line="414"/>
         <source>Step #%1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="364"/>
+        <location filename="../src/mainwindow.cpp" line="417"/>
         <source>This step has alternate candidates for branching.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="376"/>
+        <location filename="../src/mainwindow.cpp" line="429"/>
         <source>Optimal path:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="378"/>
+        <location filename="../src/mainwindow.cpp" line="431"/>
         <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="439"/>
+        <location filename="../src/mainwindow.cpp" line="492"/>
         <source>Language will be autodetected on next application start.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="448"/>
+        <location filename="../src/mainwindow.cpp" line="501"/>
         <source>You have language autodetection turned on.
 It needs to be off.
@@ -270,6 +268,7 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="462"/>
-        <source>Application Close</source>
+        <location filename="../src/mainwindow.cpp" line="506"/>
+        <location filename="../src/mainwindow.h" line="76"/>
+        <source>Untitled</source>
         <translation type="unfinished"></translation>
     </message>
Index: /trunk/i18n/ru.ts
===================================================================
--- /trunk/i18n/ru.ts	(revision 46)
+++ /trunk/i18n/ru.ts	(revision 47)
@@ -34,9 +34,9 @@
         <location filename="../src/tspmodel.cpp" line="152"/>
         <location filename="../src/tspmodel.cpp" line="160"/>
-        <location filename="../src/tspmodel.cpp" line="175"/>
-        <location filename="../src/tspmodel.cpp" line="191"/>
-        <location filename="../src/tspmodel.cpp" line="204"/>
-        <location filename="../src/tspmodel.cpp" line="234"/>
-        <location filename="../src/tspmodel.cpp" line="243"/>
+        <location filename="../src/tspmodel.cpp" line="181"/>
+        <location filename="../src/tspmodel.cpp" line="201"/>
+        <location filename="../src/tspmodel.cpp" line="214"/>
+        <location filename="../src/tspmodel.cpp" line="245"/>
+        <location filename="../src/tspmodel.cpp" line="254"/>
         <source>Task Load</source>
         <translation>Загрузка условия</translation>
@@ -44,9 +44,9 @@
     <message>
         <location filename="../src/tspmodel.cpp" line="152"/>
-        <location filename="../src/tspmodel.cpp" line="175"/>
-        <location filename="../src/tspmodel.cpp" line="191"/>
-        <location filename="../src/tspmodel.cpp" line="204"/>
-        <location filename="../src/tspmodel.cpp" line="234"/>
-        <location filename="../src/tspmodel.cpp" line="243"/>
+        <location filename="../src/tspmodel.cpp" line="181"/>
+        <location filename="../src/tspmodel.cpp" line="201"/>
+        <location filename="../src/tspmodel.cpp" line="214"/>
+        <location filename="../src/tspmodel.cpp" line="245"/>
+        <location filename="../src/tspmodel.cpp" line="254"/>
         <source>Unable to load task:</source>
         <translation>Невозможно загрузить условие:</translation>
@@ -60,11 +60,11 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="175"/>
+        <location filename="../src/tspmodel.cpp" line="181"/>
         <source>Unknown file format or file is corrupted.</source>
         <translation>Неизвестный формат файла или файл поврежден.</translation>
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="191"/>
-        <location filename="../src/tspmodel.cpp" line="234"/>
+        <location filename="../src/tspmodel.cpp" line="201"/>
+        <location filename="../src/tspmodel.cpp" line="245"/>
         <source>File version is newer than application supports.
 Please, try to update application.</source>
@@ -73,6 +73,6 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="204"/>
-        <location filename="../src/tspmodel.cpp" line="243"/>
+        <location filename="../src/tspmodel.cpp" line="214"/>
+        <location filename="../src/tspmodel.cpp" line="254"/>
         <source>Unexpected data read.
 File is possibly corrupted.</source>
@@ -81,17 +81,17 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="273"/>
-        <location filename="../src/tspmodel.cpp" line="279"/>
-        <location filename="../src/tspmodel.cpp" line="286"/>
-        <location filename="../src/tspmodel.cpp" line="293"/>
-        <location filename="../src/tspmodel.cpp" line="300"/>
-        <location filename="../src/tspmodel.cpp" line="307"/>
-        <location filename="../src/tspmodel.cpp" line="314"/>
-        <location filename="../src/tspmodel.cpp" line="324"/>
+        <location filename="../src/tspmodel.cpp" line="285"/>
+        <location filename="../src/tspmodel.cpp" line="291"/>
+        <location filename="../src/tspmodel.cpp" line="298"/>
+        <location filename="../src/tspmodel.cpp" line="305"/>
+        <location filename="../src/tspmodel.cpp" line="312"/>
+        <location filename="../src/tspmodel.cpp" line="319"/>
+        <location filename="../src/tspmodel.cpp" line="326"/>
+        <location filename="../src/tspmodel.cpp" line="336"/>
         <source>Task Save</source>
         <translation>Сохранение условия</translation>
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="273"/>
+        <location filename="../src/tspmodel.cpp" line="285"/>
         <source>Unable to create task file.
 Error: %1
@@ -102,11 +102,11 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="279"/>
-        <location filename="../src/tspmodel.cpp" line="286"/>
-        <location filename="../src/tspmodel.cpp" line="293"/>
-        <location filename="../src/tspmodel.cpp" line="300"/>
-        <location filename="../src/tspmodel.cpp" line="307"/>
-        <location filename="../src/tspmodel.cpp" line="314"/>
-        <location filename="../src/tspmodel.cpp" line="324"/>
+        <location filename="../src/tspmodel.cpp" line="291"/>
+        <location filename="../src/tspmodel.cpp" line="298"/>
+        <location filename="../src/tspmodel.cpp" line="305"/>
+        <location filename="../src/tspmodel.cpp" line="312"/>
+        <location filename="../src/tspmodel.cpp" line="319"/>
+        <location filename="../src/tspmodel.cpp" line="326"/>
+        <location filename="../src/tspmodel.cpp" line="336"/>
         <source>Unable to save task.
 Error: %1</source>
@@ -146,72 +146,70 @@
     <name>MainWindow</name>
     <message>
-        <location filename="../src/mainwindow.cpp" line="141"/>
-        <location filename="../src/mainwindow.cpp" line="439"/>
-        <location filename="../src/mainwindow.cpp" line="448"/>
+        <location filename="../src/mainwindow.cpp" line="146"/>
+        <location filename="../src/mainwindow.cpp" line="492"/>
+        <location filename="../src/mainwindow.cpp" line="501"/>
         <source>Language change</source>
         <translation>Смена языка</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="141"/>
+        <location filename="../src/mainwindow.cpp" line="146"/>
         <source>Unable to load translation language.</source>
         <translation>Невозможно загрузить перевод.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="202"/>
+        <location filename="../src/mainwindow.cpp" line="170"/>
+        <source>Travelling Salesman Problem</source>
+        <translation>Задача коммивояжера</translation>
+    </message>
+    <message>
+        <location filename="../src/mainwindow.cpp" line="192"/>
+        <source>Unsaved Changes</source>
+        <translation>Несохраненные изменения</translation>
+    </message>
+    <message>
+        <location filename="../src/mainwindow.cpp" line="224"/>
         <source>All Supported Formats</source>
         <translation>Все поддерживаемые форматы</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="205"/>
-        <location filename="../src/mainwindow.cpp" line="232"/>
-        <location filename="../src/mainwindow.cpp" line="251"/>
+        <location filename="../src/mainwindow.cpp" line="227"/>
+        <location filename="../src/mainwindow.cpp" line="267"/>
+        <location filename="../src/mainwindow.cpp" line="296"/>
         <source>All Files</source>
         <translation>Все файлы</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="203"/>
-        <location filename="../src/mainwindow.cpp" line="204"/>
+        <location filename="../src/mainwindow.cpp" line="225"/>
+        <location filename="../src/mainwindow.cpp" line="226"/>
         <source>%1 Task Files</source>
         <translation>Файлы условий %1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="181"/>
-        <source>New Task</source>
-        <translation>Создать задачу</translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="181"/>
-        <location filename="../src/mainwindow.cpp" line="195"/>
-        <location filename="../src/mainwindow.cpp" line="462"/>
+        <location filename="../src/mainwindow.cpp" line="192"/>
         <source>Would you like to save changes in current task?</source>
         <translation>Желаете сохранить изменения в текущей задаче?</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="195"/>
-        <source>Task Open</source>
-        <translation>Открытие задания</translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="230"/>
+        <location filename="../src/mainwindow.cpp" line="263"/>
         <source>HTML Files</source>
         <translation>Файлы HTML</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="231"/>
+        <location filename="../src/mainwindow.cpp" line="265"/>
         <source>OpenDocument Files</source>
         <translation>Файлы OpenDocument</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="250"/>
+        <location filename="../src/mainwindow.cpp" line="295"/>
         <source>%1 Task File</source>
         <translation>Файл условия %1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="273"/>
+        <location filename="../src/mainwindow.cpp" line="326"/>
         <source>Settings Changed</source>
         <translation>Параметры изменены</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="273"/>
+        <location filename="../src/mainwindow.cpp" line="326"/>
         <source>You have changed color settings.
 Do you wish to apply them to current solution text?</source>
@@ -220,56 +218,56 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="337"/>
+        <location filename="../src/mainwindow.cpp" line="390"/>
         <source>Data error</source>
         <translation>Ошибка в данных</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="337"/>
+        <location filename="../src/mainwindow.cpp" line="390"/>
         <source>Error in cell [Row %1; Column %2]: Invalid data format.</source>
         <translation>Ошибка в ячейке [Строка %1; Колонка %2]: Неверный формат данных.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="350"/>
+        <location filename="../src/mainwindow.cpp" line="403"/>
         <source>Variant #%1</source>
         <translation>Вариант №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="351"/>
+        <location filename="../src/mainwindow.cpp" line="404"/>
         <source>Task:</source>
         <translation>Условие:</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="354"/>
-        <location filename="../src/mainwindow.cpp" line="380"/>
+        <location filename="../src/mainwindow.cpp" line="407"/>
+        <location filename="../src/mainwindow.cpp" line="433"/>
         <source>Solution of Variant #%1 task</source>
         <translation>Решение варианта №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="361"/>
+        <location filename="../src/mainwindow.cpp" line="414"/>
         <source>Step #%1</source>
         <translation>Шаг №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="364"/>
+        <location filename="../src/mainwindow.cpp" line="417"/>
         <source>This step has alternate candidates for branching.</source>
         <translation>У этого шага есть альтернативные кандидаты на ветвление.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="376"/>
+        <location filename="../src/mainwindow.cpp" line="429"/>
         <source>Optimal path:</source>
         <translation>Оптимальный путь:</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="378"/>
+        <location filename="../src/mainwindow.cpp" line="431"/>
         <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="439"/>
+        <location filename="../src/mainwindow.cpp" line="492"/>
         <source>Language will be autodetected on next application start.</source>
         <translation>Язык будет автоматически определен при следующем запуске приложения.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="448"/>
+        <location filename="../src/mainwindow.cpp" line="501"/>
         <source>You have language autodetection turned on.
 It needs to be off.
@@ -280,7 +278,8 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="462"/>
-        <source>Application Close</source>
-        <translation>Закрытие приложения</translation>
+        <location filename="../src/mainwindow.cpp" line="506"/>
+        <location filename="../src/mainwindow.h" line="76"/>
+        <source>Untitled</source>
+        <translation>Без имени</translation>
     </message>
     <message>
Index: /trunk/i18n/uk.ts
===================================================================
--- /trunk/i18n/uk.ts	(revision 46)
+++ /trunk/i18n/uk.ts	(revision 47)
@@ -34,9 +34,9 @@
         <location filename="../src/tspmodel.cpp" line="152"/>
         <location filename="../src/tspmodel.cpp" line="160"/>
-        <location filename="../src/tspmodel.cpp" line="175"/>
-        <location filename="../src/tspmodel.cpp" line="191"/>
-        <location filename="../src/tspmodel.cpp" line="204"/>
-        <location filename="../src/tspmodel.cpp" line="234"/>
-        <location filename="../src/tspmodel.cpp" line="243"/>
+        <location filename="../src/tspmodel.cpp" line="181"/>
+        <location filename="../src/tspmodel.cpp" line="201"/>
+        <location filename="../src/tspmodel.cpp" line="214"/>
+        <location filename="../src/tspmodel.cpp" line="245"/>
+        <location filename="../src/tspmodel.cpp" line="254"/>
         <source>Task Load</source>
         <translation>Завантаження умови</translation>
@@ -44,9 +44,9 @@
     <message>
         <location filename="../src/tspmodel.cpp" line="152"/>
-        <location filename="../src/tspmodel.cpp" line="175"/>
-        <location filename="../src/tspmodel.cpp" line="191"/>
-        <location filename="../src/tspmodel.cpp" line="204"/>
-        <location filename="../src/tspmodel.cpp" line="234"/>
-        <location filename="../src/tspmodel.cpp" line="243"/>
+        <location filename="../src/tspmodel.cpp" line="181"/>
+        <location filename="../src/tspmodel.cpp" line="201"/>
+        <location filename="../src/tspmodel.cpp" line="214"/>
+        <location filename="../src/tspmodel.cpp" line="245"/>
+        <location filename="../src/tspmodel.cpp" line="254"/>
         <source>Unable to load task:</source>
         <translation>Неможливо завантажити умову:</translation>
@@ -60,11 +60,11 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="175"/>
+        <location filename="../src/tspmodel.cpp" line="181"/>
         <source>Unknown file format or file is corrupted.</source>
         <translation>Невідомий формат файлу або файл пошкоджено.</translation>
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="191"/>
-        <location filename="../src/tspmodel.cpp" line="234"/>
+        <location filename="../src/tspmodel.cpp" line="201"/>
+        <location filename="../src/tspmodel.cpp" line="245"/>
         <source>File version is newer than application supports.
 Please, try to update application.</source>
@@ -73,6 +73,6 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="204"/>
-        <location filename="../src/tspmodel.cpp" line="243"/>
+        <location filename="../src/tspmodel.cpp" line="214"/>
+        <location filename="../src/tspmodel.cpp" line="254"/>
         <source>Unexpected data read.
 File is possibly corrupted.</source>
@@ -81,17 +81,17 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="273"/>
-        <location filename="../src/tspmodel.cpp" line="279"/>
-        <location filename="../src/tspmodel.cpp" line="286"/>
-        <location filename="../src/tspmodel.cpp" line="293"/>
-        <location filename="../src/tspmodel.cpp" line="300"/>
-        <location filename="../src/tspmodel.cpp" line="307"/>
-        <location filename="../src/tspmodel.cpp" line="314"/>
-        <location filename="../src/tspmodel.cpp" line="324"/>
+        <location filename="../src/tspmodel.cpp" line="285"/>
+        <location filename="../src/tspmodel.cpp" line="291"/>
+        <location filename="../src/tspmodel.cpp" line="298"/>
+        <location filename="../src/tspmodel.cpp" line="305"/>
+        <location filename="../src/tspmodel.cpp" line="312"/>
+        <location filename="../src/tspmodel.cpp" line="319"/>
+        <location filename="../src/tspmodel.cpp" line="326"/>
+        <location filename="../src/tspmodel.cpp" line="336"/>
         <source>Task Save</source>
         <translation>Збереження умови</translation>
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="273"/>
+        <location filename="../src/tspmodel.cpp" line="285"/>
         <source>Unable to create task file.
 Error: %1
@@ -102,11 +102,11 @@
     </message>
     <message>
-        <location filename="../src/tspmodel.cpp" line="279"/>
-        <location filename="../src/tspmodel.cpp" line="286"/>
-        <location filename="../src/tspmodel.cpp" line="293"/>
-        <location filename="../src/tspmodel.cpp" line="300"/>
-        <location filename="../src/tspmodel.cpp" line="307"/>
-        <location filename="../src/tspmodel.cpp" line="314"/>
-        <location filename="../src/tspmodel.cpp" line="324"/>
+        <location filename="../src/tspmodel.cpp" line="291"/>
+        <location filename="../src/tspmodel.cpp" line="298"/>
+        <location filename="../src/tspmodel.cpp" line="305"/>
+        <location filename="../src/tspmodel.cpp" line="312"/>
+        <location filename="../src/tspmodel.cpp" line="319"/>
+        <location filename="../src/tspmodel.cpp" line="326"/>
+        <location filename="../src/tspmodel.cpp" line="336"/>
         <source>Unable to save task.
 Error: %1</source>
@@ -578,72 +578,70 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="141"/>
-        <location filename="../src/mainwindow.cpp" line="439"/>
-        <location filename="../src/mainwindow.cpp" line="448"/>
+        <location filename="../src/mainwindow.cpp" line="146"/>
+        <location filename="../src/mainwindow.cpp" line="492"/>
+        <location filename="../src/mainwindow.cpp" line="501"/>
         <source>Language change</source>
         <translation>Зміна мови</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="141"/>
+        <location filename="../src/mainwindow.cpp" line="146"/>
         <source>Unable to load translation language.</source>
         <translation>Неможливо завантажити переклад.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="202"/>
+        <location filename="../src/mainwindow.cpp" line="170"/>
+        <source>Travelling Salesman Problem</source>
+        <translation>Задача комівояжера</translation>
+    </message>
+    <message>
+        <location filename="../src/mainwindow.cpp" line="192"/>
+        <source>Unsaved Changes</source>
+        <translation>Незбережені зміни</translation>
+    </message>
+    <message>
+        <location filename="../src/mainwindow.cpp" line="224"/>
         <source>All Supported Formats</source>
         <translation>Усі підтримувані формати</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="205"/>
-        <location filename="../src/mainwindow.cpp" line="232"/>
-        <location filename="../src/mainwindow.cpp" line="251"/>
+        <location filename="../src/mainwindow.cpp" line="227"/>
+        <location filename="../src/mainwindow.cpp" line="267"/>
+        <location filename="../src/mainwindow.cpp" line="296"/>
         <source>All Files</source>
         <translation>Усі файли</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="203"/>
-        <location filename="../src/mainwindow.cpp" line="204"/>
+        <location filename="../src/mainwindow.cpp" line="225"/>
+        <location filename="../src/mainwindow.cpp" line="226"/>
         <source>%1 Task Files</source>
         <translation>Файли умов %1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="181"/>
-        <source>New Task</source>
-        <translation>Нова задача</translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="181"/>
-        <location filename="../src/mainwindow.cpp" line="195"/>
-        <location filename="../src/mainwindow.cpp" line="462"/>
+        <location filename="../src/mainwindow.cpp" line="192"/>
         <source>Would you like to save changes in current task?</source>
         <translation>Бажаете зберегти зміни у поточній задачі?</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="195"/>
-        <source>Task Open</source>
-        <translation>Відкриття завдання</translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="230"/>
+        <location filename="../src/mainwindow.cpp" line="263"/>
         <source>HTML Files</source>
         <translation>Файли HTML</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="231"/>
+        <location filename="../src/mainwindow.cpp" line="265"/>
         <source>OpenDocument Files</source>
         <translation>Файли OpenDocument</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="250"/>
+        <location filename="../src/mainwindow.cpp" line="295"/>
         <source>%1 Task File</source>
         <translation>Файл умови %1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="273"/>
+        <location filename="../src/mainwindow.cpp" line="326"/>
         <source>Settings Changed</source>
         <translation>Параметри змінено</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="273"/>
+        <location filename="../src/mainwindow.cpp" line="326"/>
         <source>You have changed color settings.
 Do you wish to apply them to current solution text?</source>
@@ -652,56 +650,56 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="337"/>
+        <location filename="../src/mainwindow.cpp" line="390"/>
         <source>Data error</source>
         <translation>Помилка у даних</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="337"/>
+        <location filename="../src/mainwindow.cpp" line="390"/>
         <source>Error in cell [Row %1; Column %2]: Invalid data format.</source>
         <translation>Помилка у комірці  [Рядок %1; Колонка %2]: Невірний формат даних.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="350"/>
+        <location filename="../src/mainwindow.cpp" line="403"/>
         <source>Variant #%1</source>
         <translation>Варіант №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="351"/>
+        <location filename="../src/mainwindow.cpp" line="404"/>
         <source>Task:</source>
         <translation>Умова:</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="354"/>
-        <location filename="../src/mainwindow.cpp" line="380"/>
+        <location filename="../src/mainwindow.cpp" line="407"/>
+        <location filename="../src/mainwindow.cpp" line="433"/>
         <source>Solution of Variant #%1 task</source>
         <translation>Розв&apos;язок варіанту №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="361"/>
+        <location filename="../src/mainwindow.cpp" line="414"/>
         <source>Step #%1</source>
         <translation>Крок №%1</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="364"/>
+        <location filename="../src/mainwindow.cpp" line="417"/>
         <source>This step has alternate candidates for branching.</source>
         <translation>У цьому кроці є альтернативні кандидати на розгалудження.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="376"/>
+        <location filename="../src/mainwindow.cpp" line="429"/>
         <source>Optimal path:</source>
         <translation>Оптимальний шлях:</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="378"/>
+        <location filename="../src/mainwindow.cpp" line="431"/>
         <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="439"/>
+        <location filename="../src/mainwindow.cpp" line="492"/>
         <source>Language will be autodetected on next application start.</source>
         <translation>Мову буде автоматично визначено при наступному запуску додатку.</translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="448"/>
+        <location filename="../src/mainwindow.cpp" line="501"/>
         <source>You have language autodetection turned on.
 It needs to be off.
@@ -712,7 +710,8 @@
     </message>
     <message>
-        <location filename="../src/mainwindow.cpp" line="462"/>
-        <source>Application Close</source>
-        <translation>Закриття додатку</translation>
+        <location filename="../src/mainwindow.cpp" line="506"/>
+        <location filename="../src/mainwindow.h" line="76"/>
+        <source>Untitled</source>
+        <translation>Без імені</translation>
     </message>
 </context>
Index: /trunk/src/mainwindow.cpp
===================================================================
--- /trunk/src/mainwindow.cpp	(revision 46)
+++ /trunk/src/mainwindow.cpp	(revision 47)
@@ -87,8 +87,9 @@
 	connect(tspmodel,SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),this,SLOT(dataChanged()));
 	connect(tspmodel,SIGNAL(layoutChanged()),this,SLOT(dataChanged()));
-	if (QCoreApplication::arguments().count() > 1) {
-		tspmodel->loadTask(QCoreApplication::arguments().at(1));
+	if ((QCoreApplication::arguments().count() > 1) && (tspmodel->loadTask(QCoreApplication::arguments().at(1)))) {
+		setFileName(QCoreApplication::arguments().at(1));
 		setWindowModified(false);
-	}
+	} else
+		setFileName();
 #ifdef Q_OS_WINCE
 	taskView->resizeColumnsToContents();
@@ -164,4 +165,10 @@
 }
 
+void MainWindow::setFileName(QString fileName)
+{
+	this->fileName = fileName;
+	setWindowTitle(QString("%1[*] - %2").arg(QFileInfo(fileName).completeBaseName()).arg(trUtf8("Travelling Salesman Problem")));
+}
+
 void MainWindow::spinCitiesValueChanged(int n)
 {
@@ -179,13 +186,27 @@
 }
 
+bool MainWindow::maybeSave()
+{
+	if (!isWindowModified())
+		return true;
+int res = QMessageBox(QMessageBox::Warning,trUtf8("Unsaved Changes"),trUtf8("Would you like to save changes in current task?"),QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel,this).exec();
+	if (res == QMessageBox::Save)
+		return saveTask();
+	else if (res == QMessageBox::Cancel)
+		return false;
+	else
+		return true;
+}
 
 void MainWindow::actionFileNewTriggered()
 {
-	if (isWindowModified()) {
-int res = QMessageBox(QMessageBox::Warning,trUtf8("New Task"),trUtf8("Would you like to save changes in current task?"),QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,this).exec();
-		if ((res == QMessageBox::Cancel) || ((res == QMessageBox::Yes) && !saveTask()))
-			return;
-	}
+	if (!maybeSave())
+		return;
 	tspmodel->clear();
+#ifdef Q_OS_WINCE
+	taskView->resizeColumnsToContents();
+	taskView->resizeRowsToContents();
+#endif
+	setFileName();
 	setWindowModified(false);
 	tabWidget->setCurrentIndex(0);
@@ -196,15 +217,12 @@
 void MainWindow::actionFileOpenTriggered()
 {
-	if (isWindowModified()) {
-int res = QMessageBox(QMessageBox::Warning,trUtf8("Task Open"),trUtf8("Would you like to save changes in current task?"),QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,this).exec();
-		if ((res == QMessageBox::Cancel) || ((res == QMessageBox::Yes) && !saveTask()))
-			return;
-	}
+	if (!maybeSave())
+		return;
 QFileDialog od(this);
 	od.setAcceptMode(QFileDialog::AcceptOpen);
 	od.setFileMode(QFileDialog::ExistingFile);
 QStringList filters(trUtf8("All Supported Formats") + " (*.tspt *.zkt)");
-	filters.append(QString(trUtf8("%1 Task Files")).arg("TSPSG") + " (*.tspt)");
-	filters.append(QString(trUtf8("%1 Task Files")).arg("ZKomModRd") + " (*.zkt)");
+	filters.append(trUtf8("%1 Task Files").arg("TSPSG") + " (*.tspt)");
+	filters.append(trUtf8("%1 Task Files").arg("ZKomModRd") + " (*.zkt)");
 	filters.append(trUtf8("All Files") + " (*)");
 	od.setNameFilters(filters);
@@ -212,10 +230,21 @@
 		return;
 QStringList files = od.selectedFiles();
-	if (files.size() < 1)
-		return;
-	tspmodel->loadTask(files.first());
+	if (files.empty())
+		return;
+	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+	if (!tspmodel->loadTask(files.first())) {
+		QApplication::restoreOverrideCursor();
+		return;
+	}
+	setFileName(files.first());
+#ifdef Q_OS_WINCE
+	taskView->resizeColumnsToContents();
+	taskView->resizeRowsToContents();
+#endif
+	tabWidget->setCurrentIndex(0);
 	setWindowModified(false);
 	solutionText->clear();
 	enableSolutionActions(false);
+	QApplication::restoreOverrideCursor();
 }
 
@@ -264,18 +293,26 @@
 QFileDialog sd(this);
 	sd.setAcceptMode(QFileDialog::AcceptSave);
-QStringList filters(QString(trUtf8("%1 Task File")).arg("TSPSG") + " (*.tspt)");
+QStringList filters(trUtf8("%1 Task File").arg("TSPSG") + " (*.tspt)");
 	filters.append(trUtf8("All Files") + " (*)");
 	sd.setNameFilters(filters);
 	sd.setDefaultSuffix("tspt");
+	if (fileName.endsWith(".tspt",Qt::CaseInsensitive))
+		sd.selectFile(fileName);
+	else
+		sd.selectFile(QFileInfo(fileName).canonicalPath() + "/" + QFileInfo(fileName).completeBaseName() + ".tspt");
 	if (sd.exec() != QDialog::Accepted)
 		return false;
 QStringList files = sd.selectedFiles();
-	if (files.size() < 1)
+	if (files.empty())
 		return false;
+	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 	if (tspmodel->saveTask(files.first())) {
+		setFileName(files.first());
 		setWindowModified(false);
+		QApplication::restoreOverrideCursor();
 		return true;
-	} else
-		return false;
+	}
+	QApplication::restoreOverrideCursor();
+	return false;
 }
 
@@ -351,5 +388,5 @@
 			row.append(tspmodel->index(r,c).data(Qt::UserRole).toDouble(&ok));
 			if (!ok) {
-				QMessageBox(QMessageBox::Critical,trUtf8("Data error"),QString(trUtf8("Error in cell [Row %1; Column %2]: Invalid data format.")).arg(r + 1).arg(c + 1),QMessageBox::Ok,this).exec();
+				QMessageBox(QMessageBox::Critical,trUtf8("Data error"),trUtf8("Error in cell [Row %1; Column %2]: Invalid data format.").arg(r + 1).arg(c + 1),QMessageBox::Ok,this).exec();
 				return;
 			}
@@ -467,7 +504,10 @@
 			return;
 	}
+bool untitled = (fileName == trUtf8("Untitled") + ".tspt");
 	if (loadLanguage(action->data().toString())) {
 		settings->setValue("Language",action->data().toString());
 		retranslateUi(this);
+		if (untitled)
+			setFileName();
 	}
 }
@@ -475,10 +515,7 @@
 void MainWindow::closeEvent(QCloseEvent *event)
 {
-	if (isWindowModified()) {
-int res = QMessageBox(QMessageBox::Warning,trUtf8("Application Close"),trUtf8("Would you like to save changes in current task?"),QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,this).exec();
-		if ((res == QMessageBox::Cancel) || ((res == QMessageBox::Yes) && !saveTask())) {
-			event->ignore();
-			return;
-		}
+	if (!maybeSave()) {
+		event->ignore();
+		return;
 	}
 	settings->setValue("NumCities",spinCities->value());
Index: /trunk/src/mainwindow.h
===================================================================
--- /trunk/src/mainwindow.h	(revision 46)
+++ /trunk/src/mainwindow.h	(revision 47)
@@ -38,7 +38,9 @@
 {
 	Q_OBJECT
+
 public:
 	MainWindow(QWidget *parent = 0);
 	void closeEvent(QCloseEvent *);
+
 private slots:
 	void actionFileNewTriggered();
@@ -58,16 +60,20 @@
 	void spinCitiesValueChanged(int);
 	void numCitiesChanged(int);
+
 private:
 	QSettings *settings;
 	QPrinter *printer;
 	CTSPModel *tspmodel;
+	QString fileName;
 	QActionGroup *groupSettingsLanguageList;
 	QStringList output;
+	void enableSolutionActions(bool enable = true);
+	void initDocStyleSheet();
 	bool loadLanguage(QString lang = "");
 	void loadLangList();
-	void initDocStyleSheet();
+	bool maybeSave();
+	void outputMatrix(tMatrix, QStringList &, int nRow = -1, int nCol = -1);
+	void setFileName(QString fileName = trUtf8("Untitled") + ".tspt");
 	bool saveTask();
-	void outputMatrix(tMatrix, QStringList &, int nRow = -1, int nCol = -1);
-	void enableSolutionActions(bool enable = true);
 };
 
Index: /trunk/src/tspmodel.cpp
===================================================================
--- /trunk/src/tspmodel.cpp	(revision 46)
+++ /trunk/src/tspmodel.cpp	(revision 47)
@@ -154,10 +154,10 @@
 }
 
-void CTSPModel::loadTask(QString fname)
+bool CTSPModel::loadTask(QString fname)
 {
 QFile f(fname);
 	if (!f.open(QIODevice::ReadOnly)) {
 		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),QString(trUtf8("Unable to open task file.\nError: %1")).arg(f.errorString()),QMessageBox::Ok).exec();
-		return;
+		return false;
 	}
 QDataStream ds(&f);
@@ -166,42 +166,52 @@
 	ds >> sig;
 	if (loadError(ds.status()))
-		return;
+		return false;
 	ds.device()->reset();
 	if (sig == TSPT)
-		loadTSPT(&ds);
+		if (!loadTSPT(&ds)) {
+			f.close();
+			return false;
+		}
 	else if ((sig >> 16) == ZKT)
-		loadZKT(&ds);
-	else
+		if (!loadZKT(&ds)) {
+			f.close();
+			return false;
+		}
+	else {
 		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unknown file format or file is corrupted."),QMessageBox::Ok).exec();
+		f.close();
+		return false;
+	}
 	f.close();
-}
-
-void CTSPModel::loadTSPT(QDataStream *ds)
+	return true;
+}
+
+bool CTSPModel::loadTSPT(QDataStream *ds)
 {
 	// Skipping signature
 	ds->skipRawData(sizeof(TSPT));
 	if (loadError(ds->status()))
-		return;
+		return false;
 	// File version
 quint8 version;
 	*ds >> version;
 	if (loadError(ds->status()))
-		return;
+		return false;
 	if (version > TSPT_VERSION) {
 		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("File version is newer than application supports.\nPlease, try to update application."),QMessageBox::Ok).exec();
-		return;
+		return false;
 	}
 	// Skipping metadata
 	ds->skipRawData(TSPT_META_SIZE);
 	if (loadError(ds->status()))
-		return;
+		return false;
 	// Cities number
 quint16 size;
 	*ds >> size;
 	if (loadError(ds->status()))
-		return;
+		return false;
 	if (size < 3) {
 		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unexpected data read.\nFile is possibly corrupted."),QMessageBox::Ok).exec();
-		return;
+		return false;
 	}
 	if (nCities != size)
@@ -214,24 +224,25 @@
 				if (loadError(ds->status())) {
 					clear();
-					return;
+					return false;
 				}
 			}
 	emit dataChanged(index(0,0),index(nCities - 1,nCities - 1));
-}
-
-void CTSPModel::loadZKT(QDataStream *ds)
+	return true;
+}
+
+bool CTSPModel::loadZKT(QDataStream *ds)
 {
 	// Skipping signature
 	ds->skipRawData(sizeof(ZKT));
 	if (loadError(ds->status()))
-		return;
+		return false;
 	// File version
 quint16 version;
 	ds->readRawData(reinterpret_cast<char *>(&version),2);
 	if (loadError(ds->status()))
-		return;
+		return false;
 	if (version > ZKT_VERSION) {
 		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("File version is newer than application supports.\nPlease, try to update application."),QMessageBox::Ok).exec();
-		return;
+		return false;
 	}
 	// Cities number
@@ -239,8 +250,8 @@
 	ds->readRawData(reinterpret_cast<char *>(&size),1);
 	if (loadError(ds->status()))
-		return;
+		return false;
 	if ((size < 3) || (size > 5)) {
 		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unexpected data read.\nFile is possibly corrupted."),QMessageBox::Ok).exec();
-		return;
+		return false;
 	}
 	if (nCities != size)
@@ -254,5 +265,5 @@
 				if (loadError(ds->status())) {
 					clear();
-					return;
+					return false;
 				}
 				table[r][c] = val;
@@ -261,8 +272,9 @@
 				if (loadError(ds->status())) {
 					clear();
-					return;
+					return false;
 				}
 			}
 	emit dataChanged(index(0,0),index(nCities - 1,nCities - 1));
+	return true;
 }
 
Index: /trunk/src/tspmodel.h
===================================================================
--- /trunk/src/tspmodel.h	(revision 46)
+++ /trunk/src/tspmodel.h	(revision 47)
@@ -30,28 +30,31 @@
 {
 	Q_OBJECT
+
 public:
 	CTSPModel(QObject *parent = 0);
+	void clear();
+	int columnCount(const QModelIndex &) const;
+	QVariant data(const QModelIndex &, int) const;
+	Qt::ItemFlags flags(const QModelIndex &) const;
+	QVariant headerData(int, Qt::Orientation, int) const;
+	bool loadTask(QString);
+	quint16 numCities() const;
+	void randomize();
 	int rowCount(const QModelIndex &) const;
-	int columnCount(const QModelIndex &) const;
-	QVariant headerData(int, Qt::Orientation, int) const;
-	QVariant data(const QModelIndex &, int) const;
+	bool saveTask(QString);
 	bool setData(const QModelIndex &, const QVariant &, int);
-	Qt::ItemFlags flags(const QModelIndex &) const;
-	quint16 numCities() const;
 	void setNumCities(int);
-	void clear();
-	void loadTask(QString);
-	bool saveTask(QString);
-	void randomize();
+
 signals:
 	void numCitiesChanged(int);
+
 private:
 	QSettings *settings;
 	QVector<QVector<double> > table;
 	quint16 nCities;
+	bool loadError(QDataStream::Status);
+	bool loadZKT(QDataStream *);
+	bool loadTSPT(QDataStream *);
 	int rand(int, int) const;
-	bool loadError(QDataStream::Status);
-	void loadZKT(QDataStream *);
-	void loadTSPT(QDataStream *);
 };
 
Index: /trunk/ui/mainwindow.ce.ui
===================================================================
--- /trunk/ui/mainwindow.ce.ui	(revision 46)
+++ /trunk/ui/mainwindow.ce.ui	(revision 47)
@@ -15,9 +15,9 @@
   </property>
   <property name="windowTitle">
-   <string>Travelling salesman problem[*]</string>
+   <string>Travelling Salesman Problem[*]</string>
   </property>
   <property name="windowIcon">
    <iconset resource="../resources/tspsg.qrc">
-    <normaloff>:/images/Icon.png</normaloff>:/images/Icon.png</iconset>
+    <normaloff>:/images/icon.png</normaloff>:/images/icon.png</iconset>
   </property>
   <widget class="QWidget" name="centralwidget">
Index: /trunk/ui/mainwindow.ui
===================================================================
--- /trunk/ui/mainwindow.ui	(revision 46)
+++ /trunk/ui/mainwindow.ui	(revision 47)
@@ -12,9 +12,9 @@
   </property>
   <property name="windowTitle">
-   <string>Travelling salesman problem[*]</string>
+   <string>Travelling Salesman Problem</string>
   </property>
   <property name="windowIcon">
    <iconset resource="../resources/tspsg.qrc">
-    <normaloff>:/images/Icon.png</normaloff>:/images/Icon.png</iconset>
+    <normaloff>:/images/icon.png</normaloff>:/images/icon.png</iconset>
   </property>
   <widget class="QWidget" name="centralwidget">
