Index: psi/trunk/src/common.cpp
===================================================================
--- psi/trunk/src/common.cpp	(revision 18)
+++ psi/trunk/src/common.cpp	(revision 19)
@@ -27,6 +27,10 @@
 
 QString PROG_NAME = "Psi";
+#ifdef Q_WS_PM
+QString PROG_VERSION = "0.10-os2-b1 (" __DATE__ ")"; // OS/2 versions are betas yet
+#else
 //QString PROG_VERSION = "0.11-dev" " (" __DATE__ ")"; //CVS Builds are dated
 QString PROG_VERSION = "0.10";
+#endif
 
 #ifdef HAVE_CONFIG
@@ -58,4 +62,9 @@
 #ifdef Q_WS_WIN
 #include<windows.h>
+#endif
+
+#ifdef Q_WS_PM
+#include<sys/types.h>
+#include<sys/stat.h>
 #endif
 
@@ -995,4 +1004,7 @@
 		useCustom = FALSE;
 #endif
+#ifdef Q_WS_PM
+        /// @todo (dmik) use HINI_USER_PROFILE\WPURLDEFAULTSETTINGS\DefaultBrowserExe
+#endif
 #ifdef Q_WS_X11
 	if(option.browser == 0 || option.browser == 2)
@@ -1040,4 +1052,7 @@
 			QMessageBox::critical(0, CAP(QObject::tr("URL error")), QObject::tr("Unable to open the URL. Ensure that you have a web browser installed."));
 		}
+#endif
+#ifdef Q_WS_PM
+        /// @todo (dmik) use HINI_USER_PROFILE\WPURLDEFAULTSETTINGS\DefaultBrowserExe
 #endif
 #ifdef Q_WS_X11
@@ -1102,5 +1117,6 @@
 static void getSysInfo()
 {
-#if defined(Q_WS_X11) || defined(Q_WS_MAC)
+#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_PM)
+        /// @todo (dmik) test it
 	time_t x;
 	time(&x);
@@ -1206,4 +1222,6 @@
 		}
 	}
+#elif defined(Q_WS_PM)
+	os_str = "OS/2";
 #elif defined(Q_WS_MAC)
 	os_str = "Mac OS X";
@@ -1328,4 +1346,32 @@
 	else
 		base = QDir::homeDirPath();
