Index: /trunk/resources/tspsg.qrc
===================================================================
--- /trunk/resources/tspsg.qrc	(revision 51)
+++ /trunk/resources/tspsg.qrc	(revision 52)
@@ -1,6 +1,5 @@
 <RCC>
     <qresource prefix="/images" >
-        <file>about.bmp</file>
-        <file>icon.png</file>
+        <file>Icon.png</file>
         <file>icons/back.png</file>
         <file>icons/button_cancel.png</file>
@@ -9,4 +8,5 @@
         <file>icons/contents.png</file>
         <file>icons/contexthelp.png</file>
+        <file>icons/document_preview.png</file>
         <file>icons/exit.png</file>
         <file>icons/filenew.png</file>
Index: /trunk/src/mainwindow.cpp
===================================================================
--- /trunk/src/mainwindow.cpp	(revision 51)
+++ /trunk/src/mainwindow.cpp	(revision 52)
@@ -40,5 +40,5 @@
 #endif
 #ifndef Q_OS_WINCE
-	printer = new QPrinter();
+	printer = new QPrinter(QPrinter::HighResolution);
 #endif // Q_OS_WINCE
 	groupSettingsLanguageList = new QActionGroup(this);
@@ -59,5 +59,6 @@
 	connect(actionHelpAbout,SIGNAL(triggered()),this,SLOT(actionHelpAboutTriggered()));
 #ifndef Q_OS_WINCE
-	connect(actionFilePrintSetup,SIGNAL(triggered()),this,SLOT(actionFilePrintSetupTriggered()));
+	connect(actionFilePrintPreview,SIGNAL(triggered()),this,SLOT(actionFilePrintPreviewTriggered()));
+	connect(actionFilePrint,SIGNAL(triggered()),this,SLOT(actionFilePrintTriggered()));
 #endif // Q_OS_WINCE
 	connect(buttonSolve,SIGNAL(clicked()),this,SLOT(buttonSolveClicked()));
@@ -84,4 +85,5 @@
 	qsrand(QDateTime().currentDateTime().toTime_t());
 	tspmodel = new CTSPModel();
+	taskView->setModel(tspmodel);
 	connect(tspmodel,SIGNAL(numCitiesChanged(int)),this,SLOT(numCitiesChanged(int)));
 	connect(tspmodel,SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),this,SLOT(dataChanged()));
@@ -92,10 +94,7 @@
 		setFileName();
 		spinCities->setValue(settings->value("NumCities",DEF_NUM_CITIES).toInt());
-		tspmodel->setNumCities(spinCities->value());
-	}
-	taskView->setModel(tspmodel);
+		spinCitiesValueChanged(spinCities->value());
+	}
 	setWindowModified(false);
-	taskView->resizeColumnsToContents();
-	taskView->resizeRowsToContents();
 }
 
@@ -107,4 +106,8 @@
 	if (!enable)
 		output.clear();
+#ifndef Q_OS_WINCE
+	actionFilePrint->setEnabled(enable);
+	actionFilePrintPreview->setEnabled(enable);
+#endif // Q_OS_WINCE
 }
 
@@ -117,5 +120,5 @@
 		lang = settings->value("Language",QLocale::system().name()).toString();
 	}
-static QTranslator *qtTranslator;
+static QTranslator *qtTranslator; // Qt library translator
 	if (qtTranslator) {
 		qApp->removeTranslator(qtTranslator);
@@ -124,5 +127,5 @@
 	}
 	qtTranslator = new QTranslator();
