Index: trunk/src/defaults.h
===================================================================
--- trunk/src/defaults.h	(revision 93)
+++ trunk/src/defaults.h	(revision 94)
@@ -69,5 +69,5 @@
 #define DEF_SCROLL_TO_END true
 /*!
- * \def DEF_FON_FAMILY
+ * \def DEF_FONT_FAMILY
  * \brief Default font name.
  */
Index: trunk/src/main.cpp
===================================================================
--- trunk/src/main.cpp	(revision 93)
+++ trunk/src/main.cpp	(revision 94)
@@ -54,5 +54,5 @@
 
 QTranslator en;
-	if (en.load("en", PATH_I18N))
+	if (en.load("tspsg_en", PATH_I18N))
 		app.installTranslator(&en);
 
Index: trunk/src/mainwindow.cpp
===================================================================
--- trunk/src/mainwindow.cpp	(revision 93)
+++ trunk/src/mainwindow.cpp	(revision 94)
@@ -35,4 +35,5 @@
 {
 	settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg", this);
+
 	loadLanguage();
 	setupUi();
@@ -44,4 +45,9 @@
 #endif // QT_NO_PRINTER
 
+#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)));
+#endif // Q_OS_WINCE
 	connect(actionFileNew,SIGNAL(triggered()),this,SLOT(actionFileNewTriggered()));
 	connect(actionFileOpen,SIGNAL(triggered()),this,SLOT(actionFileOpenTriggered()));
@@ -78,5 +84,5 @@
 	}
 #else
-	setWindowState(windowState() | Qt::WindowMaximized);
+	setWindowState(Qt::WindowMaximized);
 #endif // Q_OS_WINCE
 
@@ -268,7 +274,7 @@
 	if (checked) {
 		settings->remove("Language");
-		QMessageBox(QMessageBox::Information,tr("Language change"),tr("Language will be autodetected on next application start."),QMessageBox::Ok,this).exec();
+		QMessageBox::information(this, tr("Language change"), tr("Language will be autodetected on next application start."));
 	} else
-		settings->setValue("Language",groupSettingsLanguageList->checkedAction()->data().toString());
+		settings->setValue("Language", groupSettingsLanguageList->checkedAction()->data().toString());
 }
 
@@ -493,4 +499,29 @@
 }
 
