better notification support; dock icon;
system tray icon;
notification is given when the new message is received
and the dialog is not active window;
notification requires growl in Mac OS X
icon also changes until the window is reactivated
diff --git a/main.cpp b/main.cpp
index 6b73923..c12375a 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,10 +1,27 @@
 #include<QApplication>
 #include "chatdialog.h"
+#include <QMessageBox>
 
 int main(int argc, char *argv[]) 
 {
+
+  Q_INIT_RESOURCE(demo);
   QApplication app(argc, argv);
+
+  if (!QSystemTrayIcon::isSystemTrayAvailable()) {
+    QMessageBox::critical(0, QObject::tr("Systray"),
+			  QObject::tr("I couldn't detect any system tray "
+				      "on this system."));
+    return 1;
+  }
+  QApplication::setQuitOnLastWindowClosed(false);
   
+#ifdef __APPLE__
+	app.setWindowIcon(QIcon(":/demo.icns"));
+#else
+	app.setWindowIcon(QIcon(":/images/icon_large.png"));
+#endif
+
   ChatDialog dialog;
   dialog.show();
   dialog.activateWindow();