-static QTranslator *translator;
+static QTranslator *translator; // Application translator
 	if (translator) {
 		qApp->removeTranslator(translator);
@@ -139,4 +142,5 @@
 				qApp->installTranslator(qtTranslator);
 			else {
+				// Qt library translation unavailable
 				delete qtTranslator;
 				qtTranslator = NULL;
@@ -147,5 +151,5 @@
 		else {
 			if (!ad)
-				QMessageBox(QMessageBox::Warning,trUtf8("Language change"),trUtf8("Unable to load translation language."),QMessageBox::Ok,this).exec();
+				QMessageBox(QMessageBox::Warning,trUtf8("Language Change"),trUtf8("Unable to load translation language."),QMessageBox::Ok,this).exec();
 			delete translator;
 			translator = NULL;
@@ -346,5 +350,17 @@
 
 #ifndef Q_OS_WINCE
-void MainWindow::actionFilePrintSetupTriggered()
+void MainWindow::printPreview(QPrinter *printer)
+{
+	solutionText->print(printer);
+}
+
+void MainWindow::actionFilePrintPreviewTriggered()
+{
+QPrintPreviewDialog ppd(printer, this);
+    connect(&ppd,SIGNAL(paintRequested(QPrinter *)),SLOT(printPreview(QPrinter *)));
+    ppd.exec();
+}
+
+void MainWindow::actionFilePrintTriggered()
 {
 QPrintDialog pd(printer,this);
@@ -354,5 +370,7 @@
 	pd.setOption(QAbstractPrintDialog::PrintPageRange,false);
 #endif
-	pd.exec();
+	if (pd.exec() != QDialog::Accepted)
+		return;
+	solutionText->document()->print(printer);
 }
 #endif // Q_OS_WINCE
Index: /trunk/src/mainwindow.h
===================================================================
--- /trunk/src/mainwindow.h	(revision 51)
+++ /trunk/src/mainwindow.h	(revision 52)
@@ -55,5 +55,7 @@
 	void dataChanged();
 #ifndef Q_OS_WINCE
-	void actionFilePrintSetupTriggered();
+	void printPreview(QPrinter *);
+	void actionFilePrintPreviewTriggered();
+	void actionFilePrintTriggered();
 #endif // Q_OS_WINCE
 	void buttonSolveClicked();
Index: /trunk/ui/mainwindow.ce.ui
===================================================================
--- /trunk/ui/mainwindow.ce.ui	(revision 51)
+++ /trunk/ui/mainwindow.ce.ui	(revision 52)
@@ -18,5 +18,5 @@
   </property>
   <property name="windowIcon">
-   <iconset resource="../resources/tspsg.qrc">
+   <iconset>
     <normaloff>:/images/icon.png</normaloff>:/images/icon.png</iconset>
   </property>
Index: /trunk/ui/mainwindow.ui
===================================================================
--- /trunk/ui/mainwindow.ui	(revision 51)
+++ /trunk/ui/mainwindow.ui	(revision 52)
@@ -15,5 +15,5 @@
   </property>
   <property name="windowIcon">
-   <iconset resource="../resources/tspsg.qrc">
+   <iconset>
     <normaloff>:/images/icon.png</normaloff>:/images/icon.png</iconset>
   </property>
@@ -297,5 +297,5 @@
     <addaction name="menuFileSaveAs"/>
     <addaction name="separator"/>
-    <addaction name="actionFilePrintSetup"/>
+    <addaction name="actionFilePrintPreview"/>
     <addaction name="actionFilePrint"/>
     <addaction name="separator"/>
@@ -362,5 +362,5 @@
    <addaction name="actionFileExit"/>
   </widget>
-  <action name="actionFilePrintSetup">
+  <action name="actionFilePrintPreview">
    <property name="enabled">
     <bool>false</bool>
@@ -368,11 +368,17 @@
    <property name="icon">
     <iconset resource="../resources/tspsg.qrc">
-     <normaloff>:/images/icons/fileprint.png</normaloff>:/images/icons/fileprint.png</iconset>
-   </property>
-   <property name="text">
-    <string>P&amp;rint Setup...</string>
-   </property>
-   <property name="statusTip">
-    <string>Setup printing</string>
+     <normaloff>:/images/icons/document_preview.png</normaloff>:/images/icons/document_preview.png</iconset>
+   </property>
+   <property name="text">
+    <string>P&amp;rint Preview...</string>
+   </property>
+   <property name="iconText">
+    <string>Print Preview...</string>
+   </property>
+   <property name="toolTip">
+    <string>Preview solution results</string>
+   </property>
+   <property name="statusTip">
+    <string>Preview current solution results before printing</string>
    </property>
   </action>
@@ -388,6 +394,12 @@
     <string>&amp;Print...</string>
    </property>
-   <property name="statusTip">
-    <string>Print solution results</string>
+   <property name="iconText">
+    <string>Print...</string>
+   </property>
+   <property name="toolTip">
+    <string>Print solution</string>
+   </property>
+   <property name="statusTip">
+    <string>Print current solution results</string>
    </property>
    <property name="shortcut">