+#ifdef Q_OS_WINCE
+void MainWindow::desktopResized(int screen)
+{
+	if (screen != 0)
+		return;
+
+QRect availableGeometry = QApplication::desktop()->availableGeometry(0);
+	if (currentGeometry != availableGeometry) {
+		/*!
+		 * \hack HACK: This hack checks whether \link QDesktopWidget::availableGeometry() availableGeometry()\endlink's \c top + \c hegiht = \link QDesktopWidget::screenGeometry() screenGeometry()\endlink's \c height.
+		 *  If \c true, the window gets maximized. If we used \c setGeometry() in this case, the bottom of the
+		 *  window would end up being behind the soft buttons. Is this a bug in Qt or Windows Mobile?
+		 */
+		if ((availableGeometry.top() + availableGeometry.height()) == QApplication::desktop()->screenGeometry().height()) {
+			setWindowState(windowState() | Qt::WindowMaximized);
+		} else {
+			if (windowState() & Qt::WindowMaximized)
+				setWindowState(windowState() ^ Qt::WindowMaximized);
+			setGeometry(availableGeometry);
+		}
+	}
+	currentGeometry = availableGeometry;
+}
+#endif // Q_OS_WINCE
+
 void MainWindow::numCitiesChanged(int nCities)
 {
@@ -555,10 +586,5 @@
 void MainWindow::loadLangList()
 {
-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(PATH_I18N, "*.qm", QDir::Name | QDir::IgnoreCase, QDir::Files);
+QDir dir(PATH_I18N, "tspsg_*.qm", QDir::Name | QDir::IgnoreCase, QDir::Files);
 	if (!dir.exists())
 		return;
@@ -567,18 +593,16 @@
 		return;
 QAction *a;
+QTranslator t;
+QString name;
 	for (int k = 0; k < langs.size(); k++) {
 		QFileInfo lang = langs.at(k);
-		if (!lang.completeBaseName().startsWith("qt_") && lang.completeBaseName().compare("en")) {
-#if QT_VERSION >= 0x040500
-			a = menuSettingsLanguage->addAction(langinfo.value(lang.completeBaseName() + "/NativeName", lang.completeBaseName()).toString());
-#else
-			// We use Name if Qt < 4.5 because NativeName is in UTF-8, QSettings
-			// reads .ini file as ASCII and there is no way to set file encoding.
-			a = menuSettingsLanguage->addAction(langinfo.value(lang.completeBaseName() + "/Name", lang.completeBaseName()).toString());
-#endif
-			a->setData(lang.completeBaseName());
+		if (lang.completeBaseName().compare("tspsg_en", Qt::CaseInsensitive) && t.load(lang.completeBaseName(), PATH_I18N)) {
+			name = t.translate("--------", "LANGNAME", "Please, provide a native name of your translation language here.");
+			a = menuSettingsLanguage->addAction(name);
+			a->setStatusTip(QString("Set application language to %1").arg(name));
+			a->setData(lang.completeBaseName().mid(6));
 			a->setCheckable(true);
 			a->setActionGroup(groupSettingsLanguageList);
-			if (settings->value("Language", QLocale::system().name()).toString().startsWith(lang.completeBaseName()))
+			if (settings->value("Language", QLocale::system().name()).toString().startsWith(lang.completeBaseName().mid(6)))
 				a->setChecked(true);
 		}
@@ -628,11 +652,18 @@
 	// Now let's load application translation.
 	translator = new QTranslator(this);
-	if (translator->load(lng, PATH_I18N))
+	if (translator->load("tspsg_" + lng, PATH_I18N))
 		qApp->installTranslator(translator);
 	else {
 		delete translator;
 		translator = NULL;
-		if (!ad)
-			QMessageBox::warning(this, tr("Language Change"), tr("Unable to load translation language."));
+		if (!ad) {
+			settings->remove("Language");
+			if (QApplication::overrideCursor() != 0)
+				QApplication::restoreOverrideCursor();
+			if (isVisible())
+				QMessageBox::warning(this, tr("Language Change"), tr("Unable to load the translation language.\nFalling back to autodetection."));
+			else
+				QMessageBox::warning(NULL, tr("Language Change"), tr("Unable to load the translation language.\nFalling back to autodetection."));
+		}
 		return false;
 	}
@@ -705,4 +736,6 @@
 		Ui::MainWindow::retranslateUi(this);
 
+	actionSettingsLanguageEnglish->setStatusTip(tr("Set application language to %1").arg("English"));
+
 #ifndef QT_NO_PRINTER
 	actionFilePrintPreview->setText(QApplication::translate("MainWindow", "P&rint Preview...", 0, QApplication::UnicodeUTF8));
@@ -769,4 +802,11 @@
 #ifdef Q_OS_WINCE
 	menuBar()->setDefaultAction(menuFile->menuAction());
+
+QScrollArea *scrollArea = new QScrollArea(this);
+	scrollArea->setFrameShape(QFrame::NoFrame);
+	scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+	scrollArea->setWidgetResizable(true);
+	scrollArea->setWidget(tabWidget);
+	setCentralWidget(scrollArea);
 #endif // Q_OS_WINCE
 
@@ -804,5 +844,5 @@
 	actionSettingsLanguageEnglish->setActionGroup(groupSettingsLanguageList);
 	loadLangList();
-	actionSettingsLanguageAutodetect->setChecked(settings->value("Language","").toString().isEmpty());
+	actionSettingsLanguageAutodetect->setChecked(settings->value("Language", "").toString().isEmpty());
 
 	spinCities->setMaximum(MAX_NUM_CITIES);
Index: trunk/src/mainwindow.h
===================================================================
--- trunk/src/mainwindow.h	(revision 93)
+++ trunk/src/mainwindow.h	(revision 94)
@@ -71,4 +71,7 @@
 	void dataChanged();
 	void dataChanged(const QModelIndex &tl, const QModelIndex &br);
+#ifdef Q_OS_WINCE
+	void desktopResized(int screen);
+#endif // Q_OS_WINCE
 	void numCitiesChanged(int nCities);
 #ifndef QT_NO_PRINTER
@@ -88,4 +91,7 @@
 	QSettings *settings;
 	CTSPModel *tspmodel;
+#ifdef Q_OS_WINCE
+	QRect currentGeometry;
+#endif // Q_OS_WINCE
 
 	void closeEvent(QCloseEvent *ev);
Index: trunk/src/settingsdialog.cpp
===================================================================
--- trunk/src/settingsdialog.cpp	(revision 93)
+++ trunk/src/settingsdialog.cpp	(revision 94)
@@ -43,16 +43,18 @@
 
 #if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
-	// Layout helper elements
-QVBoxLayout *vbox1;
-QHBoxLayout *hbox1;
+QVBoxLayout *vbox1; // Layout helper
+
+#ifdef Q_OS_WINCE
+	// On screens with small height when SIP is shown and the window is resized
+	// there is not enought space for all elements.
+	//  So we show scrollbars to be able to access them.
+QScrollArea *scrollArea = new QScrollArea(this);
+	scrollArea->setFrameShape(QFrame::NoFrame);
+	scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+	scrollArea->setWidgetResizable(true);
+	scrollArea->setWidget(bgWhite);
+#endif // Q_OS_WINCE
 
 	bgWhite->layout()->setMargin(0);
-
-	// Bottom part (with grey bg)
-	hbox1 = new QHBoxLayout(bgGrey);
-	hbox1->setMargin(6);
-	hbox1->setSpacing(6);
-	hbox1->addWidget(buttonHelp);
-	hbox1->addStretch();
 
 	// Central layout
@@ -60,11 +62,15 @@
 	vbox1->setMargin(0);
 	vbox1->setSpacing(0);
+#ifdef Q_OS_WINCE
+	vbox1->addWidget(scrollArea);
+#else
 	vbox1->addWidget(bgWhite);
-	vbox1->addWidget(lineHorizontal);
+#endif // Q_OS_WINCE
 	vbox1->addWidget(bgGrey);
+	setLayout(vbox1);
 #else
 	// Layout helper elements
 QVBoxLayout *vbox1, *vbox2;
-QHBoxLayout *hbox1, *hbox2;
+QHBoxLayout *hbox1;
 
 	if (QtWin::isCompositionEnabled()) {
@@ -89,6 +95,5 @@
 	imgIcon->setObjectName("imgIcon");
 	imgIcon->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
-	imgIcon->setFrameShape(QFrame::Panel);
-	imgIcon->setLineWidth(0);
+	imgIcon->setFrameShape(QFrame::NoFrame);
 	imgIcon->setPixmap(QPixmap(":/images/icons/preferences_system.png"));
 	imgIcon->setStyleSheet("background-color: #0080C0; padding-top: 11px;");
@@ -128,11 +133,6 @@
 #endif // Q_OS_WIN32
 
-	// Bottom part (with grey bg)
-	hbox2 = new QHBoxLayout(bgGrey);
-	hbox2->setMargin(6);
-	hbox2->setSpacing(6);
-	hbox2->addWidget(buttonHelp);
-	hbox2->addWidget(labelHint);
-	hbox2->addWidget(buttonBox);
+	// Inserting label for hints to the bottom part (with grey bg)
+	buttons->insertWidget(buttons->indexOf(buttonHelp) + 1, labelHint, 1);
 
 	// Central layout
@@ -141,8 +141,13 @@
 	vbox2->setSpacing(0);
 	vbox2->addLayout(hbox1);
-	vbox2->addWidget(lineHorizontal);
 	vbox2->addWidget(bgGrey);
-#endif // Q_OS_WINCE
-
+	setLayout(vbox2);
+#endif // Q_OS_WINCE
+
+#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)));
+#endif // Q_OS_WINCE
 	connect(spinRandMin,SIGNAL(valueChanged(int)),this,SLOT(spinRandMinValueChanged(int)));
 	connect(buttonFont,SIGNAL(clicked()),this,SLOT(buttonFontClicked()));
@@ -211,5 +216,8 @@
 
 /*!
- *
+ * \brief Indicates whether and how the translucency setting was changed
+ * \retval -1 the translucency was \em disabled.
+ * \retval  0 the translucency was <em>not changed</em>.
+ * \retval  1 the translucency was \em enabled.
  */
 qint8 SettingsDialog::translucencyChanged() const
@@ -277,4 +285,29 @@
 }
 
+#ifdef Q_OS_WINCE
+void SettingsDialog::desktopResized(int screen)
+{
+	if (screen != 0)
+		return;
+
+QRect availableGeometry = QApplication::desktop()->availableGeometry(0);
+	if (currentGeometry != availableGeometry) {
+		/*!
+		 * \hack HACK: This hack checks whether \link QDesktopWidget::availableGeometry() availableGeometry()\endlink's \c top + \c hegiht = \link QDesktopWidget::screenGeometry() screenGeometry()\endlink's \c height.
+		 *  If \c true, the window gets maximized. If we used \c setGeometry() in this case, the bottom of the
+		 *  window would end up being behind the soft buttons. Is this a bug in Qt or Windows Mobile?
+		 */
+		if ((availableGeometry.top() + availableGeometry.height()) == QApplication::desktop()->screenGeometry().height()) {
+			setWindowState(windowState() | Qt::WindowMaximized);
+		} else {
+			if (windowState() & Qt::WindowMaximized)
+				setWindowState(windowState() ^ Qt::WindowMaximized);
+			setGeometry(availableGeometry);
+		}
+	}
+	currentGeometry = availableGeometry;
+}
+#endif // Q_OS_WINCE
+
 void SettingsDialog::spinRandMinValueChanged(int val) {
 	spinRandMax->setMinimum(val);
Index: trunk/src/settingsdialog.h
===================================================================
--- trunk/src/settingsdialog.h	(revision 93)
+++ trunk/src/settingsdialog.h	(revision 94)
@@ -59,5 +59,7 @@
 	QCheckBox *cbUseTranslucency;
 #endif // Q_OS_WIN32
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
+#ifdef Q_OS_WINCE
+	QRect currentGeometry;
+#elif !defined(Q_OS_SYMBIAN)
 	QCheckBox *cbSaveState;
 	QLabel *imgIcon;
@@ -66,5 +68,5 @@
 
 	bool event(QEvent *ev);
-#endif
+#endif // Q_OS_WINCE
 
 private slots:
@@ -72,4 +74,7 @@
 	void buttonColorClicked();
 	void buttonFontClicked();
+#ifdef Q_OS_WINCE
+	void desktopResized(int screen);
+#endif // Q_OS_WINCE
 	void spinRandMinValueChanged(int val);
 };
