Index: /trunk/src/defaults.h
===================================================================
--- /trunk/src/defaults.h	(revision 94)
+++ /trunk/src/defaults.h	(revision 95)
@@ -45,5 +45,5 @@
 #endif // Q_OS_WINCE
 //! Default for "Save main window state and position"
-#define DEF_SAVEPOS false
+#define DEF_SAVEPOS true
 //! Default for "Use translucency effects in Vista/7"
 #define DEF_USE_TRANSLUCENCY true
@@ -58,4 +58,6 @@
 //! Default for "Fractional random values"
 #define DEF_FRACTIONAL_RANDOM false
+//! Default for "Symmetric tasks mode"
+#define DEF_SYMMETRIC_MODE false
 
 //////// OUTPUT
@@ -67,5 +69,5 @@
 #define DEF_SHOW_MATRIX_LIMIT 15
 //! Default for "Scroll to the end of output after solving"
-#define DEF_SCROLL_TO_END true
+#define DEF_SCROLL_TO_END false
 /*!
  * \def DEF_FONT_FAMILY
Index: /trunk/src/mainwindow.cpp
===================================================================
--- /trunk/src/mainwindow.cpp	(revision 94)
+++ /trunk/src/mainwindow.cpp	(revision 95)
@@ -71,4 +71,8 @@
 
 #if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+	// Centering main window
+QRect rect = geometry();
+	rect.moveCenter(QApplication::desktop()->availableGeometry(this).center());
+	setGeometry(rect);
 	if (settings->value("SavePos", DEF_SAVEPOS).toBool()) {
 		// Loading of saved window state
@@ -77,9 +81,4 @@
 		restoreState(settings->value("State").toByteArray());
 		settings->endGroup();
-	} else {
-		// Centering main window
-QRect rect = geometry();
-		rect.moveCenter(QApplication::desktop()->availableGeometry(this).center());
-		setGeometry(rect);
 	}
 #else
@@ -500,11 +499,20 @@
 
 #ifdef Q_OS_WINCE
+void MainWindow::changeEvent(QEvent *ev)
+{
+	if ((ev->type() == QEvent::ActivationChange) && isActiveWindow())
+		desktopResized(0);
+
+	QWidget::changeEvent(ev);
+}
+
 void MainWindow::desktopResized(int screen)
 {
-	if (screen != 0)
+	if ((screen != 0) || !isActiveWindow())
 		return;
 
 QRect availableGeometry = QApplication::desktop()->availableGeometry(0);
 	if (currentGeometry != availableGeometry) {
+		QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 		/*!
 		 * \hack HACK: This hack checks whether \link QDesktopWidget::availableGeometry() availableGeometry()\endlink's \c top + \c hegiht = \link QDesktopWidget::screenGeometry() screenGeometry()\endlink's \c height.
@@ -519,6 +527,7 @@
 			setGeometry(availableGeometry);
 		}
-	}
-	currentGeometry = availableGeometry;
+		currentGeometry = availableGeometry;
+		QApplication::restoreOverrideCursor();
+	}
 }
 #endif // Q_OS_WINCE
@@ -557,14 +566,18 @@
 		return;
 	}
-	settings->setValue("NumCities", spinCities->value());
-
-	// Saving Main Window state
-	if (settings->value("SavePos", DEF_SAVEPOS).toBool()) {
-		settings->beginGroup("MainWindow");
+	if (!settings->value("SettingsReset", false).toBool()) {
+		settings->setValue("NumCities", spinCities->value());
+
+		// Saving Main Window state
+		if (settings->value("SavePos", DEF_SAVEPOS).toBool()) {
+			settings->beginGroup("MainWindow");
 #if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
-		settings->setValue("Geometry", saveGeometry());
+			settings->setValue("Geometry", saveGeometry());
 #endif // Q_OS_WINCE
-		settings->setValue("State", saveState());
-		settings->endGroup();
+			settings->setValue("State", saveState());
+			settings->endGroup();
+		}
+	} else {
+		settings->remove("SettingsReset");
 	}
 
Index: /trunk/src/mainwindow.h
===================================================================
--- /trunk/src/mainwindow.h	(revision 94)
+++ /trunk/src/mainwindow.h	(revision 95)
@@ -72,4 +72,5 @@
 	void dataChanged(const QModelIndex &tl, const QModelIndex &br);
 #ifdef Q_OS_WINCE
+	void changeEvent(QEvent *ev);
 	void desktopResized(int screen);
 #endif // Q_OS_WINCE
Index: /trunk/src/settingsdialog.cpp
===================================================================
--- /trunk/src/settingsdialog.cpp	(revision 94)
+++ /trunk/src/settingsdialog.cpp	(revision 95)
@@ -54,4 +54,6 @@
 	scrollArea->setWidgetResizable(true);
 	scrollArea->setWidget(bgWhite);
+#else
+	buttons->insertStretch(buttons->indexOf(buttonHelp) + 1);
 #endif // Q_OS_WINCE
 
@@ -146,5 +148,4 @@
 
 #ifdef Q_OS_WINCE
-	currentGeometry = QApplication::desktop()->availableGeometry(0);
 	// We need to react to SIP show/hide and resize the window appropriately
 	connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(desktopResized(int)));
@@ -153,5 +154,4 @@
 	connect(buttonFont,SIGNAL(clicked()),this,SLOT(buttonFontClicked()));
 	connect(buttonColor,SIGNAL(clicked()),this,SLOT(buttonColorClicked()));
-//	setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint);
 	setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
 #if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
@@ -161,4 +161,5 @@
 
 	settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg", this);
+	settings->remove("SettingsReset");
 
 	cbAutosize->setChecked(settings->value("Autosize", DEF_AUTOSIZE).toBool());
@@ -173,4 +174,5 @@
 
 	settings->beginGroup("Task");
+	cbSymmetricMode->setChecked(settings->value("SymmetricMode", DEF_SYMMETRIC_MODE).toBool());
 	spinFractionalAccuracy->setValue(settings->value("FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt());
 	spinRandMin->setMaximum(MAX_RAND_VALUE);
@@ -194,5 +196,7 @@
 	settings->endGroup();
 
+#ifndef Q_OS_WINCE
 	adjustSize();
+#endif // Q_OS_WINCE
 }
 
@@ -230,4 +234,16 @@
 void SettingsDialog::accept()
 {
+	if (QApplication::keyboardModifiers() & Qt::ShiftModifier) {
+		if (QMessageBox::question(this, tr("Settings Reset"), tr("Do you really want to <b>reset all application settings to their defaults</b>?"), QMessageBox::RestoreDefaults | QMessageBox::Cancel) == QMessageBox::RestoreDefaults) {
+			_newFont = (font != QFont(DEF_FONT_FAMILY, DEF_FONT_SIZE));
+			_newColor = (color != DEF_FONT_COLOR);
+			settings->remove("");
+			settings->setValue("SettingsReset", true);
+			QDialog::accept();
+			QMessageBox::information(this, tr("Settings Reset"), tr("All settings where successfully reset to their defaults.\nIt is recommended to restart the application now."));
+			return;
+		} else
+			return;
+	}
 #if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
 	settings->setValue("SavePos", cbSaveState->isChecked());
@@ -246,4 +262,5 @@
 
 	settings->beginGroup("Task");
+	settings->setValue("SymmetricMode", cbSymmetricMode->isChecked());
 	settings->setValue("FractionalAccuracy", spinFractionalAccuracy->value());
 	settings->setValue("RandMin", spinRandMin->value());
@@ -293,4 +310,5 @@
 QRect availableGeometry = QApplication::desktop()->availableGeometry(0);
 	if (currentGeometry != availableGeometry) {
+		QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 		/*!
 		 * \hack HACK: This hack checks whether \link QDesktopWidget::availableGeometry() availableGeometry()\endlink's \c top + \c hegiht = \link QDesktopWidget::screenGeometry() screenGeometry()\endlink's \c height.
@@ -305,6 +323,14 @@
 			setGeometry(availableGeometry);
 		}
-	}
-	currentGeometry = availableGeometry;
+		currentGeometry = availableGeometry;
+		QApplication::restoreOverrideCursor();
+	}
+}
+
+void SettingsDialog::showEvent(QShowEvent *ev)
+{
+	desktopResized(0);
+
+	QWidget::showEvent(ev);
 }
 #endif // Q_OS_WINCE
Index: /trunk/src/settingsdialog.h
===================================================================
--- /trunk/src/settingsdialog.h	(revision 94)
+++ /trunk/src/settingsdialog.h	(revision 95)
@@ -76,4 +76,5 @@
 #ifdef Q_OS_WINCE
 	void desktopResized(int screen);
+	void showEvent(QShowEvent *ev);
 #endif // Q_OS_WINCE
 	void spinRandMinValueChanged(int val);
Index: /trunk/src/tspmodel.cpp
===================================================================
--- /trunk/src/tspmodel.cpp	(revision 94)
+++ /trunk/src/tspmodel.cpp	(revision 95)
@@ -191,11 +191,17 @@
 void CTSPModel::randomize()
 {
-int randMin = settings->value("Task/RandMin",DEF_RAND_MIN).toInt();
-int randMax = settings->value("Task/RandMax",DEF_RAND_MAX).toInt();
-	for (int r = 0; r < nCities; r++)
-		for (int c = 0; c < nCities; c++)
-			if (r != c)
-				table[r][c] = rand(randMin,randMax);
-	emit dataChanged(index(0,0),index(nCities - 1,nCities - 1));
+int randMin = settings->value("Task/RandMin", DEF_RAND_MIN).toInt();
+int randMax = settings->value("Task/RandMax", DEF_RAND_MAX).toInt();
+	if (settings->value("Task/SymmetricMode", DEF_SYMMETRIC_MODE).toBool()) {
+		for (int r = 0; r < nCities; r++)
+			for (int c = 0; c < r; c++)
+				table[c][r] = table[r][c] = rand(randMin, randMax);
+	} else {
+		for (int r = 0; r < nCities; r++)
+			for (int c = 0; c < nCities; c++)
+				if (r != c)
+					table[r][c] = rand(randMin, randMax);
+	}
+	emit dataChanged(index(0,0), index(nCities - 1, nCities - 1));
 }
 
@@ -315,6 +321,9 @@
 			if (!ok || tmp < 0)
 				return false;
-			else
+			else {
 				table[index.row()][index.column()] = tmp;
+				if (settings->value("Task/SymmetricMode", DEF_SYMMETRIC_MODE).toBool())
+					table[index.column()][index.row()] = tmp;
+			}
 		}
 		emit dataChanged(index,index);
Index: /trunk/tspsg.pro
===================================================================
--- /trunk/tspsg.pro	(revision 94)
+++ /trunk/tspsg.pro	(revision 95)
@@ -55,5 +55,5 @@
 	share.files = COPYING README
 	i18n.path = /share/tspsg/i18n
-	i18n.files = i18n/languages.ini i18n/*.qm
+	i18n.files = i18n/*.qm
 	docs.path = /share/doc/tspsg
 #	docs.files = docs/*
@@ -72,5 +72,5 @@
 	share.files = COPYING README
 	i18n.path = "\tspsg\i18n"
-	i18n.files = i18n\languages.ini i18n\*.qm
+	i18n.files = i18n/*.qm
 	docs.path = "\tspsg\help"
 #	docs.files = docs\*
@@ -87,5 +87,5 @@
 	share.sources = COPYING README
 	share.path = "\Storage Card\Program Files\tspsg"
-	i18n.sources = i18n\languages.ini i18n\*.qm
+	i18n.sources = i18n/*.qm
 	i18n.path = "\Storage Card\Program Files\tspsg\i18n"
 #	docs.sources = docs\*
@@ -100,5 +100,5 @@
 		"\"COPYING\" - \"\", FILETEXT, TEXTEXIT"
 	share.sources = COPYING README
-	i18n.sources = i18n/languages.ini i18n/*.qm
+	i18n.sources = i18n/*.qm
 	i18n.path = i18n
 #	docs.sources = docs/*
Index: /trunk/ui/mainwindow.ui
===================================================================
--- /trunk/ui/mainwindow.ui	(revision 94)
+++ /trunk/ui/mainwindow.ui	(revision 95)
@@ -8,6 +8,6 @@
     <x>0</x>
     <y>0</y>
-    <width>301</width>
-    <height>352</height>
+    <width>500</width>
+    <height>450</height>
    </rect>
   </property>
@@ -253,5 +253,5 @@
      <x>0</x>
      <y>0</y>
-     <width>301</width>
+     <width>500</width>
      <height>21</height>
     </rect>
Index: /trunk/ui/settingsdialog.ui
===================================================================
--- /trunk/ui/settingsdialog.ui	(revision 94)
+++ /trunk/ui/settingsdialog.ui	(revision 95)
@@ -229,8 +229,11 @@
         <string>Task generation and solving settings</string>
        </attribute>
-       <layout class="QVBoxLayout" name="_5">
-        <item>
-         <layout class="QHBoxLayout" name="_10">
-          <item>
+       <layout class="QVBoxLayout" name="_9">
+        <item>
+         <layout class="QFormLayout" name="_5">
+          <property name="fieldGrowthPolicy">
+           <enum>QFormLayout::ExpandingFieldsGrow</enum>
+          </property>
+          <item row="0" column="0">
            <widget class="QLabel" name="labelFractionalAccuracy">
             <property name="text">
@@ -239,5 +242,5 @@
            </widget>
           </item>
-          <item>
+          <item row="0" column="1">
            <widget class="QSpinBox" name="spinFractionalAccuracy">
             <property name="cursor">
@@ -252,107 +255,90 @@
            </widget>
           </item>
-          <item>
-           <spacer name="spacer_3">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>0</width>
-              <height>0</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
          </layout>
         </item>
         <item>
-         <layout class="QHBoxLayout" name="_7">
-          <item>
-           <widget class="QGroupBox" name="groupBox">
-            <property name="title">
-             <string>Random numbers</string>
-            </property>
-            <layout class="QVBoxLayout" name="_8">
-             <item>
-              <layout class="QFormLayout" name="_9">
-               <property name="fieldGrowthPolicy">
-                <enum>QFormLayout::ExpandingFieldsGrow</enum>
-               </property>
-               <item row="0" column="0">
-                <widget class="QLabel" name="labelRandMin">
-                 <property name="text">
-                  <string>&amp;Minimal:</string>
-                 </property>
-                 <property name="buddy">
-                  <cstring>spinRandMin</cstring>
-                 </property>
-                </widget>
-               </item>
-               <item row="0" column="1">
-                <widget class="QSpinBox" name="spinRandMin">
-                 <property name="cursor">
-                  <cursorShape>PointingHandCursor</cursorShape>
-                 </property>
-                 <property name="statusTip">
-                  <string>Minimum for random number generation</string>
-                 </property>
-                </widget>
-               </item>
-               <item row="1" column="0">
-                <widget class="QLabel" name="labelRandMax">
-                 <property name="text">
-                  <string>Ma&amp;ximal:</string>
-                 </property>
-                 <property name="buddy">
-                  <cstring>spinRandMax</cstring>
-                 </property>
-                </widget>
-               </item>
-               <item row="1" column="1">
-                <widget class="QSpinBox" name="spinRandMax">
-                 <property name="cursor">
-                  <cursorShape>PointingHandCursor</cursorShape>
-                 </property>
-                 <property name="statusTip">
-                  <string>Maximum for random number generation</string>
-                 </property>
-                </widget>
-               </item>
-              </layout>
+         <widget class="QCheckBox" name="cbSymmetricMode">
+          <property name="cursor">
+           <cursorShape>PointingHandCursor</cursorShape>
+          </property>
+          <property name="statusTip">
+           <string>In this mode the cost of travel from city 1 to city 2 and vice versa is the same</string>
+          </property>
+          <property name="text">
+           <string>Symmetric mode</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QGroupBox" name="gbTaskGeneration">
+          <property name="title">
+           <string>Task generation</string>
+          </property>
+          <layout class="QVBoxLayout" name="_7">
+           <item>
+            <layout class="QFormLayout" name="_8">
+             <property name="fieldGrowthPolicy">
+              <enum>QFormLayout::ExpandingFieldsGrow</enum>
+             </property>
+             <item row="0" column="0">
+              <widget class="QLabel" name="labelRandMin">
+               <property name="text">
+                <string>Minimal random:</string>
+               </property>
+               <property name="buddy">
+                <cstring>spinRandMin</cstring>
+               </property>
+              </widget>
              </item>
-             <item>
-              <widget class="QCheckBox" name="cbFractionalRandom">
+             <item row="0" column="1">
+              <widget class="QSpinBox" name="spinRandMin">
                <property name="cursor">
                 <cursorShape>PointingHandCursor</cursorShape>
                </property>
                <property name="statusTip">
-                <string>Generate fractional random values with the Fractional accuracy</string>
-               </property>
+                <string>Minimum for random number generation</string>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="0">
+              <widget class="QLabel" name="labelRandMax">
                <property name="text">
-                <string>Fractional random values</string>
+                <string>Maximal random:</string>
+               </property>
+               <property name="buddy">
+                <cstring>spinRandMax</cstring>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="1">
+              <widget class="QSpinBox" name="spinRandMax">
+               <property name="cursor">
+                <cursorShape>PointingHandCursor</cursorShape>
+               </property>
+               <property name="statusTip">
+                <string>Maximum for random number generation</string>
                </property>
               </widget>
              </item>
             </layout>
-           </widget>
-          </item>
-          <item>
-           <spacer name="spacer_2">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>0</width>
-              <height>0</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <spacer name="spacer_5">
+           </item>
+           <item>
+            <widget class="QCheckBox" name="cbFractionalRandom">
+             <property name="cursor">
+              <cursorShape>PointingHandCursor</cursorShape>
+             </property>
+             <property name="statusTip">
+              <string>Generate fractional random values with the Fractional accuracy</string>
+             </property>
+             <property name="text">
+              <string>Fractional random values</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+        </item>
+        <item>
+         <spacer name="spacer_2">
           <property name="orientation">
            <enum>Qt::Vertical</enum>
@@ -360,5 +346,5 @@
           <property name="sizeHint" stdset="0">
            <size>
-            <width>0</width>
+            <width>10</width>
             <height>0</height>
            </size>
@@ -395,5 +381,5 @@
           </property>
           <item>
-           <spacer name="spacer_4">
+           <spacer name="spacer_3">
             <property name="orientation">
              <enum>Qt::Horizontal</enum>
@@ -437,5 +423,5 @@
           </item>
           <item>
-           <spacer name="spacer_6">
+           <spacer name="spacer_4">
             <property name="orientation">
              <enum>Qt::Horizontal</enum>
@@ -471,5 +457,5 @@
              <string>Output font settings</string>
             </property>
-            <layout class="QHBoxLayout" name="horizontalLayout">
+            <layout class="QHBoxLayout" name="_13">
              <item>
               <widget class="QPushButton" name="buttonFont">
@@ -506,24 +492,24 @@
               </widget>
              </item>
+             <item>
+              <spacer name="spacer_5">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>0</width>
+                 <height>0</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
             </layout>
            </widget>
           </item>
-          <item>
-           <spacer name="spacer_7">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>0</width>
-              <height>0</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
          </layout>
         </item>
         <item>
-         <spacer name="verticalSpacer">
+         <spacer name="spacer_6">
           <property name="orientation">
            <enum>Qt::Vertical</enum>
