Index: src/tspmodel.cpp
===================================================================
--- src/tspmodel.cpp	(revision aaf2113307a1f7e0af077955ae20083a3d6c9128)
+++ src/tspmodel.cpp	(revision 9cf98b9bd69fd56fc84fda74148d5ecab737d145)
@@ -150,4 +150,5 @@
 	else
 		err = trUtf8("Unknown error.");
+	QApplication::restoreOverrideCursor();
 	QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + err,QMessageBox::Ok).exec();
 	return true;
@@ -156,6 +157,8 @@
 bool CTSPModel::loadTask(QString fname)
 {
+	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 QFile f(fname);
 	if (!f.open(QIODevice::ReadOnly)) {
+		QApplication::restoreOverrideCursor();
 		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),QString(trUtf8("Unable to open task file.\nError: %1")).arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
@@ -165,6 +168,7 @@
 quint32 sig;
 	ds >> sig;
-	if (loadError(ds.status()))
-		return false;
+	if (loadError(ds.status())) {
+		return false;
+	}
 	ds.device()->reset();
 	if (sig == TSPT) {
@@ -179,9 +183,11 @@
 		}
 	} else {
+		f.close();
+		QApplication::restoreOverrideCursor();
 		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();
+	QApplication::restoreOverrideCursor();
 	return true;
 }
@@ -199,4 +205,5 @@
 		return false;
 	if (version > TSPT_VERSION) {
+		QApplication::restoreOverrideCursor();
 		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 false;
@@ -212,4 +219,5 @@
 		return false;
 	if ((size < 3) || (size > MAX_NUM_CITIES)) {
+		QApplication::restoreOverrideCursor();
 		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unexpected data read.\nFile is possibly corrupted."),QMessageBox::Ok).exec();
 		return false;
@@ -230,4 +238,5 @@
 			}
 	emit dataChanged(index(0,0),index(nCities - 1,nCities - 1));
+	QApplication::restoreOverrideCursor();
 	return true;
 }
@@ -245,4 +254,5 @@
 		return false;
 	if (version > ZKT_VERSION) {
+		QApplication::restoreOverrideCursor();
 		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 false;
@@ -254,4 +264,5 @@
 		return false;
 	if ((size < 3) || (size > 5)) {
+		QApplication::restoreOverrideCursor();
 		QMessageBox(QMessageBox::Critical,trUtf8("Task Load"),trUtf8("Unable to load task:") + "\n" + trUtf8("Unexpected data read.\nFile is possibly corrupted."),QMessageBox::Ok).exec();
 		return false;
@@ -280,4 +291,5 @@
 			}
 	emit dataChanged(index(0,0),index(nCities - 1,nCities - 1));
+	QApplication::restoreOverrideCursor();
 	return true;
 }
@@ -285,6 +297,8 @@
 bool CTSPModel::saveTask(QString fname)
 {
+	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 QFile f(fname);
 	if (!f.open(QIODevice::WriteOnly)) {
+		QApplication::restoreOverrideCursor();
 		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),QString(trUtf8("Unable to create task file.\nError: %1\nMaybe, file is read-only?")).arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
@@ -293,6 +307,7 @@
 	ds.setVersion(QDataStream::Qt_4_4);
 	if (f.error() != QFile::NoError) {
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
-		f.close();
+		f.close();
+		QApplication::restoreOverrideCursor();
+		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -300,6 +315,7 @@
 	ds << TSPT;
 	if (f.error() != QFile::NoError) {
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
-		f.close();
+		f.close();
+		QApplication::restoreOverrideCursor();
+		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -307,6 +323,7 @@
 	ds << TSPT_VERSION;
 	if (f.error() != QFile::NoError) {
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
-		f.close();
+		f.close();
+		QApplication::restoreOverrideCursor();
+		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -314,6 +331,7 @@
 	ds << TSPT_META_VERSION;
 	if (f.error() != QFile::NoError) {
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
-		f.close();
+		f.close();
+		QApplication::restoreOverrideCursor();
+		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -321,6 +339,7 @@
 	ds << OSID;
 	if (f.error() != QFile::NoError) {
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
-		f.close();
+		f.close();
+		QApplication::restoreOverrideCursor();
+		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -328,6 +347,7 @@
 	ds << nCities;
 	if (f.error() != QFile::NoError) {
-		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
-		f.close();
+		f.close();
+		QApplication::restoreOverrideCursor();
+		QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
 		return false;
 	}
@@ -338,10 +358,12 @@
 				ds << table[r][c];
 				if (f.error() != QFile::NoError) {
+					f.close();
+					QApplication::restoreOverrideCursor();
 					QMessageBox(QMessageBox::Critical,trUtf8("Task Save"),trUtf8("Unable to save task.\nError: %1").arg(f.errorString()),QMessageBox::Ok).exec();
-					f.close();
 					return false;
 				}
 			}
 	f.close();
+	QApplication::restoreOverrideCursor();
 	return true;
 }