+
+	// no trailing slash
+	if(base.at(base.length()-1) == '/')
+		base.truncate(base.length()-1);
+
+	QDir proghome(base + "/PsiData");
+	if(!proghome.exists()) {
+		QDir home(base);
+		home.mkdir("PsiData");
+	}
+
+	return proghome.path();
+}
+#endif
+
+#ifdef Q_WS_PM
+QString getResourcesDir()
+{
+#if QT_VERSION >= 0x030200
+	return qApp->applicationDirPath();
+#else
+#  error Not implemented!
+#endif
+}
+
+QString getHomeDir()
+{
+	QString base = QDir::homeDirPath();
 
 	// no trailing slash
@@ -1465,5 +1511,5 @@
 		return;
 
-#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
+#if defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_WS_MAC)
 	QSound::play(str);
 #else
Index: psi/trunk/src/mainwin.cpp
===================================================================
--- psi/trunk/src/mainwin.cpp	(revision 18)
+++ psi/trunk/src/mainwin.cpp	(revision 19)
@@ -449,4 +449,10 @@
 void MainWin::setUseDock(bool use)
 {
+#ifdef Q_WS_PM
+	/// @todo (dmik) disable the docklet until the xCenter plugin is implemented
+	//  (this ifdef is necessary in order to share the same config between
+	//  different platforms where the Use Docklet option may be set to true.
+	return;
+#else	
 	if(use == false || (d->tray && option.isWMDock != d->tray->isWMDock())) {
 		if(d->tray) {
@@ -478,4 +484,5 @@
 
 	d->tray->show();
+#endif	
 }
 
@@ -688,5 +695,5 @@
 void MainWin::actReadmeActivated ()
 {
-#ifdef Q_WS_WIN
+#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
 	ShowTextDlg *w = new ShowTextDlg(g.pathBase + "/readme.txt");
 #else
@@ -868,8 +875,19 @@
 #endif
 
-	if(allowed && closekey) {
-		close();
+	if(closekey) {
+#ifdef Q_WS_MAC
+		if(allowed) {
+			close();
+			e->accept();
+			return;
+		}
+#else			
+		if(allowed)
+			close();
+		else
+			showMinimized();
 		e->accept();
 		return;
+#endif
 	}
 
Index: psi/trunk/src/options/opt_application.cpp
===================================================================
--- psi/trunk/src/options/opt_application.cpp	(revision 18)
+++ psi/trunk/src/options/opt_application.cpp	(revision 19)
@@ -79,4 +79,11 @@
 	d->gb_docklet->hide();
 #endif
+#ifdef Q_WS_PM
+	/// @todo (dmik) disable "always on top" until implemented in Qt/2  
+	d->ck_alwaysOnTop->hide();
+	/// @todo (dmik) disable the docklet until the xCenter plugin is implemented
+	d->ck_docklet->hide();
+	d->gb_docklet->hide();
+#endif
 #ifndef Q_WS_X11
 	d->ck_dockUseWM->hide();
@@ -86,5 +93,7 @@
 }
 
+#ifdef Q_WS_X11
 static int om_x11browse[] = { 0, 2, 1 };
+#endif
 
 void OptionsTabApplication::applyOptions(Options *opt)
@@ -143,4 +152,10 @@
 	selectBrowser( opt->browser );
 #endif
+#ifdef Q_WS_PM
+	d->cb_link->insertItem(tr("PM Default Browser/Mail"));
+	d->cb_link->insertItem(tr("Custom"));
+	d->cb_link->setCurrentItem( opt->browser );
+	selectBrowser( opt->browser );
+#endif
 #ifdef Q_WS_X11
 	d->cb_link->insertItem(tr("KDE Default Browser/Mail"));
@@ -179,4 +194,8 @@
 
 #ifdef Q_WS_WIN
+	if(x == 0)
+		enableCustom = FALSE;
+#endif
+#ifdef Q_WS_PM
 	if(x == 0)
 		enableCustom = FALSE;
Index: psi/trunk/src/options/opt_general.cpp
===================================================================
--- psi/trunk/src/options/opt_general.cpp	(revision 18)
+++ psi/trunk/src/options/opt_general.cpp	(revision 19)
@@ -317,4 +317,10 @@
 	selectBrowser( opt->browser );
 #endif
+#ifdef Q_WS_PM
+	d->cb_link->insertItem(tr("PM Default Browser/Mail"));
+	d->cb_link->insertItem(tr("Custom"));
+	d->cb_link->setCurrentItem( opt->browser );
+	selectBrowser( opt->browser );
+#endif
 #ifdef Q_WS_X11
 	d->cb_link->insertItem(tr("KDE Default Browser/Mail"));
@@ -342,4 +348,8 @@
 
 #ifdef Q_WS_WIN
+	if(x == 0)
+		enableCustom = FALSE;
+#endif
+#ifdef Q_WS_PM
 	if(x == 0)
 		enableCustom = FALSE;
Index: psi/trunk/src/options/opt_sound.cpp
===================================================================
--- psi/trunk/src/options/opt_sound.cpp	(revision 18)
+++ psi/trunk/src/options/opt_sound.cpp	(revision 19)
@@ -102,4 +102,7 @@
 	d->lb_player->hide();
 	d->le_player->hide();
+#elif defined(Q_WS_PM)
+	d->lb_player->hide();
+	d->le_player->hide();
 #elif defined(Q_WS_MAC)
 	d->lb_player->hide();
@@ -133,4 +136,6 @@
 #if defined(Q_WS_WIN)
 	d->le_player->setText(tr("Windows Sound"));
+#elif defined(Q_WS_PM)
+	d->le_player->setText(tr("OS/2 MMPM Sound"));
 #elif defined(Q_WS_MAC)
 	d->le_player->setText(tr("Mac OS Sound"));
Index: psi/trunk/src/psi_profiles.cpp
===================================================================
--- psi/trunk/src/psi_profiles.cpp	(revision 18)
+++ psi/trunk/src/psi_profiles.cpp	(revision 19)
@@ -310,6 +310,6 @@
 void UserProfile::reset()
 {
-	bool nix, win, mac;
-	nix = win = mac = FALSE;
+	bool nix, win, mac, os2;
+	nix = win = mac = os2 = FALSE;
 
 #ifdef Q_WS_X11
@@ -321,4 +321,7 @@
 #ifdef Q_WS_MAC
 	mac = TRUE;
+#endif
+#ifdef Q_WS_PM
+	os2 = TRUE;
 #endif
 
