[X2go-Commits] x2goclient.git - build-main (branch) updated: 3.99.0.0

X2go dev team git-admin at x2go.org
Wed Jul 20 16:36:58 CEST 2011


The branch, build-main has been updated
       via  acdb1da43cb0d50655730f98e8bf1e6a4305b57d (commit)
       via  3927e84a7269d743d41f968035484d58bf13db95 (commit)
       via  9a9cf3cd1a655ce2d13fad4b060c290433991182 (commit)
       via  b123aaa45596b77229e74a5c4922bf4c412d6925 (commit)
       via  6d416e90158c358f28537a63726ed6e37129da4f (commit)
       via  bea17e3a83f63a5e8bd964de3b8c601055c9f4ae (commit)
       via  34f39898b958bc37bd93c24f5605e0c90c0ac78e (commit)
       via  e73a88d9f7f53e102ddac38122b52c4a089514e6 (commit)
       via  7377e0ea98f56cdf97fff63d3ea69d7a20c8eb1f (commit)
       via  23cc0c462239bc27076a475fb541bf5c3c6767ec (commit)
       via  5707123a0d785ac9c39f52efb1faef7f2ba805bd (commit)
       via  6407572762a8f075faf4196727309026278d140e (commit)
       via  7ad98aef0e13b0995301f23040de97904136f675 (commit)
       via  65a3fac817ad226495fff111d29c101cd7a7b33f (commit)
       via  735999b379fd2c8847b8ae75efdb883db3dd4e4f (commit)
       via  0644601277a38e38648592e9b1c2181aad3b29f6 (commit)
       via  50e5d01f0576d3f12cbcdf1409770c87ae7f7606 (commit)
       via  66f6f27b4d0cd52642084e085476ed188a3e310e (commit)
      from  5928d871ab9ad2e976ab55569cbbd59c246df10e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 .DS_Store                                   |  Bin 6148 -> 0 bytes
 .build_man2html/html/man1/x2goclient.1.html |   62 ++-
 .kdev4/x2goclient-3.01-libssh.kdev4         |   20 -
 INSTALL                                     |    2 +-
 VERSION                                     |    2 +-
 brokerpassdialog.ui                         |  182 ++++++
 brokerpassdlg.cpp                           |   71 +++
 xsettingswidget.h => brokerpassdlg.h        |   26 +-
 build_win_plugin.bat                        |    7 +
 config_linux_static.sh                      |    2 +-
 config_linux_static_plugin.sh               |    1 +
 debian/changelog                            |   37 ++-
 debian/control                              |    2 +-
 desktop/x2goclient.desktop                  |    2 +-
 httpbrokerclient.cpp                        |  824 +++++++++++++++------------
 httpbrokerclient.h                          |   63 ++-
 icons/32x32/auth.png                        |  Bin 0 -> 1686 bytes
 man/man1/x2goclient.1                       |   51 +-
 object_script.x2goclient.Debug              |    2 +
 object_script.x2goclient.Release            |    2 +
 onmainwindow.cpp                            |  306 +++++++++-
 onmainwindow.h                              |   45 ++-
 onmainwindow_part2.cpp                      |  230 ++++++--
 onmainwindow_part3.cpp                      |  167 +++++-
 onmainwindow_part4.cpp                      |  152 ++++--
 onmainwindow_privat.h                       |    1 +
 resources.rcc                               |    1 +
 sessionbutton.cpp                           |  111 +++-
 sessionbutton.h                             |    1 +
 sshmasterconnection.cpp                     |   28 +-
 sshmasterconnection.h                       |   10 +-
 sshprocess.cpp                              |    2 +-
 version.h                                   |    2 +-
 wapi.cpp                                    |   32 +
 wapi.h                                      |    2 +
 x2goclient-3.01-libssh.kdev4                |    3 -
 x2goclient.kdevelop                         |  204 -------
 x2goclient.kdevelop.pcs                     |  Bin 442256 -> 0 bytes
 x2goclient.kdevses                          |   34 --
 x2goclient.pro                              |   17 +-
 x2goclientconfig.h                          |    2 +-
 x2goplugin.rc                               |   10 +-
 x2gosettings.cpp                            |   50 ++-
 x2gosettings.h                              |    4 +-
 xsettingsui.ui                              |   29 +-
 xsettingswidget.cpp                         |   14 +-
 46 files changed, 1858 insertions(+), 957 deletions(-)
 delete mode 100644 .DS_Store
 delete mode 100644 .kdev4/x2goclient-3.01-libssh.kdev4
 create mode 100644 brokerpassdialog.ui
 create mode 100644 brokerpassdlg.cpp
 copy xsettingswidget.h => brokerpassdlg.h (63%)
 create mode 100755 build_win_plugin.bat
 create mode 100644 icons/32x32/auth.png
 delete mode 100644 x2goclient-3.01-libssh.kdev4
 delete mode 100644 x2goclient.kdevelop
 delete mode 100644 x2goclient.kdevelop.pcs
 delete mode 100644 x2goclient.kdevses

The diff of changes is:
diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index 5008ddf..0000000
Binary files a/.DS_Store and /dev/null differ
diff --git a/.build_man2html/html/man1/x2goclient.1.html b/.build_man2html/html/man1/x2goclient.1.html
index 996ef2a..1e6d7c4 100644
--- a/.build_man2html/html/man1/x2goclient.1.html
+++ b/.build_man2html/html/man1/x2goclient.1.html
@@ -4,7 +4,7 @@ Content-type: text/html
 <HTML><HEAD><TITLE>Man page of x2goclient</TITLE>
 </HEAD><BODY>
 <H1>x2goclient</H1>
-Section: X2go Client (Qt4) (1)<BR>Updated: 19 May 2011<BR><A HREF="#index">Index</A>
+Section: X2go Client (Qt4) (1)<BR>Updated: July 2011<BR><A HREF="#index">Index</A>
 <A HREF="../index.html">Return to Main Contents</A><HR>
 
 <A NAME="lbAB"> </A>
@@ -38,26 +38,22 @@ Hide menu-/toolbar (default: false).
 Start client maximized (default: false).
 <DT><B>--hide</B><DD>
 Hide client (start hidden, default: false).
-<DT><B>--pgp-card</B><DD>
-Use openPGP Card authentification (default: false).
-<DT><B>--add-to-known-hosts</B><DD>
-Add DSA/RSA host key fingerprint to .ssh/known_hosts in case of "authenticity of server can't be established".
-<DT><B>--ssh-port</B><DD>
-Use this TCP/IP port for connection (default: 22).
 <DT><B>--client-ssh-port</B><DD>
 Local ssh port (for filesystem export, default: 22).
+<DT><B>--user</B><DD>
+Pre-selection of user at client startup (LDAP mode).
+</DL>
+<A NAME="lbAF"> </A>
+<H2>PROFILING SESSIONS GLOBALLY</H2>
+
+You can pre-profile sessions globally using the following options. They will override the options in the session profiles.
+<DL COMPACT>
 <DT><B>--command</B><DD>
 Default command for session startup.
-<DT><B>--session</B><DD>
-Pre-selection of session at client startup.
 <DT><B>--sessionid</B><DD>
 Pre-selection of session ID at client startup.
-<DT><B>--user</B><DD>
-Pre-selection of user at client startup (LDAP mode).
-<DT><B>--fullscreen</B><DD>
-Start session in fullscreen mode.
-<DT><B>--width</B><DD>
-Start session with this width (default: 800).
+<DT><B>--ssh-port</B><DD>
+Use this TCP/IP port for connection (default: 22).
 <DT><B>--link</B><DD>
 Set default link type (modem,isdn,adsl,wan or lan, default: adsl).
 <DT><B>--pack</B><DD>
@@ -70,12 +66,36 @@ Overwrite current keyboard settings, no override by default.
 Set keyboard layout (default: 'de').
 <DT><B>--kbd-type</B><DD>
 Set keyboard type (default: pc105/de).
+<DT><B>--fullscreen</B><DD>
+Start session in fullscreen mode.
+<DT><B>--width</B><DD>
+Start session with this width (default: 800).
 <DT><B>--sound</B><DD>
 Activate sound for session, not enabled by default.
 <DT><B>--sound-system</B><DD>
 Which soundsystem to use: arts, esd, pulse (default: arts).
 </DL>
-<A NAME="lbAF"> </A>
+<A NAME="lbAG"> </A>
+<H2>THIN CLIENT OPTIONS</H2>
+
+The following command line options are primarily interesting if <B>x2goclient</B> is used
+as a login manager on X2go thin clients.
+<DL COMPACT>
+<DT><B>--session=<session-profile-name></B><DD>
+Pre-selection of session at client startup.
+<DT><B>--no-session-edit</B><DD>
+Disable session editing.
+<DT><B>--pgp-card</B><DD>
+Use openPGP Card authentication (default: false).
+<DT><B>--external-login=<smartcard-logins></B><DD>
+Authenticate via SMART card, path to login notification file.
+<DT><B>--add-to-known-hosts</B><DD>
+Add DSA/RSA host key fingerprint to .ssh/known_hosts in case of "authenticity of server can't be established".
+<DT><B>--read-exports-from</B><DD>
+Specifies a directory where some external mechanism (e.g. script) can notify <B>x2goclient</B> on
+new block devices (CD/DVDs, USB sticks, etc.).
+</DL>
+<A NAME="lbAH"> </A>
 <H2>LDAP OPTIONS</H2>
 
 In case you want to provide <B>x2goclient</B> session profiles from LDAP use the following options:
@@ -97,7 +117,7 @@ Failover LDAP Server hostname.
 </DL>
 <P>
 
-<A NAME="lbAG"> </A>
+<A NAME="lbAI"> </A>
 <H2>AUTHOR</H2>
 
 This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel at das-netzwerkteam.de">mike.gabriel at das-netzwerkteam.de</A>> for the X2go project
@@ -111,13 +131,15 @@ This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel at da
 <DT><A HREF="#lbAC">SYNOPSIS</A><DD>
 <DT><A HREF="#lbAD">DESCRIPTION</A><DD>
 <DT><A HREF="#lbAE">OPTIONS</A><DD>
-<DT><A HREF="#lbAF">LDAP OPTIONS</A><DD>
-<DT><A HREF="#lbAG">AUTHOR</A><DD>
+<DT><A HREF="#lbAF">PROFILING SESSIONS GLOBALLY</A><DD>
+<DT><A HREF="#lbAG">THIN CLIENT OPTIONS</A><DD>
+<DT><A HREF="#lbAH">LDAP OPTIONS</A><DD>
+<DT><A HREF="#lbAI">AUTHOR</A><DD>
 </DL>
 <HR>
 This document was created by
 <A HREF="/cgi-bin/man/man2html">man2html</A>,
 using the manual pages.<BR>
-Time: 10:50:01 GMT, May 30, 2011
+Time: 19:44:02 GMT, July 11, 2011
 </BODY>
 </HTML>
diff --git a/.kdev4/x2goclient-3.01-libssh.kdev4 b/.kdev4/x2goclient-3.01-libssh.kdev4
deleted file mode 100644
index 4e0da72..0000000
--- a/.kdev4/x2goclient-3.01-libssh.kdev4
+++ /dev/null
@@ -1,20 +0,0 @@
-[Buildset]
-BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00,\x00x\x002\x00g\x00o\x00c\x00l\x00i\x00e\x00n\x00t\x00-\x003\x00.\x000\x001\x00-\x00l\x00i\x00b\x00s\x00s\x00h)
-
-[Launch]
-Launch Configurations=Launch Configuration 0
-
-[Launch][Launch Configuration 0]
-Configured Launch Modes=execute
-Configured Launchers=nativeAppLauncher
-Name=New Native Application Configuration
-Type=Native Application
-
-[Launch][Launch Configuration 0][Data]
-Arguments=
-Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x00)
-Dependency Action=Nothing
-EnvironmentGroup=default
-Executable=file:///usr/src.cur/db-builds/x2goclient/x2goclient-3.01/x2goclient
-Working Directory=
-isExecutable=true
diff --git a/INSTALL b/INSTALL
index 6bef37b..05d9730 100644
--- a/INSTALL
+++ b/INSTALL
@@ -7,7 +7,7 @@ Qt4:
 http://www.trolltech.com
 
 nxcomp+nxproxy:
-http://code.x2go.org/releases
+http://www.nomachine.com/sources.php
 
 You may want also install pulseaudio sound server to enable sound support 
 http://www.pulseaudio.org/wiki/DownloadPulseAudio
diff --git a/VERSION b/VERSION
index df46582..4026527 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.0.1.18
+3.99.0.0
diff --git a/brokerpassdialog.ui b/brokerpassdialog.ui
new file mode 100644
index 0000000..333a577
--- /dev/null
+++ b/brokerpassdialog.ui
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>BrokerPassDialogUi</class>
+ <widget class="QDialog" name="BrokerPassDialogUi">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>311</width>
+    <height>160</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="label">
+       <property name="text">
+        <string>Old password:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QLineEdit" name="leOldPas">
+       <property name="echoMode">
+        <enum>QLineEdit::Password</enum>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="label_2">
+       <property name="text">
+        <string>New password:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QLineEdit" name="lePass1">
+       <property name="echoMode">
+        <enum>QLineEdit::Password</enum>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0">
+      <widget class="QLabel" name="label_3">
+       <property name="text">
+        <string>Confirm password:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1">
+      <widget class="QLineEdit" name="lePass2">
+       <property name="echoMode">
+        <enum>QLineEdit::Password</enum>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item>
+    <widget class="QLabel" name="statusLabel">
+     <property name="text">
+      <string>TextLabel</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QDialogButtonBox" name="buttonBox">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="standardButtons">
+        <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>BrokerPassDialogUi</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>292</x>
+     <y>143</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>153</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>BrokerPassDialogUi</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>286</x>
+     <y>143</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>153</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>lePass1</sender>
+   <signal>textChanged(QString)</signal>
+   <receiver>BrokerPassDialogUi</receiver>
+   <slot>slotPassChanged()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>167</x>
+     <y>46</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>103</x>
+     <y>113</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>lePass2</sender>
+   <signal>textChanged(QString)</signal>
+   <receiver>BrokerPassDialogUi</receiver>
+   <slot>slotPassChanged()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>215</x>
+     <y>79</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>208</x>
+     <y>105</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <slot>slotPassChanged()</slot>
+ </slots>
+</ui>
diff --git a/brokerpassdlg.cpp b/brokerpassdlg.cpp
new file mode 100644
index 0000000..b3a7571
--- /dev/null
+++ b/brokerpassdlg.cpp
@@ -0,0 +1,71 @@
+/*
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 2011  Oleksandr Shneyder
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "brokerpassdlg.h"
+#include <QPushButton>
+
+BrokerPassDlg::BrokerPassDlg(QWidget* parent, Qt::WindowFlags f): QDialog(parent, f)
+{
+    setupUi(this);
+    statusLabel->setText(QString::null);
+    buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
+}
+
+BrokerPassDlg::~BrokerPassDlg()
+{
+
+}
+
+void BrokerPassDlg::slotPassChanged()
+{
+    bool passEq=false;
+    if (lePass1->text()!=lePass2->text())
+    {
+        passEq=false;
+        statusLabel->setText(tr("Passwords do not match"));
+    }
+    else
+    {
+        passEq=true;
+        statusLabel->setText(QString::null);
+    }
+    buttonBox->button(QDialogButtonBox::Ok)->setEnabled(passEq &&
+            lePass1->text().size()>0 &&
+            leOldPas->text().size()>0);
+}
+
+void BrokerPassDlg::accept()
+{
+    QDialog::accept();
+}
+
+void BrokerPassDlg::reject()
+{
+    QDialog::reject();
+}
+
+QString BrokerPassDlg::newPass()
+{
+    return lePass1->text();
+}
+
+QString BrokerPassDlg::oldPass()
+{
+    return leOldPas->text();
+}
diff --git a/xsettingswidget.h b/brokerpassdlg.h
similarity index 63%
copy from xsettingswidget.h
copy to brokerpassdlg.h
index 0a441cf..90b3ba2 100644
--- a/xsettingswidget.h
+++ b/brokerpassdlg.h
@@ -1,6 +1,6 @@
 /*
     <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) 2011  Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
+    Copyright (C) 2011 Oleksandr Shneyder
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -17,23 +17,25 @@
 
 */
 
-#ifndef XSETTINGSWIDGET_H
-#define XSETTINGSWIDGET_H
+#ifndef BROKERPASSDLG_H
+#define BROKERPASSDLG_H
 
-#include <QWidget>
 
-#include "ui_xsettingsui.h"
+#include <QDialog>
+#include "ui_brokerpassdialog.h"
 
-class XSettingsWidget : public QWidget, private Ui_XSettingsWidgetUI
+class BrokerPassDlg: public QDialog, private Ui_BrokerPassDialogUi
 {
     Q_OBJECT
 public:
-    XSettingsWidget(QWidget* parent = 0);
-    virtual ~XSettingsWidget();
-    void setDefaults();
-    void saveSettings();
+    BrokerPassDlg(QWidget* parent = 0, Qt::WindowFlags f = 0);
+    virtual ~BrokerPassDlg();
+    virtual void accept();
+    virtual void reject();
+    QString oldPass();
+    QString newPass();
 private slots:
-    void slotSetExecutable();
+    void slotPassChanged();
 };
 
-#endif // XSETTINGSWIDGET_H
+#endif // BROKERPASSDLG_H
diff --git a/build_win_plugin.bat b/build_win_plugin.bat
new file mode 100755
index 0000000..61989d0
--- /dev/null
+++ b/build_win_plugin.bat
@@ -0,0 +1,7 @@
+mingw32-make
+copy release\npx2goplugin.dll d:\share\plugin\x2goplugin\
+d:
+cd  \share\plugin\x2goplugin\
+idc.exe npx2goplugin.dll /idl npx2goplugin.idl -version 1.0
+midl npx2goplugin.idl /nologo /tlb npx2goplugin.tlb
+idc.exe npx2goplugin.dll /tlb npx2goplugin.tlb
diff --git a/config_linux_static.sh b/config_linux_static.sh
index 294b1d3..a51bac9 100755
--- a/config_linux_static.sh
+++ b/config_linux_static.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
 
 make distclean
-/usr/local/Trolltech/Qt-4.7.1/bin/qmake -config release -spec linux-g++
+X2GO_LINUX_STATIC=x2go_linux_static /usr/local/Trolltech/Qt-4.7.1/bin/qmake -config release -spec linux-g++
 
diff --git a/config_linux_static_plugin.sh b/config_linux_static_plugin.sh
index b3ad0d9..4776a3c 100755
--- a/config_linux_static_plugin.sh
+++ b/config_linux_static_plugin.sh
@@ -2,4 +2,5 @@
 
 make distclean
 
+export X2GO_LINUX_STATIC=x2go_linux_static
 X2GO_CLIENT_TARGET=plugin /usr/local/Trolltech/Qt-4.7.1/bin/qmake -config release -spec linux-g++
diff --git a/debian/changelog b/debian/changelog
index d3919b6..d6ca411 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,39 @@
-x2goclient (3.0.1.18-0~x2go3) UNRELEASED; urgency=low
+x2goclient (3.99.0.0-0~x2go1) unstable; urgency=low
 
-  * add ssh (server) as runtime dependency
+  [ Oleksandr Shneyder ]
+  * fixed loadbalancing in LDAP mode on multiply X2Go servers
+  * fixed session crash by pulling out of smart card
 
- -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Thu, 16 Jun 2011 17:13:57 +0200
+ -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Wed, 20 Jul 2011 16:33:08 +0200
+
+x2goclient (3.0.1.21-0~x2go1) unstable; urgency=low
+
+  * changes in windows plugin
+
+ -- Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>  Thu, 30 Jun 2011 18:45:25 +0200
+
+x2goclient (3.0.1.20-0~x2go1) unstable; urgency=low
+
+  * support menu
+  * custom background
+  * custom icon on broker auth dialog
+  * fixed creation of desktop icons on windows
+
+ -- Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>  Fri, 08 Apr 2011 19:18:30 +0200
+
+x2goclient (3.0.1.19-0~x2go1) unstable; urgency=low
+
+  * Support to get sessions from for web broker
+
+ -- Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>  Thu, 29 Mar 2011 18:34:08 +0200
+
+x2goclient (3.0.1.18-0~x2go3) unstable; urgency=low
+
+  * Add ssh (server) as runtime dependency
+  * React to bug #627990, prefer man2html-base over man2html.
+  * Use x2goumount-session instead of old x2goumount_session command.
+
+ -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Thu, 14 Jul 2011 09:07:59 +0200
 
 x2goclient (3.0.1.18-0~x2go2) unstable; urgency=low
 
diff --git a/debian/control b/debian/control
index 6c73433..ec189fa 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@ Build-Depends:
  libcups2-dev,
  libx11-dev,
  doxygen,
- man2html
+ man2html-base | man2html
 Standards-Version: 3.9.2
 Homepage: http://code.x2go.org/releases/source/x2goclient
 Vcs-Git: git://code.x2go.org/x2goclient.git
diff --git a/desktop/x2goclient.desktop b/desktop/x2goclient.desktop
index 29283c1..fbf9efb 100644
--- a/desktop/x2goclient.desktop
+++ b/desktop/x2goclient.desktop
@@ -1,6 +1,6 @@
 [Desktop Entry]
 Encoding=UTF-8
-Version=3.0.1.18
+Version=3.99.0.0
 Type=Application
 Name=X2Go Client
 Exec=/usr/bin/x2goclient
diff --git a/httpbrokerclient.cpp b/httpbrokerclient.cpp
index 2d7fcc4..0e0a6ab 100644
--- a/httpbrokerclient.cpp
+++ b/httpbrokerclient.cpp
@@ -24,195 +24,263 @@
 #include <QTimer>
 #include "SVGFrame.h"
 #include "onmainwindow.h"
+#include <QTemporaryFile>
 
 HttpBrokerClient::HttpBrokerClient ( ONMainWindow* wnd, ConfigFile* cfg )
 {
-	config=cfg;
-	mainWindow=wnd;
-	cmdRequest=sinfoKeyRequest=sinfoRequest=-1;
-	QUrl lurl ( config->brokerurl );
-	http=new QHttp ( this );
-
-	if ( config->brokerurl.indexOf ( "https://" ) !=-1 )
-		http->setHost ( lurl.host(),QHttp::ConnectionModeHttps,
-		                lurl.port ( 443 ) );
-	else
-		http->setHost ( lurl.host(),QHttp::ConnectionModeHttp,
-		                lurl.port ( 80 ) );
-
-	connect ( http,SIGNAL ( requestFinished ( int,bool ) ),this,
-	          SLOT ( slotRequestFinished ( int,bool ) ) );
-	connect ( http,SIGNAL ( sslErrors ( const QList<QSslError>& ) ),this,
-	          SLOT ( slotSslErrors ( const QList<QSslError>& ) ) );
-	getSInfoFromBroker ( true );
+    config=cfg;
+    mainWindow=wnd;
+    cmdRequest=sinfoKeyRequest=sinfoRequest=-1;
+    QUrl lurl ( config->brokerurl );
+    http=new QHttp ( this );
+
+    if ( config->brokerurl.indexOf ( "https://" ) !=-1 )
+        http->setHost ( lurl.host(),QHttp::ConnectionModeHttps,
+                        lurl.port ( 443 ) );
+    else
+        http->setHost ( lurl.host(),QHttp::ConnectionModeHttp,
+                        lurl.port ( 80 ) );
+
+    connect ( http,SIGNAL ( requestFinished ( int,bool ) ),this,
+              SLOT ( slotRequestFinished ( int,bool ) ) );
+    connect ( http,SIGNAL ( sslErrors ( const QList<QSslError>& ) ),this,
+              SLOT ( slotSslErrors ( const QList<QSslError>& ) ) );
+    if (!wnd->brokerMode)
+        getSInfoFromBroker ( true );
 }
 
 
 HttpBrokerClient::~HttpBrokerClient()
 {
+
+}
+
+void HttpBrokerClient::getUserSessions()
+{
+    QString req;
+    QTextStream ( &req ) <<
+    "task=listsessions&"<<
+    "user="<<config->brokerUser<<"&"<<
+    "password="<<config->brokerPass<<"&"<<
+    "authid="<<config->brokerUserId;
+    QUrl lurl ( config->brokerurl );
+    httpSessionAnswer.close();
+    httpSessionAnswer.setData ( 0,0 );
+    sessionsRequest=http->post ( lurl.path(),req.toUtf8(),&httpSessionAnswer );
+    config->sessiondata=QString::null;
+
+}
+
+void HttpBrokerClient::selectUserSession(const QString& session)
+{
+//     x2goDebug<<"selected sid: "<<session;
+    QString req;
+    QTextStream ( &req ) <<
+    "task=selectsession&"<<
+    "sid="<<session<<"&"<<
+    "user="<<config->brokerUser<<"&"<<
+    "password="<<config->brokerPass<<"&"<<
+    "authid="<<config->brokerUserId;
+    QUrl lurl ( config->brokerurl );
+    httpSessionAnswer.close();
+    httpSessionAnswer.setData ( 0,0 );
+    selSessRequest=http->post ( lurl.path(),req.toUtf8(),&httpSessionAnswer );
+
+}
+
+void HttpBrokerClient::changePassword(QString newPass)
+{
+    newBrokerPass=newPass;
+    QString req;
+    QTextStream ( &req ) <<
+    "task=setpass&"<<
+    "newpass="<<newPass<<"&"<<
+    "user="<<config->brokerUser<<"&"<<
+    "password="<<config->brokerPass<<"&"<<
+    "authid="<<config->brokerUserId;
+    QUrl lurl ( config->brokerurl );
+    httpSessionAnswer.close();
+    httpSessionAnswer.setData ( 0,0 );
+    chPassRequest=http->post ( lurl.path(),req.toUtf8(),&httpSessionAnswer );
+
+}
+
+
+void HttpBrokerClient::createIniFile(const QString& content)
+{
+    QString cont;
+    QStringList lines=content.split("START_USER_SESSIONS<br>");
+    if (lines.count()>1)
+    {
+        cont=lines[1];
+        cont=cont.split("END_USER_SESSIONS")[0];
+        cont.replace("\n","");
+        cont.replace("<br>","\n");
+    }
+    mainWindow->config.iniFile=cont;
 }
 
 QString HttpBrokerClient::getSInfoFromBroker ( bool getKey )
 {
 
-	QString pack;
-	bool fullscreen;
-	int height;
-	int width;
-	int quality;
-	int speed;
-	bool usekbd;
-	bool setDPI=false;
-	uint dpi=96;
-	QString layout;
-	QString type;
-	QString homeDir=QDir::homePath();
-	X2goSettings st( "sessions" );
-
-	QString sid;
-	sid="embedded";
-	pack=st.setting()->value ( sid+"/pack",
-	                ( QVariant ) "16m-jpeg" ).toString();
-	fullscreen=st.setting()->value ( sid+"/fullscreen",
-	                      ( QVariant )
-	                      false ).toBool();
-	height=st.setting()->value ( sid+"/height",
-	                  ( QVariant ) 600 ).toInt();
-	width=st.setting()->value ( sid+"/width",
-	                 ( QVariant ) 800 ).toInt();
-	setDPI=st.setting()->value ( sid+"/setdpi",
-	                  ( QVariant ) false ).toBool();
-	dpi=st.setting()->value ( sid+"/dpi",
-	               ( QVariant ) 96 ).toUInt();
-	quality=st.setting()->value (
-	            sid+"/quality",
-	            ( QVariant ) 9 ).toInt();
-	speed=st.setting()->value ( sid+"/speed",
-	                 ( QVariant ) 2 ).toInt();
-	usekbd=st.setting()->value ( sid+"/usekbd",
-	                  ( QVariant ) true ).toBool();
-	layout=st.setting()->value ( sid+"/layout",
-	                  ( QVariant )
-	                  tr ( "us" ) ).toString();
-	type=st.setting()->value ( sid+"/type",
-	                ( QVariant )
-	                tr ( "pc105/us" ) ).toString();
-	bool startEmbedded=false;
-	if ( st.setting()->value ( sid+"/startembed",
-	                ( QVariant ) true ).toBool() )
-	{
-		startEmbedded=true;
-		fullscreen=false;
-		QSize sz=mainWindow->getEmbedAreaSize();
-		height=sz.height();
-		width=sz.width();
-
-	}
-
-	QString geometry;
-	if ( fullscreen )
-	{
-		geometry="fullscreen";
+    QString pack;
+    bool fullscreen;
+    int height;
+    int width;
+    int quality;
+    int speed;
+    bool usekbd;
+    bool setDPI=false;
+    uint dpi=96;
+    QString layout;
+    QString type;
+    QString homeDir=mainWindow->getHomeDirectory();
+    X2goSettings st( "sessions" );
+
+    QString sid;
+    sid="embedded";
+    pack=st.setting()->value ( sid+"/pack",
+                               ( QVariant ) "16m-jpeg" ).toString();
+    fullscreen=st.setting()->value ( sid+"/fullscreen",
+                                     ( QVariant )
+                                     false ).toBool();
+    height=st.setting()->value ( sid+"/height",
+                                 ( QVariant ) 600 ).toInt();
+    width=st.setting()->value ( sid+"/width",
+                                ( QVariant ) 800 ).toInt();
+    setDPI=st.setting()->value ( sid+"/setdpi",
+                                 ( QVariant ) false ).toBool();
+    dpi=st.setting()->value ( sid+"/dpi",
+                              ( QVariant ) 96 ).toUInt();
+    quality=st.setting()->value (
+                sid+"/quality",
+                ( QVariant ) 9 ).toInt();
+    speed=st.setting()->value ( sid+"/speed",
+                                ( QVariant ) 2 ).toInt();
+    usekbd=st.setting()->value ( sid+"/usekbd",
+                                 ( QVariant ) true ).toBool();
+    layout=st.setting()->value ( sid+"/layout",
+                                 ( QVariant )
+                                 tr ( "us" ) ).toString();
+    type=st.setting()->value ( sid+"/type",
+                               ( QVariant )
+                               tr ( "pc105/us" ) ).toString();
+    bool startEmbedded=false;
+    if ( st.setting()->value ( sid+"/startembed",
+                               ( QVariant ) true ).toBool() )
+    {
+        startEmbedded=true;
+        fullscreen=false;
+        QSize sz=mainWindow->getEmbedAreaSize();
+        height=sz.height();
+        width=sz.width();
+
+    }
+
+    QString geometry;
+    if ( fullscreen )
+    {
+        geometry="fullscreen";
 #ifdef Q_OS_WIN
-		fullscreen=false;
+        fullscreen=false;
 #endif
-	}
-	if ( ! fullscreen )
-	{
-		geometry=QString::number ( width ) +"x"+
-		         QString::number ( height );
-
-	}
-	QString link;
-	switch ( speed )
-	{
-		case 0:
-			link="modem";
-			break;
-		case 1:
-			link="isdn";
-			break;
-		case 2:
-			link="adsl";
-			break;
-		case 3:
-			link="wan";
-			break;
-		case 4:
-			link="lan";
-			break;
-	}
-
-	QFile file ( ":/txt/packs" );
-	file.open ( QIODevice::ReadOnly | QIODevice::Text );
-	QTextStream in ( &file );
-	while ( !in.atEnd() )
-	{
-		QString pc=in.readLine();
-		if ( pc.indexOf ( "-%" ) !=-1 )
-		{
-			pc=pc.left ( pc.indexOf ( "-%" ) );
-			if ( pc==pack )
-			{
-				pack+="-"+QString::number ( quality );
-				break;
-			}
-		}
-	}
-	file.close();
-
-	QDesktopWidget wd;
-	QString depth=QString::number ( wd.depth() );
+    }
+    if ( ! fullscreen )
+    {
+        geometry=QString::number ( width ) +"x"+
+                 QString::number ( height );
+
+    }
+    QString link;
+    switch ( speed )
+    {
+    case 0:
+        link="modem";
+        break;
+    case 1:
+        link="isdn";
+        break;
+    case 2:
+        link="adsl";
+        break;
+    case 3:
+        link="wan";
+        break;
+    case 4:
+        link="lan";
+        break;
+    }
+
+    QFile file ( ":/txt/packs" );
+    file.open ( QIODevice::ReadOnly | QIODevice::Text );
+    QTextStream in ( &file );
+    while ( !in.atEnd() )
+    {
+        QString pc=in.readLine();
+        if ( pc.indexOf ( "-%" ) !=-1 )
+        {
+            pc=pc.left ( pc.indexOf ( "-%" ) );
+            if ( pc==pack )
+            {
+                pack+="-"+QString::number ( quality );
+                break;
+            }
+        }
+    }
+    file.close();
+
+    QDesktopWidget wd;
+    QString depth=QString::number ( wd.depth() );
 #ifdef Q_OS_DARWIN
-	usekbd=0;
-	type="query";
+    usekbd=0;
+    type="query";
 #endif
-	QString dpiS;
-	if ( setDPI )
-	{
-		dpiS=QString::number ( dpi );
-	}
-	else
-		dpiS="noset";
-	QString useKbdS;
-	if ( usekbd )
-		useKbdS="1";
-	else
-		useKbdS="0";
-
-
-	QString req;
-	QTextStream ( &req ) <<
-	"mode=getsinfo&"<<
-	"geometry="<<geometry<<"&"
-	"link="<<link<<"&"
-	"pack="<<pack<<"&"
-	"depth="<<depth<<"&"
-	"layout="<<layout<<"&"
-	"type="<<type<<"&"
-	"usekbd="<<useKbdS<<"&"
-	"dpi="<<dpiS<<"&"
-	"user="<<config->user<<"&"<<
-	"connectionts="<<config->connectionts<<"&"<<
-	"cookie="<<config->cookie;
-	QUrl lurl ( config->brokerurl );
-	httpSIAnswer.close();
-	httpSIAnswer.setData ( 0,0 );
-	if ( getKey )
-	{
-		QTextStream ( &req ) <<"&"
-		"getkey=true";
-		sinfoKeyRequest=http->post ( lurl.path(),
-		                             req.toUtf8(),&httpSIAnswer );
-		x2goDebug<<"requested key :"<<sinfoKeyRequest;
-	}
-	else
-	{
-		sinfoRequest=http->post ( lurl.path(),
-		                          req.toUtf8(),&httpSIAnswer );
-		x2goDebug<<"requested session :"<<sinfoRequest;
-	}
-	return QString::null;
+    QString dpiS;
+    if ( setDPI )
+    {
+        dpiS=QString::number ( dpi );
+    }
+    else
+        dpiS="noset";
+    QString useKbdS;
+    if ( usekbd )
+        useKbdS="1";
+    else
+        useKbdS="0";
+
+
+    QString req;
+    QTextStream ( &req ) <<
+    "mode=getsinfo&"<<
+    "geometry="<<geometry<<"&"
+    "link="<<link<<"&"
+    "pack="<<pack<<"&"
+    "depth="<<depth<<"&"
+    "layout="<<layout<<"&"
+    "type="<<type<<"&"
+    "usekbd="<<useKbdS<<"&"
+    "dpi="<<dpiS<<"&"
+    "user="<<config->user<<"&"<<
+    "connectionts="<<config->connectionts<<"&"<<
+    "cookie="<<config->cookie;
+    QUrl lurl ( config->brokerurl );
+    httpSIAnswer.close();
+    httpSIAnswer.setData ( 0,0 );
+    if ( getKey )
+    {
+        QTextStream ( &req ) <<"&"
+        "getkey=true";
+        sinfoKeyRequest=http->post ( lurl.path(),
+                                     req.toUtf8(),&httpSIAnswer );
+        x2goDebug<<"requested key :"<<sinfoKeyRequest;
+    }
+    else
+    {
+        sinfoRequest=http->post ( lurl.path(),
+                                  req.toUtf8(),&httpSIAnswer );
+        x2goDebug<<"requested session :"<<sinfoRequest;
+    }
+    return QString::null;
 }
 
 
@@ -220,206 +288,250 @@ void HttpBrokerClient::slotRequestFinished ( int id, bool error )
 {
 //   	x2goDebug<<"http request "<<id<<", finished with: "<<error;
 
-	if ( error )
-		x2goDebug<<http->errorString();
-
-// 	QString answer ( httpCmdAnswer.data() );
-// 	x2goDebug<<"cmd request answer: "<<answer;
-
-	if ( id==sinfoKeyRequest || id==sinfoRequest )
-	{
+    if ( error )
+    {
+        x2goDebug<<http->errorString();
+        QMessageBox::critical(0,tr("Error"),http->errorString());
+        emit fatalHttpError();
+        return;
+    }
+
+//  	QString answer ( httpSiAnswer.data() );
+//  	x2goDebug<<"cmd request answer: "<<answer;
+    if ( id== sessionsRequest || id == selSessRequest || id==chPassRequest)
+    {
+        QString answer ( httpSessionAnswer.data() );
+        x2goDebug<<"cmd request answer: "<<answer;
+        if (answer.indexOf("Access granted")==-1)
+        {
+            QMessageBox::critical (
+                0,tr ( "Error" ),
+                tr ( "Login failed!<br>"
+                     "Please try again" ) );
+            emit authFailed();
+            return;
+        }
+        config->brokerAuthenticated=true;
+        if (id == sessionsRequest)
+        {
+            createIniFile(answer);
+            emit sessionsLoaded();
+        }
+        if (id == selSessRequest)
+        {
+            emit getSession(answer);
+        }
+        if ( id == chPassRequest)
+        {
+            if (answer.indexOf("CHANGING PASS OK")!=-1)
+            {
+                emit passwordChanged(newBrokerPass);
+            }
+            else
+            {
+                emit passwordChanged(QString::null);
+            }
+
+        }
+    }
+
+    if ( id==sinfoKeyRequest || id==sinfoRequest )
+    {
 // 		x2goDebug<<"Answer:"<<httpSIAnswer.data();
-		QString key ( httpSIAnswer.data() );
-		if ( key.indexOf ( "X2GO_BROKER_ERRORR-ACESS DENIED" ) !=-1 )
-		{
-			QMessageBox::critical (
-			    0,tr ( "Error" ),
-			    tr ( "Your session was disconnected. "
-			         "To get access to your running "
-			         "session, please return to the login page "
-			         "or use the \"reload\" function of "
-			         "your browser." ) );
-			emit fatalHttpError();
-			return;
-		}
-		QStringList strings=key.split ( "\n" );
-		for ( int i=0;i<strings.count();++i )
-		{
-			if ( strings[i].indexOf ( "x2gosession=" ) !=-1 )
-			{
-				QStringList vals=strings[i].split ( "=" );
-				config->sessiondata=vals[1];
-			}
-			if ( strings[i]=="rootless=false" )
-			{
-				config->rootless=false;
-			}
-			if ( strings[i]=="rootless=true" )
-			{
-				config->rootless=true;
-			}
-		}
-		if ( id==sinfoKeyRequest )
-		{
-			emit haveSshKey ( key );
-			QTimer::singleShot ( 5000, this,
-			                     SLOT ( slotGetConnectionCmd() ) );
-		}
-		else
-			emit haveAgentInfo();
-	}
-	if ( id==cmdRequest )
-	{
-		QString answer ( httpCmdAnswer.data() );
+        QString key ( httpSIAnswer.data() );
+        if ( key.indexOf ( "X2GO_BROKER_ERRORR-ACESS DENIED" ) !=-1 )
+        {
+            QMessageBox::critical (
+                0,tr ( "Error" ),
+                tr ( "Your session was disconnected. "
+                     "To get access to your running "
+                     "session, please return to the login page "
+                     "or use the \"reload\" function of "
+                     "your browser." ) );
+            emit fatalHttpError();
+            return;
+        }
+        QStringList strings=key.split ( "\n" );
+        for ( int i=0;i<strings.count();++i )
+        {
+            if ( strings[i].indexOf ( "x2gosession=" ) !=-1 )
+            {
+                QStringList vals=strings[i].split ( "=" );
+                config->sessiondata=vals[1];
+            }
+            if ( strings[i]=="rootless=false" )
+            {
+                config->rootless=false;
+            }
+            if ( strings[i]=="rootless=true" )
+            {
+                config->rootless=true;
+            }
+        }
+        if ( id==sinfoKeyRequest )
+        {
+            emit haveSshKey ( key );
+            QTimer::singleShot ( 5000, this,
+                                 SLOT ( slotGetConnectionCmd() ) );
+        }
+        else
+            emit haveAgentInfo();
+    }
+    if ( id==cmdRequest )
+    {
+        QString answer ( httpCmdAnswer.data() );
 //  		x2goDebug<<"cmd request answer: "<<answer;
-		if ( !error )
-		{
-			answer=answer.split (
-			           "<body onload=\"checkPlugin()\">" ) [1];
-			answer=answer.split ( "</body>" ) [0];
-			if ( answer.indexOf ( "CMD:0:" ) !=-1 )
-			{
-				x2goDebug<<"brocker sent reconnect cmd";
-				emit cmdReconnect();
-			}
-		}
-		QTimer::singleShot ( 3000, this,
-		                     SLOT ( slotGetConnectionCmd() ) );
-	}
+        if ( !error )
+        {
+            answer=answer.split (
+                       "<body onload=\"checkPlugin()\">" ) [1];
+            answer=answer.split ( "</body>" ) [0];
+            if ( answer.indexOf ( "CMD:0:" ) !=-1 )
+            {
+                x2goDebug<<"brocker sent reconnect cmd";
+                emit cmdReconnect();
+            }
+        }
+        QTimer::singleShot ( 3000, this,
+                             SLOT ( slotGetConnectionCmd() ) );
+    }
 }
 
 
 void HttpBrokerClient::slotSslErrors ( const QList<QSslError> & errors )
 {
-	QStringList err;
-	QSslCertificate cert;
-	for ( int i=0;i<errors.count();++i )
-	{
-		x2goDebug<<"sslError ,code:"<<errors[i].error() <<":";
-		err<<errors[i].errorString();
-		if ( !errors[i].certificate().isNull() )
-			cert=errors[i].certificate();
-	}
-
-
-	QString md5=getHexVal ( cert.digest() );
-	QString fname=md5;
-	fname=fname.replace(":","_");
-	QUrl lurl ( config->brokerurl );
-	QString homeDir=QDir::homePath();
-	if ( QFile::exists ( homeDir+"/.x2go/ssl/exceptions/"+
-	                     lurl.host() +"/"+fname ) )
-	{
-		QFile fl ( homeDir+"/.x2go/ssl/exceptions/"+
-		           lurl.host() +"/"+fname );
-		fl.open ( QIODevice::ReadOnly | QIODevice::Text );
-		QSslCertificate mcert ( &fl );
-		if ( mcert==cert )
-		{
-			http->ignoreSslErrors();
-			return;
-		}
-	}
-
-	QString text=tr ( "<br><b>Server uses an invalid "
-	                  "security certificate.</b><br><br>" );
-	text+=err.join ( "<br>" );
-	text+=tr ( "<p style='background:#FFFFDC;'>"
-	           "You should not add an exception "
-	           "if you are using an internet connection "
-	           "that you do not trust completely or if you are "
-	           "not used to seeing a warning for this server.</p>" );
-	QMessageBox mb ( QMessageBox::Warning,tr ( "Secure connection failed" ),
-	                 text );
-	text=QString::null;
-	QTextStream ( &text ) <<err.join ( "\n" ) <<"\n"<<
-	"------------\n"<<
-	tr ( "Issued to:\n" ) <<
-	tr ( "Common Name(CN)\t" ) <<
-	cert.issuerInfo ( QSslCertificate::CommonName )
-	<<endl<<
-	tr ( "Organization(O)\t" ) <<
-	cert.issuerInfo ( QSslCertificate::Organization )
-	<<endl<<
-	tr ( "Organizational Unit(OU)\t" ) <<
-	cert.issuerInfo ( QSslCertificate::OrganizationalUnitName )
-	<<endl<<
-	tr ( "Serial Number\t" ) <<getHexVal ( cert.serialNumber() )
-	<<endl<<endl<<
-	tr ( "Issued by:\n" ) <<
-	tr ( "Common Name(CN)\t" ) <<
-	cert.subjectInfo ( QSslCertificate::CommonName )
-	<<endl<<
-	tr ( "Organization(O)\t" ) <<
-	cert.subjectInfo ( QSslCertificate::Organization )
-	<<endl<<
-	tr ( "Organizational Unit(OU)\t" ) <<
-	cert.subjectInfo ( QSslCertificate::OrganizationalUnitName )
-	<<endl<<endl<<
-
-	tr ( "Validity:\n" ) <<
-	tr ( "Issued on\t" ) <<cert.effectiveDate().toString() <<endl<<
-	tr ( "expires on\t" ) <<cert.expiryDate().toString() <<endl<<endl<<
-	tr ( "Fingerprints:\n" ) <<
-	tr ( "SHA1\t" ) <<
-	getHexVal ( cert.digest ( QCryptographicHash::Sha1 ) ) <<endl<<
-	tr ( "MD5\t" ) <<md5;
-
-
-
-	mb.setDetailedText ( text );
-	mb.setEscapeButton (
-	    ( QAbstractButton* ) mb.addButton ( tr ( "Exit X2Go Client" ),
-	                                        QMessageBox::RejectRole ) );
-	QPushButton *okButton=mb.addButton ( tr ( "Add exception" ),
-	                                     QMessageBox::AcceptRole );
-	mb.setDefaultButton ( okButton );
-
-	mb.exec();
-	if ( mb.clickedButton() == ( QAbstractButton* ) okButton )
-	{
-		x2goDebug<<"accept certificate";
-		QDir dr;
-		dr.mkpath ( homeDir+"/.x2go/ssl/exceptions/"+lurl.host() +"/" );
-		QFile fl ( homeDir+"/.x2go/ssl/exceptions/"+
-		           lurl.host() +"/"+fname );
-		fl.open ( QIODevice::WriteOnly | QIODevice::Text );
-		QTextStream ( &fl ) <<cert.toPem();
-		fl.close();
-		http->ignoreSslErrors();
-	}
-	else
-		emit fatalHttpError();
+    QStringList err;
+    QSslCertificate cert;
+    for ( int i=0;i<errors.count();++i )
+    {
+        x2goDebug<<"sslError ,code:"<<errors[i].error() <<":";
+        err<<errors[i].errorString();
+        if ( !errors[i].certificate().isNull() )
+            cert=errors[i].certificate();
+    }
+
+
+    QString md5=getHexVal ( cert.digest() );
+    QString fname=md5;
+    fname=fname.replace(":","_");
+    QUrl lurl ( config->brokerurl );
+    QString homeDir=mainWindow->getHomeDirectory();
+    if ( QFile::exists ( homeDir+"/ssl/exceptions/"+
+                         lurl.host() +"/"+fname ) )
+    {
+        QFile fl ( homeDir+"/ssl/exceptions/"+
+                   lurl.host() +"/"+fname );
+        fl.open ( QIODevice::ReadOnly | QIODevice::Text );
+        QSslCertificate mcert ( &fl );
+        if ( mcert==cert )
+        {
+            http->ignoreSslErrors();
+            return;
+        }
+    }
+
+    QString text=tr ( "<br><b>Server uses an invalid "
+                      "security certificate.</b><br><br>" );
+    text+=err.join ( "<br>" );
+    text+=tr ( "<p style='background:#FFFFDC;'>"
+               "You should not add an exception "
+               "if you are using an internet connection "
+               "that you do not trust completely or if you are "
+               "not used to seeing a warning for this server.</p>" );
+    QMessageBox mb ( QMessageBox::Warning,tr ( "Secure connection failed" ),
+                     text );
+    text=QString::null;
+    QTextStream ( &text ) <<err.join ( "\n" ) <<"\n"<<
+    "------------\n"<<
+    tr ( "Issued to:\n" ) <<
+    tr ( "Common Name(CN)\t" ) <<
+    cert.issuerInfo ( QSslCertificate::CommonName )
+    <<endl<<
+    tr ( "Organization(O)\t" ) <<
+    cert.issuerInfo ( QSslCertificate::Organization )
+    <<endl<<
+    tr ( "Organizational Unit(OU)\t" ) <<
+    cert.issuerInfo ( QSslCertificate::OrganizationalUnitName )
+    <<endl<<
+    tr ( "Serial Number\t" ) <<getHexVal ( cert.serialNumber() )
+    <<endl<<endl<<
+    tr ( "Issued by:\n" ) <<
+    tr ( "Common Name(CN)\t" ) <<
+    cert.subjectInfo ( QSslCertificate::CommonName )
+    <<endl<<
+    tr ( "Organization(O)\t" ) <<
+    cert.subjectInfo ( QSslCertificate::Organization )
+    <<endl<<
+    tr ( "Organizational Unit(OU)\t" ) <<
+    cert.subjectInfo ( QSslCertificate::OrganizationalUnitName )
+    <<endl<<endl<<
+
+    tr ( "Validity:\n" ) <<
+    tr ( "Issued on\t" ) <<cert.effectiveDate().toString() <<endl<<
+    tr ( "expires on\t" ) <<cert.expiryDate().toString() <<endl<<endl<<
+    tr ( "Fingerprints:\n" ) <<
+    tr ( "SHA1\t" ) <<
+    getHexVal ( cert.digest ( QCryptographicHash::Sha1 ) ) <<endl<<
+    tr ( "MD5\t" ) <<md5;
+
+
+
+    mb.setDetailedText ( text );
+    mb.setEscapeButton (
+        ( QAbstractButton* ) mb.addButton ( tr ( "Exit X2Go Client" ),
+                                            QMessageBox::RejectRole ) );
+    QPushButton *okButton=mb.addButton ( tr ( "Add exception" ),
+                                         QMessageBox::AcceptRole );
+    mb.setDefaultButton ( okButton );
+
+    mb.exec();
+    if ( mb.clickedButton() == ( QAbstractButton* ) okButton )
+    {
+        x2goDebug<<"accept certificate";
+        QDir dr;
+        dr.mkpath ( homeDir+"/ssl/exceptions/"+lurl.host() +"/" );
+        QFile fl ( homeDir+"/ssl/exceptions/"+
+                   lurl.host() +"/"+fname );
+        fl.open ( QIODevice::WriteOnly | QIODevice::Text );
+        QTextStream ( &fl ) <<cert.toPem();
+        fl.close();
+        http->ignoreSslErrors();
+        x2goDebug<<"store certificate in  "<<homeDir+"/ssl/exceptions/"+
+                   lurl.host() +"/"+fname;
+
+    }
+    else
+        emit fatalHttpError();
 }
 
 
 QString HttpBrokerClient::getHexVal ( const QByteArray& ba )
 {
-	QStringList val;
-	for ( int i=0;i<ba.size();++i )
-	{
-		QString bt;
-		bt.sprintf ( "%02X", ( unsigned char ) ba[i] );
-		val<<bt;
-	}
-	return val.join ( ":" );
+    QStringList val;
+    for ( int i=0;i<ba.size();++i )
+    {
+        QString bt;
+        bt.sprintf ( "%02X", ( unsigned char ) ba[i] );
+        val<<bt;
+    }
+    return val.join ( ":" );
 }
 
 
 void HttpBrokerClient::slotGetConnectionCmd()
 {
-	QString req;
-	QTextStream ( &req ) <<
-	"mode=getcmd&"<<
-	"user="<<config->user<<"&"<<
-	"connectionts="<<config->connectionts<<"&"<<
-	"cookie="<<config->cookie;
-
-	QUrl lurl ( config->brokerurl );
-	httpCmdAnswer.close();
-	httpCmdAnswer.setData ( 0,0 );
-
-	cmdRequest=http->post ( lurl.path(),
-	                        req.toUtf8(),&httpCmdAnswer );
+    QString req;
+    QTextStream ( &req ) <<
+    "mode=getcmd&"<<
+    "user="<<config->user<<"&"<<
+    "connectionts="<<config->connectionts<<"&"<<
+    "cookie="<<config->cookie;
+
+    QUrl lurl ( config->brokerurl );
+    httpCmdAnswer.close();
+    httpCmdAnswer.setData ( 0,0 );
+
+    cmdRequest=http->post ( lurl.path(),
+                            req.toUtf8(),&httpCmdAnswer );
 // 	x2goDebug<<"requested brocker cmd :"<<cmdRequest;
 }
diff --git a/httpbrokerclient.h b/httpbrokerclient.h
index 628817b..43d65e5 100644
--- a/httpbrokerclient.h
+++ b/httpbrokerclient.h
@@ -24,31 +24,46 @@ class ONMainWindow;
 
 class HttpBrokerClient: public QObject
 {
-		Q_OBJECT
-	public:
-		HttpBrokerClient ( ONMainWindow* wnd, ConfigFile* cfg );
-		~HttpBrokerClient();
-		QString getSInfoFromBroker ( bool getKey=false );
-	private:
-		QBuffer httpSIAnswer;
-		QBuffer httpCmdAnswer;
-		QHttp* http;
-		int sinfoRequest;
-		int sinfoKeyRequest;
-		int cmdRequest;
-		ConfigFile* config;
-		ONMainWindow* mainWindow;
+    Q_OBJECT
+public:
+    HttpBrokerClient ( ONMainWindow* wnd, ConfigFile* cfg );
+    ~HttpBrokerClient();
+    QString getSInfoFromBroker ( bool getKey=false );
+    void selectUserSession(const QString& session );
+    void changePassword(QString newPass);
+private:
+    QBuffer httpSIAnswer;
+    QBuffer httpCmdAnswer;
+    QBuffer httpSessionAnswer;
+    QHttp* http;
+    int sinfoRequest;
+    int sinfoKeyRequest;
+    int sessionsRequest;
+    int selSessRequest;
+    int cmdRequest;
+    int chPassRequest;
+    QString newBrokerPass;
+    ConfigFile* config;
+    ONMainWindow* mainWindow;
+    void createIniFile(const QString& content);
 
-	private slots:
-		void slotRequestFinished ( int id, bool error );
-		void slotSslErrors ( const QList<QSslError> & errors ) ;
-		QString getHexVal ( const QByteArray& ba );
-		void slotGetConnectionCmd();
-	signals:
-		void haveSshKey ( QString );
-		void fatalHttpError();
-		void haveAgentInfo ();
-		void cmdReconnect ();
+private slots:
+    void slotRequestFinished ( int id, bool error );
+    void slotSslErrors ( const QList<QSslError> & errors ) ;
+    QString getHexVal ( const QByteArray& ba );
+    void slotGetConnectionCmd();
+public slots:
+    void getUserSessions();
+
+signals:
+    void haveSshKey ( QString );
+    void fatalHttpError();
+    void haveAgentInfo ();
+    void cmdReconnect ();
+    void authFailed();
+    void sessionsLoaded();
+    void getSession( QString );
+    void passwordChanged( QString );
 };
 
 #endif
diff --git a/icons/32x32/auth.png b/icons/32x32/auth.png
new file mode 100644
index 0000000..e334fb6
Binary files /dev/null and b/icons/32x32/auth.png differ
diff --git a/man/man1/x2goclient.1 b/man/man1/x2goclient.1
index 0ba4386..b4f2bf4 100644
--- a/man/man1/x2goclient.1
+++ b/man/man1/x2goclient.1
@@ -5,7 +5,7 @@
 \\$2 \(la\\$1\(ra\\$3
 ..
 .if \n(.g .mso www.tmac
-.TH x2goclient 1 "19 May 2011" "Version 3.0.1.x" "X2go Client (Qt4)"
+.TH x2goclient 1 "July 2011" "Version 3.0.1.x" "X2go Client (Qt4)"
 .SH NAME
 x2goclient \- Client application to launch server-side X2go sessions.
 .SH SYNOPSIS
@@ -32,35 +32,22 @@ Start client maximized (default: false).
 \*(T<\fB\-\-hide\fR\*(T>
 Hide client (start hidden, default: false).
 .TP
-\*(T<\fB\-\-pgp-card\fR\*(T>
-Use openPGP Card authentification (default: false).
-.TP
-\*(T<\fB\-\-add-to-known-hosts\fR\*(T>
-Add DSA/RSA host key fingerprint to .ssh/known_hosts in case of "authenticity of server can't be established".
-.TP
-\*(T<\fB\-\-ssh-port\fR\*(T>
-Use this TCP/IP port for connection (default: 22).
-.TP
 \*(T<\fB\-\-client-ssh-port\fR\*(T>
 Local ssh port (for filesystem export, default: 22).
 .TP
+\*(T<\fB\-\-user\fR\*(T>
+Pre-selection of user at client startup (LDAP mode).
+.SH PROFILING SESSIONS GLOBALLY
+You can pre-profile sessions globally using the following options. They will override the options in the session profiles.
+.TP
 \*(T<\fB\-\-command\fR\*(T>
 Default command for session startup.
 .TP
-\*(T<\fB\-\-session\fR\*(T>
-Pre-selection of session at client startup.
-.TP
 \*(T<\fB\-\-sessionid\fR\*(T>
 Pre-selection of session ID at client startup.
 .TP
-\*(T<\fB\-\-user\fR\*(T>
-Pre-selection of user at client startup (LDAP mode).
-.TP
-\*(T<\fB\-\-fullscreen\fR\*(T>
-Start session in fullscreen mode.
-.TP
-\*(T<\fB\-\-width\fR\*(T>
-Start session with this width (default: 800).
+\*(T<\fB\-\-ssh-port\fR\*(T>
+Use this TCP/IP port for connection (default: 22).
 .TP
 \*(T<\fB\-\-link\fR\*(T>
 Set default link type (modem,isdn,adsl,wan or lan, default: adsl).
@@ -80,6 +67,12 @@ Set keyboard layout (default: 'de').
 \*(T<\fB\-\-kbd-type\fR\*(T>
 Set keyboard type (default: pc105/de).
 .TP
+\*(T<\fB\-\-fullscreen\fR\*(T>
+Start session in fullscreen mode.
+.TP
+\*(T<\fB\-\-width\fR\*(T>
+Start session with this width (default: 800).
+.TP
 \*(T<\fB\-\-sound\fR\*(T>
 Activate sound for session, not enabled by default.
 .TP
@@ -89,10 +82,24 @@ Which soundsystem to use: arts, esd, pulse (default: arts).
 The following command line options are primarily interesting if \fBx2goclient\fR is used
 as a login manager on X2go thin clients.
 .TP
+\*(T<\fB\-\-session=<session-profile-name>\fR\*(T>
+Pre-selection of session at client startup.
+.TP
+\*(T<\fB\-\-no-session-edit\fR\*(T>
+Disable session editing.
+.TP
+\*(T<\fB\-\-pgp-card\fR\*(T>
+Use openPGP Card authentication (default: false).
+.TP
+\*(T<\fB\-\-external-login=<smartcard-logins>\fR\*(T>
+Authenticate via SMART card, path to login notification file.
+.TP
+\*(T<\fB\-\-add-to-known-hosts\fR\*(T>
+Add DSA/RSA host key fingerprint to .ssh/known_hosts in case of "authenticity of server can't be established".
+.TP
 \*(T<\fB\-\-read-exports-from\fR\*(T>
 Specifies a directory where some external mechanism (e.g. script) can notify \fBx2goclient\fR on
 new block devices (CD/DVDs, USB sticks, etc.).
-.PP
 .SH LDAP OPTIONS
 In case you want to provide \fBx2goclient\fR session profiles from LDAP use the following options:
 .TP
diff --git a/object_script.x2goclient.Debug b/object_script.x2goclient.Debug
index 6a32207..8c972be 100644
--- a/object_script.x2goclient.Debug
+++ b/object_script.x2goclient.Debug
@@ -32,6 +32,7 @@ INPUT(
 ./debug\httpbrokerclient.o
 ./debug\ongetpass.o
 ./debug\x2gosettings.o
+./debug\brokerpassdlg.o
 ./debug\xsettingswidget.o
 ./debug\x2goclient.o
 ./debug\moc_configdialog.o
@@ -57,6 +58,7 @@ INPUT(
 ./debug\moc_sharewidget.o
 ./debug\moc_clicklineedit.o
 ./debug\moc_httpbrokerclient.o
+./debug\moc_brokerpassdlg.o
 ./debug\moc_xsettingswidget.o
 ./debug\qrc_resources.o
 );
diff --git a/object_script.x2goclient.Release b/object_script.x2goclient.Release
index 0b6487e..74e0753 100644
--- a/object_script.x2goclient.Release
+++ b/object_script.x2goclient.Release
@@ -32,6 +32,7 @@ INPUT(
 ./release\httpbrokerclient.o
 ./release\ongetpass.o
 ./release\x2gosettings.o
+./release\brokerpassdlg.o
 ./release\xsettingswidget.o
 ./release\x2goclient.o
 ./release\moc_configdialog.o
@@ -57,6 +58,7 @@ INPUT(
 ./release\moc_sharewidget.o
 ./release\moc_clicklineedit.o
 ./release\moc_httpbrokerclient.o
+./release\moc_brokerpassdlg.o
 ./release\moc_xsettingswidget.o
 ./release\qrc_resources.o
 );
diff --git a/onmainwindow.cpp b/onmainwindow.cpp
index 7b08939..da1d947 100644
--- a/onmainwindow.cpp
+++ b/onmainwindow.cpp
@@ -48,6 +48,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     x2goDebug<<"ONMainWindow constructor"<<endl;
     setFocusPolicy ( Qt::StrongFocus );
     installTranslator();
+    cleanAllFiles=false;
     drawMenu=true;
     usePGPCard=false;
     extLogin=false;
@@ -82,11 +83,14 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     defaultSshPort=sshPort=clientSshPort="22";
     LDAPPrintSupport=false;
     managedMode=false;
+    brokerMode=false;
     sshProxy.use=false;
     startEmbedded=false;
     sshConnection=0;
     sessionStatusDlg=0;
     noSessionEdit=false;
+    lastSession=0l;
+    changeBrokerPass=false;
 
 #ifdef Q_OS_WIN
     clientSshPort="7022";
@@ -183,11 +187,17 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     embedMode=true;
 #endif
 
+
+
+//set homedir as portable,etc
+
+
 #ifdef Q_OS_WIN
-    portableDataPath=u3DataPath();
+    QString u3Path=u3DataPath();
 //we have U3 System
-    if ( portableDataPath.length() >0 )
+    if ( u3Path.length() >0 )
     {
+        portableDataPath=u3Path;
         ONMainWindow::portable=true;
         setWindowTitle ( "X2Go client - U3" );
     }
@@ -201,6 +211,9 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
         homeDir=portableDataPath;
         x2goDebug<<"running in \"portable\" mode\n"<<
         "Data Dir is "<<portableDataPath;
+	QTimer *timer = new QTimer(this);
+        connect(timer, SIGNAL(timeout()), this, SLOT(slotCheckPortableDir()));
+        timer->start(1000);
     }
 
     loadSettings();
@@ -252,7 +265,10 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
 
 
 #ifndef Q_WS_HILDON
-    bgFrame=new SVGFrame ( ( QString ) ":/svg/bg.svg",true,fr );
+    if(BGFile.size())
+       bgFrame=new SVGFrame ( ( QString ) BGFile,true,fr );
+    else
+       bgFrame=new SVGFrame ( ( QString ) ":/svg/bg.svg",true,fr );
 #else
     bgFrame=new SVGFrame ( ( QString ) ":/svg/bg_hildon.svg",true,fr );
 #endif
@@ -291,7 +307,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     x2golay->addWidget ( x2g );
 
 
-    QHBoxLayout* bgLay=new QHBoxLayout ( bgFrame );
+    bgLay=new QHBoxLayout ( bgFrame );
     bgLay->setSpacing ( 0 );
     bgLay->setMargin ( 0 );
     bgLay->addLayout ( onlay );
@@ -307,9 +323,19 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     act_set=new QAction (
         QIcon ( iconsPath ( "/32x32/edit_settings.png" ) ),
         tr ( "&Settings ..." ),this );
-
+	
+    if(supportMenuFile!=QString::null)
+    {
+        act_support=new QAction ( tr ( "Support ..." ),this );
+        connect ( act_support,SIGNAL ( triggered ( bool ) ),this,
+              SLOT ( slotSupport() ) );
+      
+    }
+    
     act_abclient=new QAction ( QIcon ( ":icons/32x32/x2goclient.png" ),
                                tr ( "About X2GO client" ),this );
+			       
+
 
 
 
@@ -324,7 +350,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
 #endif
 
 
-#if defined (Q_OS_WIN) && defined (CFGCLIENT )
+#if defined (Q_OS_WIN) //&& defined (CFGCLIENT )
     xorgSettings();
 #endif
 
@@ -359,7 +385,27 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent )
     connect ( fr,SIGNAL ( resized ( const QSize ) ),this,
               SLOT ( slotResize ( const QSize ) ) );
     slotResize ( fr->size() );
-    x2goDebug<<"ONMainWindows constructor finished"<<endl;
+    
+    if(brokerMode)
+    {
+          broker=new HttpBrokerClient ( this, &config );
+    connect ( broker,SIGNAL ( haveSshKey ( QString ) ),this,
+              SLOT ( slotStartSshAgent ( QString ) ) );
+    connect ( broker,SIGNAL ( haveAgentInfo () ),this,
+              SLOT ( slotStartNewBrokerSession () ) );
+    connect ( broker,SIGNAL ( fatalHttpError() ),this,
+              SLOT ( close() ) );
+    connect ( broker,SIGNAL ( cmdReconnect() ),this,
+              SLOT ( slotReconnectSession() ) );
+    connect ( broker, SIGNAL ( authFailed()), this ,SLOT ( slotGetBrokerAuth()));
+    connect ( broker, SIGNAL( sessionsLoaded()), this, SLOT (slotReadSessions()));
+    connect ( broker, SIGNAL ( getSession(QString)), this, SLOT (slotGetBrokerSession(QString))); 
+    connect ( broker, SIGNAL ( passwordChanged(QString)), this, SLOT ( slotPassChanged(QString)));
+    
+
+    }
+    
+    x2goDebug<<"ONMainWindows constructor finished, home Directory is:"<<homeDir<<endl;
 }
 
 
@@ -375,8 +421,6 @@ ONMainWindow::~ONMainWindow()
 
 
 
-
-
 void ONMainWindow::installTranslator()
 {
     QTranslator* x2goclientTranslator=new QTranslator();
@@ -630,6 +674,19 @@ void ONMainWindow::initWidgetsNormal()
         QIcon ( iconsPath ( "/32x32/create_file.png" ) ),
         tr ( "&Create session icon on desktop..." ),
         this );
+    if(brokerMode)
+      act_sessicon->setEnabled(false);
+    
+    if(changeBrokerPass)
+    {
+      act_changeBrokerPass=new QAction (
+        QIcon ( iconsPath ( "/32x32/auth.png" ) ),
+        tr ( "&Set broker password..." ),
+        this );
+      connect ( act_changeBrokerPass,SIGNAL ( triggered(bool)),this,
+              SLOT ( slotChangeBrokerPass()) );
+	      act_changeBrokerPass->setEnabled(false);
+    }
 
 
     QAction *act_tb=new QAction ( tr ( "Show toolbar" ),this );
@@ -652,6 +709,7 @@ void ONMainWindow::initWidgetsNormal()
               SLOT ( trayQuit()) ) ;
     connect ( act_tb,SIGNAL ( toggled ( bool ) ),this,
               SLOT ( displayToolBar ( bool ) ) );
+	      
     stb=addToolBar ( tr ( "Show toolbar" ) );
 
     QShortcut* ex=new QShortcut ( QKeySequence ( tr ( "Ctrl+Q","exit" ) ),
@@ -662,7 +720,8 @@ void ONMainWindow::initWidgetsNormal()
     {
         QMenu* menu_sess=menuBar()->addMenu ( tr ( "&Session" ) );
         QMenu* menu_opts=menuBar()->addMenu ( tr ( "&Options" ) );
-
+        if(!brokerMode)
+        {
         menu_sess->addAction ( act_new );
         menu_sess->addAction ( act_edit );
 #if (!defined Q_WS_HILDON) && (!defined Q_OS_DARWIN)
@@ -670,14 +729,21 @@ void ONMainWindow::initWidgetsNormal()
             menu_sess->addAction ( act_sessicon );
 #endif
         menu_sess->addSeparator();
+	}
         menu_sess->addAction ( act_exit );
         menu_opts->addAction ( act_set );
         menu_opts->addAction ( act_tb );
+	if(changeBrokerPass)
+	  menu_opts->addAction(act_changeBrokerPass);
 
         QMenu* menu_help=menuBar()->addMenu ( tr ( "&Help" ) );
+	if(supportMenuFile!=QString::null)
+	    menu_help->addAction ( act_support );
         menu_help->addAction ( act_abclient );
         menu_help->addAction ( act_abqt );
 
+        if(!brokerMode)
+	{
         stb->addAction ( act_new );
         stb->addAction ( act_edit );
 #if (!defined Q_WS_HILDON) && (!defined Q_OS_DARWIN)
@@ -685,7 +751,10 @@ void ONMainWindow::initWidgetsNormal()
             stb->addAction ( act_sessicon );
 #endif
         stb->addSeparator();
+	}
         stb->addAction ( act_set );
+	if(changeBrokerPass)
+	  stb->addAction(act_changeBrokerPass);
 
         if ( !showToolBar )
             stb->hide();
@@ -708,10 +777,18 @@ void ONMainWindow::initWidgetsNormal()
         QTimer::singleShot ( 1500, this, SLOT ( readUsers() ) );
     }
     else
+    {
+      if(!brokerMode)
         QTimer::singleShot ( 1, this, SLOT ( slotReadSessions() ) );
-    QTimer* t=new QTimer ( this );
+      else
+      {
+	QTimer::singleShot(1, this,SLOT(slotGetBrokerAuth()));
+      }
+    }
+/*    QTimer* t=new QTimer ( this );
     connect ( t,SIGNAL ( timeout() ),this,SLOT ( slotRereadUsers() ) );
     t->start ( 20000 );
+*/
 #ifdef Q_OS_WIN
     proxyWinTimer=new QTimer ( this );
     connect ( proxyWinTimer, SIGNAL ( timeout() ), this,
@@ -721,6 +798,95 @@ void ONMainWindow::initWidgetsNormal()
 }
 
 
+
+void ONMainWindow::slotPassChanged(const QString& result)
+{
+  
+  if(result==QString::null)
+  {
+    QMessageBox::critical(this, tr("Error"),tr("Operation failed"));
+  }
+  else
+  {    
+    QMessageBox::information(this, tr("Password changed"),tr("Password changed"));
+    config.brokerPass=result;
+  }
+  setEnabled(true);
+  
+  slotClosePass();
+  sessionStatusDlg->hide();
+  
+}
+
+
+void ONMainWindow::slotChangeBrokerPass()
+{
+  x2goDebug<<"change broker pass";
+  BrokerPassDlg passDlg;
+  if(passDlg.exec()!=QDialog::Accepted)
+    return;
+  if(passDlg.oldPass()!=config.brokerPass)
+  {
+    QMessageBox::critical(this,tr("Error"),tr("Wrong password!"));
+    return;
+  }
+  broker->changePassword(passDlg.newPass());
+  setStatStatus ( tr ( "Connecting to broker" ) );
+  stInfo->insertPlainText ( "broker url: "+config.brokerurl );
+  setEnabled ( false );
+  uname->hide();
+  u->hide();
+  return;  
+}
+
+
+void ONMainWindow::slotCheckPortableDir()
+{
+  if(!QFile::exists(homeDir))
+  {
+    x2goDebug<<"portable dir not exists, close";
+    close();
+  }
+}
+
+void ONMainWindow::slotGetBrokerAuth()
+{
+        pass->clear();
+	login->clear();
+	QString pixFile=":icons/128x128/x2gosession.png";
+	if(SPixFile!=QString::null)
+	  pixFile=SPixFile;
+	QPixmap pix(pixFile);
+	if ( !miniMode )
+        {
+	  fotoLabel->setPixmap (
+          pix.scaled ( 64,64,
+                         Qt::IgnoreAspectRatio,
+                         Qt::SmoothTransformation ) );
+          fotoLabel->setFixedSize ( 64,64 );
+        }
+        else
+        {
+           fotoLabel->setPixmap (
+               pix.scaled ( 48,48,
+                         Qt::IgnoreAspectRatio,
+                         Qt::SmoothTransformation ) );
+           fotoLabel->setFixedSize ( 48,48 );
+         }
+         users->hide();
+	 ln->hide();
+	 bgLay->insertStretch(3);
+         QString text=tr("<b>Authentication</b>");
+	/* if(config.brokerName.length()>0)
+	   text+=config.brokerName;
+	 else
+	   text+=config.brokerurl;*/
+         nameLabel->setText ( text );
+	 slotShowPassForm();
+	 config.brokerAuthenticated=false;
+}
+
+
 void ONMainWindow::trayIconInit()
 {
 
@@ -906,13 +1072,26 @@ void ONMainWindow::closeClient()
         x2goDebug<<"done";
 
     }
-    if ( sshConnection )
+    if ( sshConnection && !useLdap)
     {
         sshConnection->disconnectSession();
         x2goDebug<<"waiting sshConnection to finish\n";
         sshConnection->wait ( 10000 );
         x2goDebug<<"sshConnection is closed\n";
     }
+    if(useLdap)
+    {
+      for(int i=0;i<serverSshConnections.count();++i)
+      {
+	if(serverSshConnections[i])
+	{
+	  serverSshConnections[i]->disconnectSession();
+          x2goDebug<<"waiting sshConnection to finish\n";
+          serverSshConnections[i]->wait ( 10000 );
+          x2goDebug<<"sshConnection is closed\n";
+	}
+      }
+    }
 
     /*	if ( tunnel!=0l )
     	{
@@ -1241,6 +1420,11 @@ void ONMainWindow::slotSelectedFromList ( UserButton* user )
 
 void ONMainWindow::slotClosePass()
 {
+    if(brokerMode)
+    {
+      if(!config.brokerAuthenticated)
+	close();
+    }
     passForm->hide();
     if ( !embedMode )
     {
@@ -1256,8 +1440,11 @@ void ONMainWindow::slotClosePass()
         }
         else
         {
+	  if(lastSession)
+	  {
             lastSession->show();
             uname->setText ( lastSession->name() );
+	  }
         }
         uname->setEnabled ( true );
         u->setEnabled ( true );
@@ -1270,6 +1457,7 @@ void ONMainWindow::slotClosePass()
 
 void ONMainWindow::slotPassEnter()
 {
+      
     shadowSession=false;
 #if defined ( Q_OS_WIN ) || defined (Q_OS_DARWIN )
     QString disp=getXDisplay();
@@ -1367,7 +1555,9 @@ void ONMainWindow::slotPassEnter()
 // 	QString host=ldapServer;
     QString host=firstServer;
     passwd=getCurrentPass();
-    startSshConnection ( host,sshPort,acceptRsa,user,passwd,true );
+    if(sshConnection)
+      sshConnection->disconnectSession();
+    sshConnection=startSshConnection ( host,sshPort,acceptRsa,user,passwd,true );
 
 #endif
 }
@@ -1664,7 +1854,6 @@ void ONMainWindow::slotCreateDesktopIcon ( SessionButton* bt )
     QSettings xst ( "HKEY_LOCAL_MACHINE\\SOFTWARE\\x2goclient",
                     QSettings::NativeFormat );
     QString workDir=xst.value ( "Default" ).toString();
-    workDir+="\\bin";
     QString progname=workDir+"\\x2goclient.exe";
     QString args="--sessionid="+bt->id();
     if ( crHidden )
@@ -1691,11 +1880,45 @@ void ONMainWindow::slotCreateDesktopIcon ( SessionButton* bt )
 
 void ONMainWindow::slotReadSessions()
 {
-    X2goSettings st ( "sessions" );
+  
+    users->show();
+    ln->show();
 
-    QStringList slst=st.setting()->childGroups();
-    for ( int i=0;i<slst.size();++i )
+    X2goSettings *st;
+    lastSession=0;
+    
+    if(brokerMode)
+    {
+      if(changeBrokerPass)
+	act_changeBrokerPass->setEnabled(true);
+      config.key=QString::null;
+      config.user=QString::null;
+      config.sessiondata=QString::null;
+      for (int i=sessions.count()-1;i>=0;--i)
+      {
+        SessionButton* but=sessions.takeAt(i);
+	if(but)
+	   delete but;
+      }
+      
+      st=new X2goSettings(config.iniFile,QSettings::IniFormat);
+          sessionStatusDlg->hide();
+          selectSessionDlg->hide();
+          setEnabled ( true );
+	  slotClosePass();
+    }
+    else
+      st= new X2goSettings( "sessions" );
+
+    QStringList slst=st->setting()->childGroups();
+    x2goDebug<<"read "<<slst.size()<<" sessions from config file";
+    if(brokerMode && (slst.size()==0))
     {
+      QMessageBox::critical(this,tr("Error"),tr("X2Go sessions not found"));
+      close();
+    }
+    for ( int i=0;i<slst.size();++i )
+    {      
         if ( slst[i]!="embedded" )
             createBut ( slst[i] );
     }
@@ -1757,6 +1980,7 @@ void ONMainWindow::slotReadSessions()
             raise();
         }
     }
+    delete st;
 }
 
 
@@ -1814,6 +2038,9 @@ void ONMainWindow::placeButtons()
         else
             sessions[i]->move ( ( users->width()-260 ) /2,
                                 i*155+i*20+5 );
+	if(brokerMode)
+            sessions[i]->move ( ( users->width()-360 ) /2,
+                                i*150+i*25+5 );
         sessions[i]->show();
     }
     if ( sessions.size() )
@@ -1824,6 +2051,9 @@ void ONMainWindow::placeButtons()
         else
             uframe->setFixedHeight (
                 sessions.size() *155+ ( sessions.size()-1 ) *20 );
+	if(brokerMode)
+            uframe->setFixedHeight (
+                sessions.size() *150+ ( sessions.size()-1 ) *25 );
     }
 
 }
@@ -2118,6 +2348,16 @@ void ONMainWindow::slotSelectedFromList ( SessionButton* session )
         sessionName=session->name();
 
         QString sid=session->id();
+        if(brokerMode)
+        {
+           broker->selectUserSession(session->id());
+           setStatStatus ( tr ( "Connecting to broker" ) );
+           stInfo->insertPlainText ( "broker url: "+config.brokerurl );
+           setEnabled ( false );
+	   uname->hide();
+	   u->hide();
+           return;
+        }
 
         X2goSettings st ( "sessions" );
 
@@ -2272,12 +2512,13 @@ void ONMainWindow::slotSelectedFromList ( SessionButton* session )
 }
 
 
-void ONMainWindow::startSshConnection ( QString host, QString port, bool acceptUnknownHosts, QString login,
-                                        QString password, bool autologin )
+SshMasterConnection* ONMainWindow::startSshConnection ( QString host, QString port, bool acceptUnknownHosts, 
+					QString login,
+                                        QString password, bool autologin, bool getSrv)
 {
+    
+    SshMasterConnection* con;
     x2goDebug<<"start new ssh connection"<<endl;
-
-
     for ( int i=0;i<sshEnv.size();++i )
     {
 #ifndef Q_OS_WIN
@@ -2294,21 +2535,24 @@ void ONMainWindow::startSshConnection ( QString host, QString port, bool acceptU
         autologin=true;
     if ( cardReady )
         cardStarted=true;
-    if ( sshConnection )
-    {
-        sshConnection->disconnectSession();
-    }
+
 
     /////key/sshagent/env/
 
     passForm->setEnabled ( false );
-    sshConnection=new SshMasterConnection ( host, port.toInt(),acceptUnknownHosts,
+    con=new SshMasterConnection ( host, port.toInt(),acceptUnknownHosts,
                                             login, password,currentKey, autologin, this );
-    connect ( sshConnection,SIGNAL ( connectionOk() ), this, SLOT ( slotSshConnectionOk() ) );
-    connect ( sshConnection, SIGNAL ( serverAuthError ( int,QString ) ),this,SLOT ( slotSshServerAuthError ( int,QString ) ) );
-    connect ( sshConnection, SIGNAL ( userAuthError ( QString ) ),this,SLOT ( slotSshUserAuthError ( QString ) ) );
-    connect ( sshConnection, SIGNAL ( connectionError ( QString,QString ) ), this, SLOT ( slotSshConnectionError ( QString,QString ) ) );
-    sshConnection->start();
+    if(!getSrv)
+         connect ( con, SIGNAL ( connectionOk(QString) ), this, SLOT ( slotSshConnectionOk() ) );
+    else
+         connect ( con, SIGNAL ( connectionOk(QString)), this, SLOT ( slotServSshConnectionOk(QString) ) );
+    
+    connect ( con, SIGNAL ( serverAuthError ( int,QString ) ),this,SLOT ( slotSshServerAuthError ( int,QString ) ) );
+    connect ( con, SIGNAL ( userAuthError ( QString ) ),this,SLOT ( slotSshUserAuthError ( QString ) ) );
+    connect ( con, SIGNAL ( connectionError ( QString,QString ) ), this, 
+	      SLOT ( slotSshConnectionError ( QString,QString ) ) );
+    con->start();
+    return con;
 }
 
 void ONMainWindow::slotSshConnectionError ( QString message, QString lastSessionError )
diff --git a/onmainwindow.h b/onmainwindow.h
index a1ea247..e518358 100644
--- a/onmainwindow.h
+++ b/onmainwindow.h
@@ -1,3 +1,4 @@
+
 /***************************************************************************
  *   Copyright (C) 2005-2011 by Oleksandr Shneyder   *
  *   oleksandr.shneyder at obviously-nice.de   *
@@ -54,6 +55,7 @@
 #if defined(CFGPLUGIN) && defined(Q_OS_LINUX)
 class QX11EmbedContainer;
 #endif
+class QTemporaryFile;
 class QLineEdit;
 class QFrame;
 class QVBoxLayout;
@@ -138,6 +140,12 @@ struct ConfigFile
 {
     QString session;
     QString user;
+    QString brokerUser;
+    QString brokerPass;
+    QString brokerUserId;
+    QString brokerName;
+    bool brokerAuthenticated;
+    QString iniFile; 
     QString server;
     QString sshport;
     QString proxy;
@@ -184,6 +192,8 @@ struct SshProxy
     QString port;
     QString bin;
 };
+
+
 //wrapper to send mouse events under windows in embedded mode
 #ifdef Q_OS_WIN
 class WWrapper : public QPushButton
@@ -215,6 +225,7 @@ class ONMainWindow : public QMainWindow
 #endif
 {
     friend class HttpBrokerClient;
+    friend class SessionButton;
 #ifdef CFGPLUGIN
     Q_PROPERTY ( QString x2goconfig READ x2goconfig WRITE setX2goconfig )
     Q_CLASSINFO ( "ClassID", "{5a20006d-118f-4185-9653-9f98958a0008}" )
@@ -404,6 +415,9 @@ public:
     {
       return !noSessionEdit;
     }
+    
+    
+    SshMasterConnection* findServerSshConnection(QString host);
 
     void showHelp();
     void showHelpPack();
@@ -455,6 +469,8 @@ private:
     bool usePGPCard;
     bool miniMode;
     bool managedMode;
+    bool brokerMode;
+    bool changeBrokerPass;
     bool embedMode;
     QString statusString;
     int defaultLink;
@@ -468,12 +484,14 @@ private:
     bool printSupport;
     bool showTbTooltip;
     bool noSessionEdit;
+    bool cleanAllFiles;
     struct SshProxy sshProxy;
     QString sshPort;
     QString clientSshPort;
     QString defaultSshPort;
     QVBoxLayout* selectSesDlgLayout;
     SshMasterConnection* sshConnection;
+    QList<SshMasterConnection*> serverSshConnections;
     bool closeEventSent;
     int shadowMode;
     QString shadowUser;
@@ -542,6 +560,7 @@ private:
     QScrollArea* users;
     QVBoxLayout* userl;
     QHBoxLayout* mainL;
+    QHBoxLayout* bgLay;
     QList<UserButton*> names;
     QList<SessionButton*> sessions;
     UserButton* lastUser;
@@ -569,12 +588,14 @@ private:
 
     QAction *act_set;
     QAction *act_abclient;
+    QAction *act_support;
     QAction *act_shareFolder;
     QAction *act_suspend;
     QAction *act_terminate;
     QAction *act_reconnect;
     QAction *act_embedContol;
     QAction *act_embedToolBar;
+    QAction *act_changeBrokerPass;
 
     QToolBar *stb;
 
@@ -602,6 +623,7 @@ private:
     bool ldapOnly;
     bool isScDaemonOk;
     bool parecTunnelOk;
+    
 
     bool startSessSound;
     int startSessSndSystem;
@@ -620,6 +642,10 @@ private:
     int ldapPort2;
     QString ldapDn;
     QString sessionCmd;
+    
+    QString supportMenuFile;
+    QString BGFile;
+    QString SPixFile;
 
     QString LDAPSndSys;
     QString LDAPSndPort;
@@ -684,11 +710,11 @@ private:
     HttpBrokerClient* broker;
 
 
-#if defined ( Q_OS_WIN) && defined (CFGCLIENT )
+#if defined ( Q_OS_WIN) //&& defined (CFGCLIENT )
     void xorgSettings();
     bool startXorgOnStart;
-    bool useXming;
-    int xorgDelay;
+    bool useInternalX;
+    enum {VCXSRV, XMING} internalX;
     QString xorgExe;
     QString xorgOptions;
     QString xorgWinOptions;
@@ -697,6 +723,7 @@ private:
     enum {WIN,FS,SAPP} xorgMode;
     QString xorgWidth;
     QString xorgHeight;
+    int waitingForX;
 #endif
 
     // Tray icon stuff based on patch from Joachim Langenbach <joachim at falaba.de>
@@ -751,7 +778,9 @@ private:
     void closeClient();
     void continueNormalSession();
     void continueLDAPSession();
-    void startSshConnection ( QString host, QString port, bool acceptUnknownHosts, QString login, QString password, bool autologin );
+    SshMasterConnection* startSshConnection ( QString host, QString port, 
+					      bool acceptUnknownHosts, QString login, 
+					      QString password, bool autologin, bool getSrv=false);
 
 protected:
     virtual void closeEvent ( QCloseEvent* event );
@@ -764,13 +793,17 @@ private slots:
     void slotSetWinServersReady();
     void startWinServers();
     void slotCheckXOrgLog();
+    void slotCheckXOrgConnection();
 #endif
 private slots:
     void slotShowPassForm();
     void displayUsers();
+    void slotPassChanged(const QString& result);
     void slotResize ( const QSize sz );
     void slotUnameChanged ( const QString& text );
     void slotPassEnter();
+    void slotChangeBrokerPass();
+    void slotCheckPortableDir();
 
     void readUsers();
     void slotSelectedFromList ( UserButton* user );
@@ -784,6 +817,7 @@ private slots:
     void slotSshServerAuthError ( int error, QString sshMessage );
     void slotSshUserAuthError ( QString error );
     void slotSshConnectionOk();
+    void slotServSshConnectionOk(QString server);
     void slotChangeKbdLayout(const QString& layout);
 
 public slots:
@@ -809,6 +843,8 @@ private slots:
     void slotSuspendSessFromSt();
     void slotTermSess();
     void slotNewSess();
+    void slotGetBrokerAuth();
+    void slotGetBrokerSession(const QString& sinfo);
     void slotCmdMessage ( bool result,QString output,
                           SshProcess* );
     void slotListSessions ( bool result,QString output,
@@ -849,6 +885,7 @@ private slots:
     void slotExportTimer();
     void slotAboutQt();
     void slotAbout();
+    void slotSupport();
 
     //trayIcon stuff
     void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
diff --git a/onmainwindow_part2.cpp b/onmainwindow_part2.cpp
index d45bd6f..702c447 100644
--- a/onmainwindow_part2.cpp
+++ b/onmainwindow_part2.cpp
@@ -25,11 +25,43 @@ void ONMainWindow::slotSshConnectionOk()
     x2goDebug<<"ssh connection ok"<<endl;
     passForm->setEnabled ( true );
     if ( useLdap )
-        continueLDAPSession();
+    {
+	continueLDAPSession();
+    }
     else
         continueNormalSession();
 }
 
+
+SshMasterConnection*  ONMainWindow::findServerSshConnection(QString host)
+{
+  for(int i=0;i<serverSshConnections.count();++i)
+  {
+    if(serverSshConnections[i])
+    {
+      if(serverSshConnections[i]->getHost()==host)
+	return serverSshConnections[i];
+    }
+  }
+  return 0l;
+}
+
+void ONMainWindow::slotServSshConnectionOk(QString server)
+{
+        SshMasterConnection* con=findServerSshConnection(server);
+	if(!con)
+	  return;
+        SshProcess* lproc;
+        lproc=new SshProcess ( con,  this );
+        connect ( lproc,SIGNAL ( sshFinished ( bool,
+                                               QString,SshProcess* ) ),
+                  this,SLOT (
+                      slotListAllSessions ( bool,
+                                            QString,SshProcess* ) ) );
+	x2goDebug<<"getting sessions on "<<server<<endl;
+        lproc->startNormal ( "export HOSTNAME && x2golistsessions" );
+}
+
 void ONMainWindow::slotSshServerAuthError ( int error, QString sshMessage )
 {
     if ( startHidden )
@@ -136,6 +168,16 @@ void ONMainWindow::slotSessEnter()
         slotPassEnter();
         return;
     }
+    if(brokerMode)
+    {
+      if(!config.brokerAuthenticated)
+      {
+	x2goDebug<<"starting broker request";
+	slotStartBroker();
+	return;
+      }
+    }
+
     resumingSession.sessionId=QString::null;
     resumingSession.server=QString::null;
     resumingSession.display=QString::null;
@@ -150,11 +192,16 @@ void ONMainWindow::slotSessEnter()
 void ONMainWindow::continueNormalSession()
 {
     x2goDebug<<"continue normal x2go session"<<endl;
+    if(brokerMode)
+    {
+      slotListSessions(true,QString::null,0);
+      return;
+    }
     SshProcess* proc=new SshProcess ( sshConnection, this );
     connect ( proc,SIGNAL ( sshFinished ( bool,QString,SshProcess* ) ),
               this,SLOT ( slotListSessions ( bool, QString,
                                              SshProcess* ) ) );
-    if ( !shadowSession )
+    if ( !shadowSession )      
         proc->startNormal ( "export HOSTNAME && x2golistsessions" );
     else
         proc->startNormal ( "export HOSTNAME && x2golistdesktops" );
@@ -189,7 +236,7 @@ bool ONMainWindow::startSession ( const QString& sid )
         return true;
     }
 
-    if ( !embedMode )
+    if ( !embedMode && !brokerMode )
     {
 
         X2goSettings st ( "sessions" );
@@ -210,10 +257,23 @@ bool ONMainWindow::startSession ( const QString& sid )
         sshPort=config.sshport;
         selectedCommand=config.command;
     }
-
-    passwd=getCurrentPass();
-    startSshConnection ( host,sshPort,acceptRsa,user,passwd,autologin );
-
+    if(!brokerMode)
+       passwd=getCurrentPass();
+    else
+    {
+      currentKey=config.key;
+      host=config.server;
+      X2goSettings st ( config.iniFile, QSettings::IniFormat );
+      passForm->setEnabled ( false );
+      user=st.setting()->value ( sid+"/user",
+                                   ( QVariant ) QString::null ).toString();
+      login->setText(user);
+      sshPort=st.setting()->value ( sid+"/sshport",
+                                   ( QVariant ) "22" ).toString();
+    }
+    if(sshConnection)
+      sshConnection->disconnectSession();
+    sshConnection=startSshConnection ( host,sshPort,acceptRsa,user,passwd,autologin );
     return true;
 }
 
@@ -253,7 +313,7 @@ void ONMainWindow::slotListSessions ( bool result,QString output,
         uname->setEnabled ( false );
         u->setEnabled ( false );
     }
-    if ( managedMode )
+    if ( managedMode || brokerMode )
     {
         x2goDebug<<"sess data:"<<config.sessiondata;
         if ( config.sessiondata.indexOf ( "|S|" ) ==-1 )
@@ -416,54 +476,69 @@ void ONMainWindow::startNewSession()
                                     QMessageBox::NoButton );
             return;
         }
+        sshConnection=findServerSshConnection(host);
+	if(!sshConnection)
+        {
+            QMessageBox::critical ( 0l,tr ( "Error" ),
+                                    tr ( "Server not availabel" ),
+                                    QMessageBox::Ok,
+                                    QMessageBox::NoButton );
+            return;
+        }	
     }
     else
     {
-        X2goSettings st ( "sessions" );
-        QString sid;
+        X2goSettings* st;
+	
+	if(!brokerMode)
+	  st=new X2goSettings( "sessions" );
+	else
+	  st= new X2goSettings(config.iniFile,QSettings::IniFormat);
+        
+	QString sid;
         if ( !embedMode )
             sid=lastSession->id();
         else
             sid="embedded";
-        pack=st.setting()->value ( sid+"/pack",
+        pack=st->setting()->value ( sid+"/pack",
                                    ( QVariant ) defaultPack ).toString();
-        fullscreen=st.setting()->value ( sid+"/fullscreen",
+        fullscreen=st->setting()->value ( sid+"/fullscreen",
                                          ( QVariant )
                                          defaultFullscreen ).toBool();
-        height=st.setting()->value ( sid+"/height",
+        height=st->setting()->value ( sid+"/height",
                                      ( QVariant ) defaultHeight ).toInt();
-        width=st.setting()->value ( sid+"/width",
+        width=st->setting()->value ( sid+"/width",
                                     ( QVariant ) defaultWidth ).toInt();
-        setDPI=st.setting()->value ( sid+"/setdpi",
+        setDPI=st->setting()->value ( sid+"/setdpi",
                                      ( QVariant ) defaultSetDPI ).toBool();
-        dpi=st.setting()->value ( sid+"/dpi",
+        dpi=st->setting()->value ( sid+"/dpi",
                                   ( QVariant ) defaultDPI ).toUInt();
-        quality=st.setting()->value (
+        quality=st->setting()->value (
                     sid+"/quality",
                     ( QVariant ) defaultQuality ).toInt();
-        speed=st.setting()->value ( sid+"/speed",
+        speed=st->setting()->value ( sid+"/speed",
                                     ( QVariant ) defaultLink ).toInt();
 
-        usekbd=st.setting()->value ( sid+"/usekbd",
+        usekbd=st->setting()->value ( sid+"/usekbd",
                                      ( QVariant ) defaultSetKbd ).toBool();
-        layout=st.setting()->value ( sid+"/layout",
+        layout=st->setting()->value ( sid+"/layout",
                                      ( QVariant )
                                      defaultLayout[0] ).toString();
-        type=st.setting()->value ( sid+"/type",
+        type=st->setting()->value ( sid+"/type",
                                    ( QVariant )
                                    defaultKbdType ).toString();
         if ( !embedMode )
         {
-            command=st.setting()->value ( sid+"/command",
+            command=st->setting()->value ( sid+"/command",
                                           ( QVariant ) defaultCmd ).toString();
-            host=st.setting()->value (
+            host=st->setting()->value (
                      sid+"/host",
                      ( QVariant )
                      ( QString ) "localhost" ).toString();
 
-            rootless=st.setting()->value ( sid+"/rootless",
+            rootless=st->setting()->value ( sid+"/rootless",
                                            ( QVariant ) false ).toBool();
-            xdmcpServer=st.setting()->value ( sid+"/xdmcpserver",
+            xdmcpServer=st->setting()->value ( sid+"/xdmcpserver",
                                               ( QVariant )
                                               "localhost" ).toString();
         }
@@ -473,7 +548,7 @@ void ONMainWindow::startNewSession()
             rootless= config.rootless;
             host=config.server;
             startEmbedded=false;
-            if ( st.setting()->value ( sid+"/startembed",
+            if ( st->setting()->value ( sid+"/startembed",
                                        ( QVariant ) true ).toBool() )
             {
                 startEmbedded=true;
@@ -511,6 +586,7 @@ void ONMainWindow::startNewSession()
         {
             runRemoteCommand=false;
         }
+        delete st;
     }
 
 
@@ -531,7 +607,7 @@ void ONMainWindow::startNewSession()
     maximizeProxyWin=false;
     proxyWinWidth=width;
     proxyWinHeight=height;
-#ifdef CFGCLIENT
+//#ifdef CFGCLIENT
     xorgMode=WIN;
     if(fullscreen)
       xorgMode=FS;
@@ -539,9 +615,9 @@ void ONMainWindow::startNewSession()
       xorgMode=SAPP;
     xorgWidth=QString::number(width);
     xorgHeight=QString::number(height);
-    if(!useXming && ! startXorgOnStart)
+    if(! startXorgOnStart)
       startXOrg();
-#endif
+//#endif
 #endif
     if ( fullscreen )
     {
@@ -699,7 +775,15 @@ void ONMainWindow::resumeSession ( const x2goSession& s )
         usekbd=defaultSetKbd;
         layout=defaultLayout[0];
         type=defaultKbdType;
-
+        sshConnection=findServerSshConnection(host);
+	if(!sshConnection)
+        {
+            QMessageBox::critical ( 0l,tr ( "Error" ),
+                                    tr ( "Server not availabel" ),
+                                    QMessageBox::Ok,
+                                    QMessageBox::NoButton );
+            return;
+        }
     }
     else
     {
@@ -709,43 +793,47 @@ void ONMainWindow::resumeSession ( const x2goSession& s )
             sid=lastSession->id();
         else
             sid="embedded";
-        X2goSettings st ( "sessions" );
+        X2goSettings* st;
+	if(!brokerMode)
+	  st=new X2goSettings( "sessions" );
+	else
+	  st=new X2goSettings(config.iniFile,QSettings::IniFormat);
 
-        pack=st.setting()->value ( sid+"/pack",
+        pack=st->setting()->value ( sid+"/pack",
                                    ( QVariant ) defaultPack ).toString();
 
-        fullscreen=st.setting()->value ( sid+"/fullscreen",
+        fullscreen=st->setting()->value ( sid+"/fullscreen",
                                          ( QVariant )
                                          defaultFullscreen ).toBool();
-        height=st.setting()->value ( sid+"/height",
+        height=st->setting()->value ( sid+"/height",
                                      ( QVariant ) defaultHeight ).toInt();
-        width=st.setting()->value ( sid+"/width",
+        width=st->setting()->value ( sid+"/width",
                                     ( QVariant ) defaultWidth ).toInt();
-        quality=st.setting()->value ( sid+"/quality",
+        quality=st->setting()->value ( sid+"/quality",
                                       ( QVariant )
                                       defaultQuality ).toInt();
-        speed=st.setting()->value ( sid+"/speed",
+        speed=st->setting()->value ( sid+"/speed",
                                     ( QVariant ) defaultLink ).toInt();
-        usekbd=st.setting()->value ( sid+"/usekbd",
+        usekbd=st->setting()->value ( sid+"/usekbd",
                                      ( QVariant ) defaultSetKbd ).toBool();
-        layout=st.setting()->value ( sid+"/layout",
+        layout=st->setting()->value ( sid+"/layout",
                                      ( QVariant )
                                      defaultLayout[0] ).toString();
-        type=st.setting()->value ( sid+"/type",
+        type=st->setting()->value ( sid+"/type",
                                    ( QVariant )
                                    defaultKbdType ).toString();
-        rootless=st.setting()->value ( sid+"/rootless",
+        rootless=st->setting()->value ( sid+"/rootless",
                                      ( QVariant ) false ).toBool();
 
         if ( !embedMode )
         {
-            host=st.setting()->value ( sid+"/host",
+            host=st->setting()->value ( sid+"/host",
                                        ( QVariant ) s.server ).toString();
         }
         else
         {
             startEmbedded=false;
-            if ( st.setting()->value ( sid+"/startembed",
+            if ( st->setting()->value ( sid+"/startembed",
                                        ( QVariant ) true ).toBool() )
             {
                 fullscreen=false;
@@ -773,6 +861,7 @@ void ONMainWindow::resumeSession ( const x2goSession& s )
                 usekbd=true;
             }
         }
+        delete st;
     }
     
     if(defaultLayout.size()>0)
@@ -783,7 +872,7 @@ void ONMainWindow::resumeSession ( const x2goSession& s )
     maximizeProxyWin=false;
     proxyWinWidth=width;
     proxyWinHeight=height;
-#ifdef CFGCLIENT
+// #ifdef CFGCLIENT
     xorgMode=WIN;
     if(fullscreen)
       xorgMode=FS;
@@ -791,9 +880,9 @@ void ONMainWindow::resumeSession ( const x2goSession& s )
       xorgMode=SAPP;
     xorgWidth=QString::number(width);
     xorgHeight=QString::number(height);
-    if(!useXming && ! startXorgOnStart)
+    if(! startXorgOnStart)
       startXOrg();
-#endif
+// #endif
     
 #endif
     if ( fullscreen )
@@ -1135,6 +1224,20 @@ void ONMainWindow::slotSuspendSess()
             host=config.server;
         }
     }
+    else
+    {
+      sshConnection=findServerSshConnection(host);
+      if(!sshConnection)
+      {
+            QMessageBox::critical ( 0l,tr ( "Error" ),
+                                    tr ( "Server not availabel" ),
+                                    QMessageBox::Ok,
+                                    QMessageBox::NoButton );
+            return;
+      }
+    }
+
+     
     suspendSession ( sessId );
 }
 
@@ -1230,6 +1333,21 @@ void ONMainWindow::slotTermSess()
             QString sid=lastSession->id();
         }
     }
+    else
+    {
+      QString host=sessTv->model()->index ( sessTv->currentIndex().row(),
+                                            S_SERVER ).data().toString();
+					    
+      sshConnection=findServerSshConnection(host);
+      if(!sshConnection)
+      {
+            QMessageBox::critical ( 0l,tr ( "Error" ),
+                                    tr ( "Server not availabel" ),
+                                    QMessageBox::Ok,
+                                    QMessageBox::NoButton );
+            return;
+      }
+    }
 
     termSession ( sessId );
 }
@@ -1815,9 +1933,10 @@ void ONMainWindow::slotTunnelOk()
 #ifdef Q_OS_WIN
     else
     {
-#ifdef CFGCLIENT
-        if(useXming)
-#endif
+// #ifdef CFGCLIENT
+        // if using XMing, we must find proxy win for case, that we should make it fullscreen
+        if(useInternalX&& (internalX==XMING))
+// #endif
         proxyWinTimer->start ( 300 );
     }
 #endif
@@ -1899,8 +2018,8 @@ void ONMainWindow::slotProxyFinished ( int,QProcess::ExitStatus )
 #ifdef Q_OS_WIN
     else
         proxyWinTimer->stop();
-#ifdef CFGCLIENT
-    if(!useXming && ! startXorgOnStart)
+// #ifdef CFGCLIENT
+    if(! startXorgOnStart)
     {
       if(xorg)
       {
@@ -1912,7 +2031,7 @@ void ONMainWindow::slotProxyFinished ( int,QProcess::ExitStatus )
 	}
       }
     }
-#endif
+// #endif
 #endif
     if ( closeEventSent )
         return;
@@ -1993,9 +2112,16 @@ void ONMainWindow::slotProxyFinished ( int,QProcess::ExitStatus )
     {
         if ( !embedMode )
         {
+	  if(!brokerMode)
+	  {
             pass->setText ( "" );
             QTimer::singleShot ( 2000,this,
                                  SLOT ( slotShowPassForm() ) );
+	  }
+	  else
+	                QTimer::singleShot ( 2000,broker,
+                                 SLOT ( getUserSessions() ) );
+	    
         }
     }
     else
diff --git a/onmainwindow_part3.cpp b/onmainwindow_part3.cpp
index 52ba3e0..1bc6564 100644
--- a/onmainwindow_part3.cpp
+++ b/onmainwindow_part3.cpp
@@ -51,7 +51,11 @@ void ONMainWindow::runCommand()
     bool rootless=false;
     if ( !embedMode )
     {
-        X2goSettings st ( "sessions" );
+        X2goSettings* st;
+	if(!brokerMode)
+	  st=new X2goSettings( "sessions" );
+	else
+	  st=new X2goSettings(config.iniFile, QSettings::IniFormat);
 
 
         if ( useLdap )
@@ -59,29 +63,30 @@ void ONMainWindow::runCommand()
         else
         {
             QString sid=lastSession->id();
-            command=st.setting()->value (
+            command=st->setting()->value (
                         sid+"/command",
                         ( QVariant ) tr ( "KDE" ) ).toString();
-            rdpOpts=st.setting()->value (
+            rdpOpts=st->setting()->value (
                         sid+"/rdpoptions",
                         ( QVariant ) "" ).toString();
-            rdpServer=st.setting()->value (
+            rdpServer=st->setting()->value (
                           sid+"/rdpserver",
                           ( QVariant ) "" ).toString();
-            rootless=st.setting()->value ( sid+"/rootless",
+            rootless=st->setting()->value ( sid+"/rootless",
                                            ( QVariant ) false ).toBool();
 
-            rdpFS=st.setting()->value (
+            rdpFS=st->setting()->value (
                       sid+"/fullscreen",
                       ( QVariant ) defaultFullscreen ).toBool();
-            rdpHeight=st.setting()->value (
+            rdpHeight=st->setting()->value (
                           sid+"/height",
                           ( QVariant ) defaultHeight ).toString();
-            rdpWidth=st.setting()->value (
+            rdpWidth=st->setting()->value (
                          sid+"/width",
                          ( QVariant ) defaultWidth ).toString();
 
         }
+        delete st;
     }
     else
     {
@@ -220,6 +225,11 @@ bool ONMainWindow::parseParameter ( QString param )
         ONMainWindow::portable=true;
         return true;
     }
+    if ( param == "--clean-all-files" )
+    {
+        cleanAllFiles=true;
+        return true;
+    }
 
     if ( param=="--no-menu" )
     {
@@ -257,6 +267,12 @@ bool ONMainWindow::parseParameter ( QString param )
         noSessionEdit=true;
         return true;
     }
+    if( param=="--change-broker-pass")
+    {
+      changeBrokerPass=true;
+      return true;
+    }
+    
 
     QString setting,value;
     QStringList vals=param.split ( "=" );
@@ -368,6 +384,86 @@ bool ONMainWindow::parseParameter ( QString param )
         embedParent=value.toLong();
         return true;
     }
+    if( setting == "--broker-url")
+    {
+      brokerMode=true;
+      noSessionEdit=true;
+      config.brokerurl=value;
+      return true;
+    }
+    if( setting == "--broker-name")
+    {
+      config.brokerName=value;
+      return true;
+    }
+    if( setting == "--auth-id")
+    {
+      QFile file(value);
+     if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
+     {
+         printError ( param + tr(" (can't open file)"));
+         return false;
+     }
+         QTextStream in(&file);
+         config.brokerUserId = in.readLine();
+	 return true;
+    }
+    if(setting == "--support-menu")
+    {
+      if(! QFile::exists(value))
+      {
+	printError( param + tr(" (file not exists)"));
+	return false;
+      }
+      supportMenuFile=value;
+      return true;
+    }
+    if(setting == "--background")
+    {
+      if(! QFile::exists(value))
+      {
+	printError( param + tr(" (file not exists)"));
+	return false;
+      }
+      BGFile=value;
+      return true;
+    }
+    if(setting == "--session-icon")
+    {
+      if(! QFile::exists(value))
+      {
+	printError( param + tr(" (file not exists)"));
+	return false;
+      }
+      SPixFile=value;
+      return true;
+    }
+    if(setting == "--home")
+    {
+      QDir dr;
+      
+#ifdef Q_OS_WIN
+      int find=value.indexOf("(");
+      int lind=value.indexOf(")");
+      if(find!=-1 && lind !=-1)
+      {	
+	QString label=value.mid(find+1,lind-find-1);
+	x2goDebug<< "searching for drive with label: "<<label;
+	QString drive=wapiGetDriveByLabel(label);
+	value.replace("("+label+")",drive);
+	x2goDebug<<"new path: "<<value;
+      }
+#endif
+      if(! dr.exists(value))
+      {
+	printError( param + tr(" (directory not exists)"));
+	return false;
+      }
+      homeDir=value;
+      portableDataPath=value;
+      return true;
+    }
+
     printError ( param );
     return false;
 }
@@ -617,6 +713,7 @@ void ONMainWindow::showHelp()
         "--kbd-layout=<layout>\t\t set default keyboard layout or layouts\n"
         "comma separated\n"
         "--kbd-type=<typed>\t\t set default keyboard type\n"
+        "--home=<dir>\t\t set users home directory\n"
         "--set-kbd=<0|1>\t\t\t overwrite current keyboard settings\n" ;
     qCritical ( "%s",helpMsg.toLocal8Bit().data() );
     QMessageBox::information ( this,tr ( "Options" ),helpMsg );
@@ -708,22 +805,21 @@ void ONMainWindow::slotGetServers ( bool result, QString output,
 
     listedSessions.clear();
     retSessions=0;
-// TODO: should use x2golistsessions --all-servers to create less ssh sessions
+    if(sshConnection)
+      sshConnection->disconnectSession();
+    QString passwd;
+    QString user=getCurrentUname();
+    passwd=getCurrentPass();
+    for(int i=0; i< serverSshConnections.count();++i)
+    {
+      if(serverSshConnections[i])
+	serverSshConnections[i]->disconnectSession();
+    }
+    serverSshConnections.clear();
     for ( int j=0;j<x2goServers.size();++j )
     {
-        QString passwd;
-        QString user=getCurrentUname();
         QString host=x2goServers[j].name;
-        passwd=getCurrentPass();
-
-        SshProcess* lproc;
-        lproc=new SshProcess ( sshConnection,  this );
-        connect ( lproc,SIGNAL ( sshFinished ( bool,
-                                               QString,SshProcess* ) ),
-                  this,SLOT (
-                      slotListAllSessions ( bool,
-                                            QString,SshProcess* ) ) );
-        lproc->startNormal ( "export HOSTNAME && x2golistsessions" );
+	serverSshConnections<<startSshConnection ( host,sshPort,acceptRsa,user,passwd,true,true);
     }
 }
 
@@ -732,12 +828,14 @@ void ONMainWindow::slotListAllSessions ( bool result,QString output,
         SshProcess* proc )
 {
     bool last=false;
+
     ++retSessions;
     if ( retSessions == x2goServers.size() )
         last=true;
     if ( proc )
         delete proc;
     proc=0;
+    
     if ( result==false )
     {
         QString message=tr ( "<b>Connection failed</b>\n" ) +output;
@@ -770,15 +868,15 @@ void ONMainWindow::slotListAllSessions ( bool result,QString output,
                 ( listedSessions.size() ==1 &&
                   listedSessions[0].length() <5 ) )
         {
-// 			x2goDebug<<"start New Session";
+// 	x2goDebug<<"start New Session";
             startNewSession();
         }
         else if ( listedSessions.size() ==1 )
         {
-// 			x2goDebug<<"have one session";
+// 	x2goDebug<<"have one session";
             x2goSession s=getSessionFromString (
                               listedSessions[0] );
-// 			x2goDebug<<"will procceed one session";
+// 		x2goDebug<<"will procceed one session";
             QDesktopWidget wd;
             if ( s.status=="S" && isColorDepthOk (
                         wd.depth(),s.colorDepth ) )
@@ -1398,6 +1496,21 @@ void ONMainWindow::slotAboutQt()
     QMessageBox::aboutQt ( this );
 }
 
+void ONMainWindow::slotSupport()
+{
+    QFile file(supportMenuFile);
+     if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
+         return;
+
+     QTextStream in(&file);
+     QString sup;
+     while (!in.atEnd()) 
+     {
+         sup+=in.readLine();
+     }     
+     QMessageBox::information (this,tr ( "Support" ),sup);
+}
+
 void ONMainWindow::slotAbout()
 {
     QString aboutStr=tr (
@@ -1887,7 +2000,11 @@ void ONMainWindow::slotCheckAgentProcess()
         cardStarted=false;
         if ( nxproxy )
             if ( nxproxy->state() ==QProcess::Running )
-                nxproxy->terminate();
+	    {
+	          x2goDebug<<"Suspending session\n";
+	          slotSuspendSessFromSt();
+//                 nxproxy->terminate();
+	    }
     }
 
     x2goDebug<<"gpg-agent finished\n";
diff --git a/onmainwindow_part4.cpp b/onmainwindow_part4.cpp
index 451c421..a6102d6 100644
--- a/onmainwindow_part4.cpp
+++ b/onmainwindow_part4.cpp
@@ -282,14 +282,18 @@ void ONMainWindow::startXOrg ()
     QTextStream ( &dispString ) <<":"<<xDisplay;
 
     QStringList args;
-    QString exec=appDir+"\\xming\\Xming.exe";
-    bool xming=true;
+    QString exec;
+    if(internalX==XMING)
+       exec=appDir+"\\xming\\Xming.exe";
+    if(internalX==VCXSRV)
+       exec=appDir+"\\vcxsrv\\vcxsrv.exe";
     winServersReady=false;
-#ifdef CFGCLIENT
-    xming=useXming;
-    if (!xming)
+    x2goDebug<<"using internal X: "<<useInternalX;
+//#ifdef CFGCLIENT
+    if (!useInternalX || internalX!=XMING)
     {
-        exec=xorgExe;
+        if(!useInternalX)
+            exec=xorgExe;
         QString cmdLine;
         if (startXorgOnStart)
             cmdLine=xorgOptions;
@@ -320,9 +324,9 @@ void ONMainWindow::startXOrg ()
         }
         args<<dispString;
     }
-#endif
+//#endif
     xorg=new QProcess ( 0 );
-    if (xming)
+    if (useInternalX && (internalX==XMING))
     {
       
         QString workingDir=appDir+"\\xming";
@@ -344,7 +348,7 @@ void ONMainWindow::startXOrg ()
         xorg-> setWorkingDirectory ( workingDir);
     }
     
-    x2goDebug<<"running"<<exec;
+    x2goDebug<<"running"<<exec<<" "<<args.join(" ");
     xorg->start ( exec, args );
 
 
@@ -356,15 +360,41 @@ void ONMainWindow::startXOrg ()
                  "Please check your installation" ) );
         close();
     }
-#ifdef CFGCLIENT
-    if (!xming)
+// #ifdef CFGCLIENT
+    if ( !useInternalX || internalX!= XMING)
     {
-        x2goDebug<<"servers ready after"<<xorgDelay<<endl;
-        QTimer::singleShot(xorgDelay*1000, this, SLOT(slotSetWinServersReady()));
+	 //check connection in slot and launch setWinServerReady
+	 waitingForX=0;
+         QTimer::singleShot(1000, this, SLOT(slotCheckXOrgConnection()));
     }
-#endif
+// #endif
 }
 
+void ONMainWindow::slotCheckXOrgConnection()
+{
+    ++waitingForX;
+    if(isServerRunning(6000+xDisplay))
+    {
+      x2goDebug<<"X is started";
+      slotSetWinServersReady();
+    }
+    else
+    {
+      if(waitingForX > 10)
+      {
+         QMessageBox::critical (
+            0,QString::null,
+            tr ( "Can't start X Server\n"
+                 "Please check your installation" ) );
+         close();
+      }
+      else
+      {
+        x2goDebug<<"waiting for X";
+	QTimer::singleShot(1000, this, SLOT(slotCheckXOrgConnection()));	
+      }
+    }
+}
 
 WinServerStarter::WinServerStarter ( daemon server, ONMainWindow * par ) :
 QThread ( 0 )
@@ -421,17 +451,17 @@ void ONMainWindow::startWinServers()
     {
         pulseStarter->start();
     }
-#ifdef CFGCLIENT
-        x2goDebug<<"xorg settings: "<<startXorgOnStart <<" "<< useXming<<endl;
-    if (useXming)
+// #ifdef CFGCLIENT
+//     x2goDebug<<"xorg settings: "<<startXorgOnStart <<" "<< useXming<<endl;
+    if ( useInternalX && (internalX== XMING))
     {
-#endif
+// #endif
         xStarter->start();
         xorgLogTimer=new QTimer ( this );
         connect ( xorgLogTimer,SIGNAL ( timeout() ),this,
                   SLOT ( slotCheckXOrgLog() ) );
         xorgLogTimer->start ( 500 );
-#ifdef CFGCLIENT
+// #ifdef CFGCLIENT
     }
     else
     {
@@ -440,7 +470,7 @@ void ONMainWindow::startWinServers()
             startXOrg();
         }
     }
-#endif
+// #endif
 }
 
 
@@ -678,26 +708,45 @@ void ONMainWindow::startPulsed()
 }
 
 
-#ifdef CFGCLIENT
+// #ifdef CFGCLIENT
 void ONMainWindow::xorgSettings()
 {
     x2goDebug<<"getting xorg settings"<<endl;
 
     X2goSettings st ( "settings" );
-    useXming=(st.setting()->value("usexming",true).toBool());
+    
+    useInternalX=(st.setting()->value("useintx",true).toBool());
+    
     xorgExe=(st.setting()->value("xexec","C:\\program files\\vcxsrv\\vcxsrv.exe").toString());
     xorgOptions=(st.setting()->value("options","-multiwindow -notrayicon -clipboard").toString());
     startXorgOnStart=(st.setting()->value("onstart",true).toBool());
     xorgWinOptions=(st.setting()->value("optionswin","-screen 0 %wx%h -notrayicon -clipboard").toString());
     xorgFSOptions=(st.setting()->value("optionsfs","-fullscreen -notrayicon -clipboard").toString());
     xorgSAppOptions=(st.setting()->value("optionssingle","-multiwindow -notrayicon -clipboard").toString());
-    xorgDelay=(st.setting()->value("delay",3).toInt());
+    
+    if(QFile::exists(appDir+"\\vcxsrv"))
+      internalX=VCXSRV;
+    if(QFile::exists(appDir+"\\xming"))
+      internalX=XMING;
+    if(useInternalX)
+    {
+      startXorgOnStart=(internalX==XMING);
+      xorgOptions="-multiwindow -notrayicon -clipboard";
+      if(internalX==VCXSRV)
+      {
+// 	xorgWinOptions="-screen 0 %wx%h -notrayicon -clipboard";
+	xorgWinOptions="-multiwindow -notrayicon -clipboard";
+        xorgFSOptions="-fullscreen -notrayicon -clipboard";
+        xorgSAppOptions="-multiwindow -notrayicon -clipboard";
+      }
+    }
 
 }
-#endif
+// #endif
 
 void ONMainWindow::slotSetWinServersReady()
 {
+    x2goDebug<<"all winservers are started\n";
     winServersReady=true;
     restoreCygnusSettings();
 }
@@ -906,7 +955,7 @@ QString ONMainWindow::getCurrentUname()
 
 QString ONMainWindow::getCurrentPass()
 {
-    return pass->text();
+    return pass->text();   
 }
 
 void ONMainWindow::slotDetachProxyWindow()
@@ -2117,22 +2166,43 @@ QSize ONMainWindow::getEmbedAreaSize()
 
 void ONMainWindow::slotStartBroker()
 {
-    broker=new HttpBrokerClient ( this, &config );
-    connect ( broker,SIGNAL ( haveSshKey ( QString ) ),this,
-              SLOT ( slotStartSshAgent ( QString ) ) );
-    connect ( broker,SIGNAL ( haveAgentInfo () ),this,
-              SLOT ( slotStartNewBrokerSession () ) );
-    connect ( broker,SIGNAL ( fatalHttpError() ),this,
-              SLOT ( close() ) );
-    connect ( broker,SIGNAL ( cmdReconnect() ),this,
-              SLOT ( slotReconnectSession() ) );
+    config.brokerPass=pass->text();
+    config.brokerUser=login->text();
     setStatStatus ( tr ( "Connecting to broker" ) );
     stInfo->insertPlainText ( "broker url: "+config.brokerurl );
     setEnabled ( false );
-
+    broker->getUserSessions();
+}
+
+void ONMainWindow::slotGetBrokerSession(const QString& sinfo)
+{
+   //x2goDebug<<"broker session: "<<sinfo;
+   QStringList lst=sinfo.split("SERVER:",QString::SkipEmptyParts);
+   int keyStartPos=sinfo.indexOf("-----BEGIN DSA PRIVATE KEY-----");
+   QString endStr="-----END DSA PRIVATE KEY-----";
+   int keyEndPos=sinfo.indexOf(endStr);
+   if(keyEndPos == -1 || keyStartPos == -1 || lst.size()==0)
+   {
+     //throw error
+      QMessageBox::critical (
+                0,tr ( "Error" ),
+                tr ("Invalid reply from broker") +"<br>"+sinfo);
+
+     close();
+     return;
+   }
+   config.server=(lst[1].split("\n"))[0];
+   config.key=sinfo.mid(keyStartPos, keyEndPos+endStr.length()-keyStartPos);
+//    x2goDebug<<"server: "<<config.server<<endl<<" key: "<<config.key;
+   if(sinfo.indexOf("SESSION_INFO")!=-1)
+   {
+        QStringList lst=sinfo.split("SESSION_INFO:",QString::SkipEmptyParts);
+	config.sessiondata=(lst[1].split("\n"))[0];
+// 	x2goDebug<<"data: "<<config.sessiondata;
+   }
+   slotSessEnter();
 }
 
-
 void ONMainWindow::slotStartNewBrokerSession ( )
 {
     if ( managedMode )
@@ -2176,19 +2246,21 @@ QString ONMainWindow::u3DataPath()
 
 void ONMainWindow::cleanPortable()
 {
-    QDir dr;
-    dr.rmdir ( QDir::homePath() +"/.ssh" );
-    removeDir ( homeDir+"/.x2go/" );
+    removeDir ( homeDir +"/.ssh" );
+    removeDir ( homeDir +"/ssh" );
+    removeDir ( homeDir+"/.x2go" );
+    if(cleanAllFiles)
+      removeDir(homeDir+"/.x2goclient");
 }
 
 void ONMainWindow::removeDir ( QString path )
 {
-    x2goDebug<<"entering path";
+    x2goDebug<<"entering " <<path;
     QDir dr ( path );
     QStringList files=dr.entryList ( QDir::Files );
     for ( int i=0;i<files.size();++i )
     {
-        if ( files[i]!="known_hosts" )
+        if ( files[i]!="known_hosts" || cleanAllFiles)
         {
             x2goDebug<<"cleaning file:"<<path+"/"+files[i];
             dr.remove ( path+"/"+files[i] );
diff --git a/onmainwindow_privat.h b/onmainwindow_privat.h
index 60d623e..a2d54aa 100644
--- a/onmainwindow_privat.h
+++ b/onmainwindow_privat.h
@@ -74,6 +74,7 @@
 #include "clicklineedit.h"
 #include <QThread>
 
+#include "brokerpassdlg.h"
 
 #include "sshmasterconnection.h"
 
diff --git a/resources.rcc b/resources.rcc
index 931afc1..a22aaa9 100644
--- a/resources.rcc
+++ b/resources.rcc
@@ -40,6 +40,7 @@
        <file>icons/32x32/detach.png</file>
        <file>icons/32x32/suspend.png</file>
        <file>icons/32x32/stop.png</file>
+       <file>icons/32x32/auth.png</file>
        <file>icons/32x32/x2goclient.png</file>
        <file>icons/32x32/resolution.png</file>
        <file>icons/16x16/audio.png</file>
diff --git a/sessionbutton.cpp b/sessionbutton.cpp
index 197ad11..c5ec122 100644
--- a/sessionbutton.cpp
+++ b/sessionbutton.cpp
@@ -30,7 +30,7 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id )
         : SVGFrame ( ":/svg/sessionbut.svg",false,parent )
 {
     editable=mw->sessionEditEnabled();
-    
+
     QFont fnt=font();
     if ( mw->retMiniMode() )
 #ifdef Q_WS_HILDON
@@ -71,6 +71,7 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id )
     geomBox->setPalette ( cpal );
 
     sessName=new QLabel ( this );
+    sessStatus=new QLabel ( this );
     fnt=sessName->font();
     fnt.setBold ( true );
     sessName->setFont ( fnt );
@@ -142,6 +143,7 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id )
     if ( !miniMode )
     {
         sessName->move ( 80,34 );
+	sessStatus->move(80,50);
         editBut->move ( 307,156 );
         serverIcon->move ( 58,84 );
         server->move ( 80,84 );
@@ -158,6 +160,7 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id )
     {
         editBut->move ( 218,113 );
         sessName->move ( 64,11 );
+	sessStatus->hide();
         serverIcon->move ( 66,44 );
         server->move ( 88,44 );
         cmdIcon->move ( 66,68 );
@@ -169,6 +172,14 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id )
         soundIcon->move ( 66,116 );
         sound->move ( 86,116 );
     }
+    
+    if(mw->brokerMode)
+    {
+      icon->move(10,30);
+      sessName->move(90,50);
+      sessStatus->move(90,70);
+      setFixedHeight(120);
+    }
 
 
     cmdBox->hide();
@@ -206,7 +217,18 @@ SessionButton::SessionButton ( ONMainWindow* mw,QWidget *parent, QString id )
         cmdBox->hide();
         geomBox->hide();
         sessMenu->hide();
-	sound->setEnabled(false);
+        sound->setEnabled(false);
+    }
+    if(mw->brokerMode)
+    {
+      cmd->hide();
+      cmdIcon->hide();
+      server->hide();
+      serverIcon->hide();
+      geom->hide();
+      geomIcon->hide();
+      sound->hide();
+      soundIcon->hide();
     }
 }
 
@@ -232,36 +254,66 @@ void SessionButton::slotRemove()
 void SessionButton::redraw()
 {
     bool snd;
-    X2goSettings st ( "sessions" );
+
+
+    X2goSettings *st;
+
+    if (par->brokerMode)
+        st=new X2goSettings(par->config.iniFile,QSettings::IniFormat);
+    else
+        st= new X2goSettings( "sessions" );
+
+
+
     sessName->setText (
-        st.setting()->value ( sid+"/name",
-                              ( QVariant ) tr ( "New Session" ) ).toString() );
-    QString sessIcon=st.setting()->value (
+        st->setting()->value ( sid+"/name",
+                               ( QVariant ) tr ( "New Session" ) ).toString());
+    QString status=st->setting()->value ( sid+"/status",
+                                          ( QVariant ) QString::null ).toString();
+    if (status == "R")
+    {
+        sessStatus->setText("("+tr("running")+")");
+    }
+    if (status == "S")
+    {
+        sessStatus->setText("("+tr("suspended")+")");
+    }
+
+    QString sessIcon=st->setting()->value (
                          sid+"/icon",
                          ( QVariant )
                          ":icons/128x128/x2gosession.png"
                      ).toString();
-    QPixmap pix ( sessIcon );
+    QPixmap* pix;
+
+    if (!par->brokerMode || sessIcon == ":icons/128x128/x2gosession.png")
+        pix=new QPixmap( sessIcon );
+    else
+    {
+        pix=new QPixmap;
+        pix->loadFromData(QByteArray::fromBase64(sessIcon.toAscii()));
+    }
     if ( !par->retMiniMode() )
-        icon->setPixmap ( pix.scaled ( 64,64,Qt::IgnoreAspectRatio,
-                                       Qt::SmoothTransformation ) );
+        icon->setPixmap ( pix->scaled ( 64,64,Qt::IgnoreAspectRatio,
+                                        Qt::SmoothTransformation ) );
     else
-        icon->setPixmap ( pix.scaled ( 48,48,Qt::IgnoreAspectRatio,
-                                       Qt::SmoothTransformation ) );
-
-    QString sv=st.setting()->value ( sid+"/host", ( QVariant )
-                                     QString::null ).toString();
-    QString uname=st.setting()->value ( sid+"/user", ( QVariant )
-                                        QString::null ).toString();
+        icon->setPixmap ( pix->scaled ( 48,48,Qt::IgnoreAspectRatio,
+                                        Qt::SmoothTransformation ) );
+
+    delete pix;
+    QString sv=st->setting()->value ( sid+"/host", ( QVariant )
+                                      QString::null ).toString();
+    QString uname=st->setting()->value ( sid+"/user", ( QVariant )
+                                         QString::null ).toString();
     server->setText ( uname+"@"+sv );
 
-    QString command=st.setting()->value ( sid+"/command",
-                                          ( QVariant )
-                                          tr (
-                                              "KDE" ) ).
+    QString command=st->setting()->value ( sid+"/command",
+                                           ( QVariant )
+                                           tr (
+                                               "KDE" ) ).
                     toString();
-    rootless=st.setting()->value ( sid+"/rootless",
-                                   false ).toBool();
+    rootless=st->setting()->value ( sid+"/rootless",
+                                    false ).toBool();
 
 
     cmdBox->clear();
@@ -337,17 +389,17 @@ void SessionButton::redraw()
 #else
     geomBox->addItem ( tr ( "window" ) );
 #endif
-    if ( st.setting()->value ( sid+"/fullscreen",
-                               ( QVariant ) false ).toBool() )
+    if ( st->setting()->value ( sid+"/fullscreen",
+                                ( QVariant ) false ).toBool() )
     {
         geom->setText ( tr ( "fullscreen" ) );
     }
     else
     {
 #ifndef	Q_WS_HILDON
-        QString g=QString::number ( st.setting()->value (
+        QString g=QString::number ( st->setting()->value (
                                         sid+"/width" ).toInt() );
-        g+="x"+QString::number ( st.setting()->value (
+        g+="x"+QString::number ( st->setting()->value (
                                      sid+"/height" ).toInt() );
         geom->setText ( g );
         if ( geomBox->findText ( g ) ==-1 )
@@ -360,7 +412,7 @@ void SessionButton::redraw()
     }
 
 
-    snd=st.setting()->value ( sid+"/sound", ( QVariant ) true ).toBool();
+    snd=st->setting()->value ( sid+"/sound", ( QVariant ) true ).toBool();
     if ( snd )
         sound->setText ( tr ( "Enabled" ) );
     else
@@ -374,6 +426,7 @@ void SessionButton::redraw()
     geom->setMinimumSize ( geom->sizeHint() );
     cmd->setMinimumSize ( cmd->sizeHint() );
     server->setMinimumSize ( server->sizeHint() );
+    delete st;
 }
 
 void SessionButton::mousePressEvent ( QMouseEvent * event )
@@ -396,8 +449,8 @@ void SessionButton::mouseMoveEvent ( QMouseEvent * event )
 {
 
     SVGFrame::mouseMoveEvent ( event );
-    if(!editable)
-      return;
+    if (!editable)
+        return;
     if ( cmd->isVisible() )
         if ( event->x() > cmd->x() && event->x() < cmd->x() +
                 cmd->width() &&
diff --git a/sessionbutton.h b/sessionbutton.h
index 8efaad4..b39bdb5 100644
--- a/sessionbutton.h
+++ b/sessionbutton.h
@@ -36,6 +36,7 @@ class SessionButton : public SVGFrame
 	private:
 		QString sid;
 		QLabel* sessName;
+		QLabel* sessStatus;
 		QLabel* icon;
 		QComboBox* cmdBox;
 		QLabel* cmd;
diff --git a/sshmasterconnection.cpp b/sshmasterconnection.cpp
index d36d675..1f89963 100644
--- a/sshmasterconnection.cpp
+++ b/sshmasterconnection.cpp
@@ -28,8 +28,10 @@
 #include <arpa/inet.h>
 #endif
 
+#include "onmainwindow.h"
+
 #undef DEBUG
-#define DEBUG
+// #define DEBUG
 
 static bool isLibSshInited=false;
 
@@ -44,11 +46,13 @@ SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUn
     this->autologin=autologin;
     this->acceptUnknownServers=acceptUnknownServers;
     reverseTunnel=false;
+    mainWnd=(ONMainWindow*) parent;
 }
 
 SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUnknownServers, QString user,
         QString pass, QString key, bool autologin,
-        int remotePort, QString localHost, int localPort, SshProcess* creator, QObject* parent ) : QThread ( parent )
+        int remotePort, QString localHost, int localPort, SshProcess* creator, 
+					   QObject* parent, ONMainWindow* mwd ) : QThread ( parent )
 {
 
     this->host=host;
@@ -63,6 +67,7 @@ SshMasterConnection::SshMasterConnection ( QString host, int port, bool acceptUn
     reverseTunnelCreator=creator;
     reverseTunnel=true;
     reverseTunnelRemotePort=remotePort;
+    mainWnd=mwd;
 }
 
 SshMasterConnection* SshMasterConnection::reverseTunnelConnection ( SshProcess* creator,
@@ -70,7 +75,7 @@ SshMasterConnection* SshMasterConnection::reverseTunnelConnection ( SshProcess*
 {
     SshMasterConnection* con=new SshMasterConnection ( host,port,acceptUnknownServers,user,pass,
             key,autologin, remotePort,localHost,
-            localPort,creator,this );
+            localPort,creator,this, mainWnd);
 
     connect ( con,SIGNAL ( ioErr ( SshProcess*,QString,QString ) ),this,SIGNAL ( ioErr ( SshProcess*,QString,QString ) ) );
     connect ( con,SIGNAL ( stdErr ( SshProcess*,QByteArray ) ),this,SIGNAL ( stdErr ( SshProcess*,QByteArray ) ) );
@@ -120,7 +125,9 @@ void SshMasterConnection::run()
         quit();
         return;
     }
-
+#ifdef Q_OS_WIN    
+    ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, (mainWnd->getHomeDirectory()+"/ssh").toAscii());
+#endif
 //     ssh_options_set(my_ssh_session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
     if ( !sshConnect() )
     {
@@ -146,9 +153,18 @@ void SshMasterConnection::run()
     }
 
     ssh_options_set ( my_ssh_session, SSH_OPTIONS_USER, user.toAscii() );
+#ifdef Q_OS_WIN    
+    ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, (mainWnd->getHomeDirectory()+"/ssh").toAscii());
+#endif    
+    x2goDebug<<"setting SSH DIR to "<<mainWnd->getHomeDirectory()+"/ssh";
 
     if ( userAuth() )
-        emit connectionOk();
+    {
+      #ifdef DEBUG
+        x2goDebug<<"user auth OK\n";
+      #endif
+        emit connectionOk(host);
+    }
     else
     {
         QString err=ssh_get_error ( my_ssh_session );
@@ -317,7 +333,7 @@ bool SshMasterConnection::userAuthWithKey()
     if ( key.indexOf ( "PRIVATE KEY" ) !=-1 )
     {
         QDir dr;
-        QString keyPath=QDir::homePath() +"/.x2go/ssh/gen";
+        QString keyPath=mainWnd->getHomeDirectory() +"/.x2go/ssh/gen";
         dr.mkpath ( keyPath );
         QTemporaryFile fl ( keyPath+"/key" );
         fl.open();
diff --git a/sshmasterconnection.h b/sshmasterconnection.h
index a68c0b4..0de9a22 100644
--- a/sshmasterconnection.h
+++ b/sshmasterconnection.h
@@ -24,6 +24,7 @@
 #include <QThread>
 #include <QStringList>
 
+class ONMainWindow;
 class SshProcess;
 struct ChannelConnection
 {
@@ -68,11 +69,13 @@ public:
       acceptUnknownServers=accept;
     }
     SshMasterConnection* reverseTunnelConnection(SshProcess* creator, int remotePort, QString localHost, int localPort);
+    QString getHost(){return host;}
 
 private:
     SshMasterConnection(QString host, int port, bool acceptUnknownServers, QString user, QString pass, QString key,
                         bool autologin,
-                        int remotePort, QString localHost, int localPort, SshProcess* creator, QObject* parent = 0);
+                        int remotePort, QString localHost, int localPort, SshProcess* creator, 
+			QObject* parent, ONMainWindow* parWnd);
     bool sshConnect();
     bool userAuthWithPass();
     bool userAuthAuto();
@@ -105,7 +108,8 @@ private:
     int reverseTunnelLocalPort;
     bool acceptUnknownServers;
     QString reverseTunnelLocalHost;
-    SshProcess* reverseTunnelCreator;    
+    SshProcess* reverseTunnelCreator;   
+    ONMainWindow* mainWnd;
 
 signals:
     void stdErr(SshProcess* caller, QByteArray data);
@@ -121,7 +125,7 @@ signals:
 
     void newReverceTunnelConnection(SshProcess* creator, void* newChannel);
     void reverseListenOk(SshProcess* creator);
-    void connectionOk();
+    void connectionOk( QString host);
 };
 
 
diff --git a/sshprocess.cpp b/sshprocess.cpp
index 83d1ce4..9e72e8f 100644
--- a/sshprocess.cpp
+++ b/sshprocess.cpp
@@ -25,7 +25,7 @@
 #endif
 
 #undef DEBUG
-#define DEBUG
+// #define DEBUG
 
 SshProcess::SshProcess(SshMasterConnection* master, QObject* parent): QObject(parent)
 {
diff --git a/version.h b/version.h
index 119983c..bc0e097 100644
--- a/version.h
+++ b/version.h
@@ -1 +1 @@
-#define VERSION "3.0.1.18"
+#define VERSION "3.99.0.0"
diff --git a/wapi.cpp b/wapi.cpp
index 297ead3..e565cc6 100644
--- a/wapi.cpp
+++ b/wapi.cpp
@@ -177,6 +177,38 @@ QString wapiShortFileName ( const QString& longName )
 }
 
 
+QString wapiGetDriveByLabel(const QString& label)
+{
+  int len=GetLogicalDriveStrings(0,0);
+  if(len>0)
+  {
+    TCHAR* buf=new TCHAR[len+1];
+    len=GetLogicalDriveStrings(len,buf);
+    for(int i=0;i<len;i+=4)
+    {      
+       QString drive=QString::fromUtf16 ( ( const ushort* ) buf+i );
+       x2goDebug<<"drive:"<<drive;
+       TCHAR vol[MAX_PATH+1];
+       TCHAR fs[MAX_PATH+1];
+       GetVolumeInformation(buf+i,vol,MAX_PATH,0,0,0,fs,MAX_PATH);       
+       QString volume=QString::fromUtf16 ( ( const ushort* ) vol );
+       x2goDebug<<"vol:"<<volume<<
+       "fs:"<<QString::fromUtf16 ( ( const ushort* ) fs );
+       if(!volume.compare(label,Qt::CaseInsensitive))
+       {
+	 x2goDebug<<"matched! ";
+	 
+	 delete []buf;
+	 return drive.replace(":\\","");
+       }
+    }
+    delete []buf;
+  }
+  
+  return label;
+}
+
+
 QString getNameFromSid ( PSID psid, QString* systemName )
 {
 	DWORD length=0;
diff --git a/wapi.h b/wapi.h
index e5e59d2..ffdd392 100644
--- a/wapi.h
+++ b/wapi.h
@@ -51,6 +51,8 @@ QString wapiGetDefaultPrinter();
 QStringList wapiGetLocalPrinters();
 long wapiSetFSWindow ( HWND hWnd, const QRect& desktopGeometry );
 void wapiRestoreWindow ( HWND hWnd, long style, const QRect& desktopGeometry );
+QString wapiGetDriveByLabel(const QString& label);
+
 
 
 #endif
diff --git a/x2goclient-3.01-libssh.kdev4 b/x2goclient-3.01-libssh.kdev4
deleted file mode 100644
index 07849c9..0000000
--- a/x2goclient-3.01-libssh.kdev4
+++ /dev/null
@@ -1,3 +0,0 @@
-[Project]
-Manager=KDevCustomMakeManager
-Name=x2goclient-3.01-libssh
diff --git a/x2goclient.kdevelop b/x2goclient.kdevelop
deleted file mode 100644
index f210a0c..0000000
--- a/x2goclient.kdevelop
+++ /dev/null
@@ -1,204 +0,0 @@
-<?xml version = '1.0'?>
-<kdevelop>
-  <general>
-    <author>Oleksandr Shneyder</author>
-    <email>oleksandr.shneyder at obviously-nice.de</email>
-    <version>$VERSION$</version>
-    <projectmanagement>KDevTrollProject</projectmanagement>
-    <primarylanguage>C++</primarylanguage>
-    <keywords>
-      <keyword>Qt</keyword>
-    </keywords>
-    <projectdirectory>.</projectdirectory>
-    <absoluteprojectpath>false</absoluteprojectpath>
-    <description/>
-    <ignoreparts/>
-    <versioncontrol/>
-    <projectname>x2goclient</projectname>
-    <defaultencoding/>
-  </general>
-  <kdevfileview>
-    <groups>
-      <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
-      <group pattern="*.ui" name="User Interface" />
-      <group pattern="*.png" name="Icons" />
-      <group pattern="*" name="Others" />
-      <hidenonprojectfiles>false</hidenonprojectfiles>
-      <hidenonlocation>false</hidenonlocation>
-    </groups>
-    <tree>
-      <hidepatterns>*.o,*.lo,CVS</hidepatterns>
-      <hidenonprojectfiles>false</hidenonprojectfiles>
-    </tree>
-  </kdevfileview>
-  <kdevdoctreeview>
-    <ignoretocs>
-      <toc>bash</toc>
-      <toc>bash_bugs</toc>
-      <toc>clanlib</toc>
-      <toc>w3c-dom-level2-html</toc>
-      <toc>fortran_bugs_gcc</toc>
-      <toc>gnome1</toc>
-      <toc>gnustep</toc>
-      <toc>gtk</toc>
-      <toc>gtk_bugs</toc>
-      <toc>haskell</toc>
-      <toc>haskell_bugs_ghc</toc>
-      <toc>java_bugs_gcc</toc>
-      <toc>java_bugs_sun</toc>
-      <toc>kde2book</toc>
-      <toc>opengl</toc>
-      <toc>pascal_bugs_fp</toc>
-      <toc>php</toc>
-      <toc>php_bugs</toc>
-      <toc>perl</toc>
-      <toc>perl_bugs</toc>
-      <toc>python</toc>
-      <toc>python_bugs</toc>
-      <toc>qt-kdev3</toc>
-      <toc>ruby</toc>
-      <toc>ruby_bugs</toc>
-      <toc>sdl</toc>
-      <toc>stl</toc>
-      <toc>w3c-svg</toc>
-      <toc>sw</toc>
-      <toc>w3c-uaag10</toc>
-      <toc>wxwidgets_bugs</toc>
-    </ignoretocs>
-    <ignoredoxygen>
-      <toc>KDE Libraries (Doxygen)</toc>
-    </ignoredoxygen>
-  </kdevdoctreeview>
-  <kdevdebugger>
-    <general>
-      <dbgshell/>
-      <programargs/>
-      <gdbpath/>
-      <configGdbScript/>
-      <runShellScript/>
-      <runGdbScript/>
-      <breakonloadinglibs>true</breakonloadinglibs>
-      <separatetty>false</separatetty>
-      <floatingtoolbar>false</floatingtoolbar>
-      <raiseGDBOnStart>false</raiseGDBOnStart>
-    </general>
-    <display>
-      <staticmembers>false</staticmembers>
-      <demanglenames>true</demanglenames>
-      <outputradix>10</outputradix>
-    </display>
-  </kdevdebugger>
-  <kdevfilecreate>
-    <filetypes/>
-    <useglobaltypes>
-      <type ext="ui" />
-      <type ext="cpp" />
-      <type ext="h" />
-    </useglobaltypes>
-  </kdevfilecreate>
-  <kdevtrollproject>
-    <general>
-      <activedir></activedir>
-    </general>
-    <run>
-      <directoryradio>executable</directoryradio>
-      <customdirectory>/</customdirectory>
-      <mainprogram>/usr/src.cur/db-builds/x2goclient/x2goclient-3.01/x2goclient</mainprogram>
-      <programargs/>
-      <terminal>false</terminal>
-      <autocompile>true</autocompile>
-      <envvars/>
-      <globaldebugarguments/>
-      <globalcwd>/usr/src.cur/db-builds/x2goclient/x2goclient-3.01</globalcwd>
-      <useglobalprogram>true</useglobalprogram>
-      <autoinstall>false</autoinstall>
-      <autokdesu>false</autokdesu>
-    </run>
-    <make>
-      <abortonerror>true</abortonerror>
-      <runmultiplejobs>true</runmultiplejobs>
-      <numberofjobs>3</numberofjobs>
-      <dontact>false</dontact>
-      <makebin/>
-      <prio>0</prio>
-      <envvars/>
-    </make>
-    <qmake>
-      <savebehaviour>2</savebehaviour>
-      <replacePaths>false</replacePaths>
-      <disableDefaultOpts>true</disableDefaultOpts>
-      <enableFilenamesOnly>false</enableFilenamesOnly>
-      <showVariablesInTree>true</showVariablesInTree>
-      <showParseErrors>true</showParseErrors>
-    </qmake>
-    <subclassing/>
-  </kdevtrollproject>
-  <kdevcppsupport>
-    <references/>
-    <codecompletion>
-      <includeGlobalFunctions>true</includeGlobalFunctions>
-      <includeTypes>true</includeTypes>
-      <includeEnums>true</includeEnums>
-      <includeTypedefs>false</includeTypedefs>
-      <automaticCodeCompletion>true</automaticCodeCompletion>
-      <automaticArgumentsHint>true</automaticArgumentsHint>
-      <automaticHeaderCompletion>true</automaticHeaderCompletion>
-      <codeCompletionDelay>250</codeCompletionDelay>
-      <argumentsHintDelay>400</argumentsHintDelay>
-      <headerCompletionDelay>250</headerCompletionDelay>
-      <showOnlyAccessibleItems>false</showOnlyAccessibleItems>
-      <completionBoxItemOrder>0</completionBoxItemOrder>
-      <howEvaluationContextMenu>true</howEvaluationContextMenu>
-      <showCommentWithArgumentHint>true</showCommentWithArgumentHint>
-      <statusBarTypeEvaluation>false</statusBarTypeEvaluation>
-      <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
-      <processPrimaryTypes>true</processPrimaryTypes>
-      <processFunctionArguments>false</processFunctionArguments>
-      <preProcessAllHeaders>false</preProcessAllHeaders>
-      <parseMissingHeaders>false</parseMissingHeaders>
-      <resolveIncludePaths>true</resolveIncludePaths>
-      <alwaysParseInBackground>true</alwaysParseInBackground>
-      <usePermanentCaching>true</usePermanentCaching>
-      <alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
-      <includePaths>.;</includePaths>
-      <parseMissingHeadersExperimental>false</parseMissingHeadersExperimental>
-      <resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental>
-    </codecompletion>
-    <qt>
-      <used>false</used>
-      <version>3</version>
-      <root>/usr/share/qt3</root>
-      <includestyle>3</includestyle>
-      <designerintegration>EmbeddedKDevDesigner</designerintegration>
-      <qmake>/usr/bin/qmake-qt3</qmake>
-      <designer>/usr/bin/designer</designer>
-      <designerpluginpaths/>
-    </qt>
-    <creategettersetter>
-      <prefixGet/>
-      <prefixSet>set</prefixSet>
-      <prefixVariable>m_,_</prefixVariable>
-      <parameterName>theValue</parameterName>
-      <inlineGet>true</inlineGet>
-      <inlineSet>true</inlineSet>
-    </creategettersetter>
-    <splitheadersource>
-      <enabled>false</enabled>
-      <synchronize>true</synchronize>
-      <orientation>Vertical</orientation>
-    </splitheadersource>
-  </kdevcppsupport>
-  <cppsupportpart>
-    <filetemplates>
-      <interfacesuffix>.h</interfacesuffix>
-      <implementationsuffix>.cpp</implementationsuffix>
-    </filetemplates>
-  </cppsupportpart>
-  <kdevdocumentation>
-    <projectdoc>
-      <docsystem/>
-      <docurl/>
-      <usermanualurl/>
-    </projectdoc>
-  </kdevdocumentation>
-</kdevelop>
diff --git a/x2goclient.kdevelop.pcs b/x2goclient.kdevelop.pcs
deleted file mode 100644
index 1621e1a..0000000
Binary files a/x2goclient.kdevelop.pcs and /dev/null differ
diff --git a/x2goclient.kdevses b/x2goclient.kdevses
deleted file mode 100644
index 568af31..0000000
--- a/x2goclient.kdevses
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version = '1.0' encoding = 'UTF-8'?>
-<!DOCTYPE KDevPrjSession>
-<KDevPrjSession>
- <DocsAndViews NumberOfDocuments="3" >
-  <Doc0 NumberOfViews="1" URL="file:///usr/src.cur/db-builds/x2goclient/x2goclient-3.01/sshmasterconnection.cpp" >
-   <View0 Encoding="" Type="Source" />
-  </Doc0>
-  <Doc1 NumberOfViews="1" URL="file:///usr/src.cur/db-builds/x2goclient/x2goclient-3.01/onmainwindow.cpp" >
-   <View0 Encoding="UTF-8" line="447" Type="Source" />
-  </Doc1>
-  <Doc2 NumberOfViews="1" URL="file:///usr/share/doc/qt4-doc/html/qx11embedcontainer.html#embedClient" >
-   <View0 Type="Documentation" />
-  </Doc2>
- </DocsAndViews>
- <pluginList>
-  <kdevdebugger>
-   <breakpointList/>
-   <showInternalCommands value="0" />
-  </kdevdebugger>
-  <kdevastyle>
-   <Extensions ext="*.cpp *.h,*.c *.h,*.cxx *.hxx,*.c++ *.h++,*.cc *.hh,*.C *.H,*.diff,*.inl,*.java,*.moc,*.patch,*.tlh,*.xpm" />
-   <AStyle IndentPreprocessors="0" FillCount="4" PadParenthesesOut="1" IndentNamespaces="1" IndentLabels="1" Fill="Tabs" MaxStatement="40" Brackets="Break" MinConditional="-1" IndentBrackets="0" PadParenthesesUn="1" BlockBreak="0" KeepStatements="1" KeepBlocks="1" BlockIfElse="0" IndentSwitches="1" PadOperators="0" FStyle="UserDefined" IndentCases="0" FillEmptyLines="0" BracketsCloseHeaders="0" BlockBreakAll="0" PadParenthesesIn="1" IndentClasses="1" IndentBlocks="0" FillForce="0" />
-  </kdevastyle>
-  <kdevbookmarks>
-   <bookmarks/>
-  </kdevbookmarks>
-  <kdevvalgrind>
-   <executable path="" params="" />
-   <valgrind path="" params="" />
-   <calltree path="" params="" />
-   <kcachegrind path="" />
-  </kdevvalgrind>
- </pluginList>
-</KDevPrjSession>
diff --git a/x2goclient.pro b/x2goclient.pro
index 6e6eb9f..6393fcf 100644
--- a/x2goclient.pro
+++ b/x2goclient.pro
@@ -7,9 +7,10 @@
 
 
 CONFIG += $$(X2GO_CLIENT_TARGET)
+CONFIG += $$(X2GO_LINUX_STATIC)
+#CONFIG += console
 
-
-FORMS += cupsprintsettingsdialog.ui cupsprintwidget.ui printdialog.ui printercmddialog.ui printwidget.ui xsettingsui.ui
+FORMS += cupsprintsettingsdialog.ui cupsprintwidget.ui printdialog.ui printercmddialog.ui printwidget.ui xsettingsui.ui brokerpassdialog.ui
 
 TRANSLATIONS += x2goclient_de.ts 
 TRANSLATIONS += x2goclient_ru.ts 
@@ -46,6 +47,7 @@ HEADERS += configdialog.h \
  ongetpass.h \
  onmainwindow_privat.h \
  x2gosettings.h \
+ brokerpassdlg.h \
  xsettingswidget.h
 
 SOURCES += sharewidget.cpp \
@@ -81,8 +83,11 @@ SOURCES += sharewidget.cpp \
  httpbrokerclient.cpp \
  ongetpass.cpp \
  x2gosettings.cpp \
+ brokerpassdlg.cpp \
  xsettingswidget.cpp
 
+LIBS += -lssh
+
 plugin {
 TARGET = x2goplugin
 }
@@ -107,6 +112,13 @@ linux-g++-64 {
     message(building $$TARGET with ldap and cups)
     LIBS += -lldap -lcups -lX11
 }
+x2go_linux_static {
+    message (linking all libs statically)
+    LIBS -= -lssh
+    LIBS += -lssh_static -lssl
+    QMAKE_LFLAGS = -Bstatic $$QMAKE_LFLAGS
+}
+
 macx {
     message(building $$TARGET with ldap and cups)
     LIBS += -lldap -lcups
@@ -116,7 +128,6 @@ win32-* {
     LIBS += -lwinspool
     CONFIG += static
 }
-LIBS += -lssh
 QT += svg network
 ICON =icons/x2go-mac.icns
 QMAKE_MAC_SDK =/Developer/SDKs/MacOSX10.6.sdk
diff --git a/x2goclientconfig.h b/x2goclientconfig.h
index 0e4983a..48a8992 100644
--- a/x2goclientconfig.h
+++ b/x2goclientconfig.h
@@ -6,7 +6,7 @@
 #include <qglobal.h>
 
 
-//#define LOGFILE QDir::homePath()+"/x2goclient.log"
+// #define LOGFILE QDir::homePath()+"/x2goclient.log"
 
 #if !defined Q_OS_WIN
 #define USELDAP
diff --git a/x2goplugin.rc b/x2goplugin.rc
index 7f5aa21..2d2b352 100644
--- a/x2goplugin.rc
+++ b/x2goplugin.rc
@@ -1,8 +1,8 @@
 1 TYPELIB "x2goplugin.rc"
 
 1 VERSIONINFO
- FILEVERSION 3,0,1,18
- PRODUCTVERSION 3,0,1,18
+ FILEVERSION 3,99,0,0
+ PRODUCTVERSION 3,99,0,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -21,13 +21,13 @@ BEGIN
             VALUE "FileDescription", "Allows you to start X2Go session in a webbrowser\0"
 	    VALUE "FileExtents", "x2go\0"
 	    VALUE "FileOpenName", "Configuration File for X2Go Session (*.x2go)\0"
-            VALUE "FileVersion", "3, 0, 1, 18\0"
+            VALUE "FileVersion", "3, 99, 0 ,0\0"
             VALUE "InternalName", "x2goplugin\0"
             VALUE "LegalCopyright", "Copyright © 2010 Obviously Nice\0"
 	    VALUE "MIMEType", "application/x2go\0"
             VALUE "OriginalFilename", "npx2goplugin.dll\0"
-            VALUE "ProductName", "X2GoClient Plug-in 3.0.1.18\0"
-            VALUE "ProductVersion", "3, 0, 1, 18\0"
+            VALUE "ProductName", "X2GoClient Plug-in 3.99.0.0\0"
+            VALUE "ProductVersion", "3, 99, 0, 0\0"
         END
     END
     BLOCK "VarFileInfo"
diff --git a/x2gosettings.cpp b/x2gosettings.cpp
index 9a5f59b..57fbc4a 100644
--- a/x2gosettings.cpp
+++ b/x2gosettings.cpp
@@ -13,30 +13,44 @@
 #include "x2goclientconfig.h"
 #include "x2gologdebug.h"
 #include "onmainwindow.h"
+#include <QTemporaryFile>
+
+X2goSettings::X2goSettings(QString fileContent, QSettings::Format format)
+{
+    cfgFile=new QTemporaryFile();
+    cfgFile->open();
+    QTextStream out(cfgFile);
+    out<<fileContent;
+    cfgFile->close();
+    set=new QSettings ( cfgFile->fileName(),
+                        format );
+}
+
 
 X2goSettings::X2goSettings ( QString group )
 {
+    cfgFile=0l;
 #ifndef Q_OS_WIN
-	set=new QSettings ( ONMainWindow::getHomeDirectory() +
-	                    "/.x2goclient/"+group,
-	                    QSettings::NativeFormat );
+    set=new QSettings ( ONMainWindow::getHomeDirectory() +
+                        "/.x2goclient/"+group,
+                        QSettings::NativeFormat );
 #else
-	if ( !ONMainWindow::getPortable() )
-	{
-		set=new QSettings ( "Obviously Nice","x2goclient" );
-		set->beginGroup ( group );
+    if ( !ONMainWindow::getPortable() )
+    {
+        set=new QSettings ( "Obviously Nice","x2goclient" );
+        set->beginGroup ( group );
 // 		x2goDebug<<"settings in reg";
-	}
-	else
-	{
-		set=new QSettings ( ONMainWindow::getHomeDirectory() +
-		                    "/.x2goclient/"+group,
-		                    QSettings::IniFormat );
+    }
+    else
+    {
+        set=new QSettings ( ONMainWindow::getHomeDirectory() +
+                            "/.x2goclient/"+group,
+                            QSettings::IniFormat );
 // 		x2goDebug<<"settings in ini:"<<
-		ONMainWindow::getHomeDirectory() +
-		"/.x2goclient/"+group;
+        ONMainWindow::getHomeDirectory() +
+        "/.x2goclient/"+group;
 
-	}
+    }
 #endif
 
 }
@@ -44,7 +58,9 @@ X2goSettings::X2goSettings ( QString group )
 
 X2goSettings::~X2goSettings()
 {
-	delete set;
+    delete set;
+    if (cfgFile)
+        delete cfgFile;
 }
 
 
diff --git a/x2gosettings.h b/x2gosettings.h
index c59ecd1..fffd350 100644
--- a/x2gosettings.h
+++ b/x2gosettings.h
@@ -16,7 +16,7 @@
 
 #include <QSettings>
 
-
+class QTemporaryFile;
 /**
 	@author Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
 */
@@ -24,6 +24,7 @@ class X2goSettings
 {
 public:
     X2goSettings ( QString group );
+    X2goSettings ( QString fileContent, QSettings::Format format);
     ~X2goSettings();
 
     QSettings* setting()
@@ -33,6 +34,7 @@ public:
 
 private:
     QSettings* set;
+    QTemporaryFile* cfgFile;
 
 };
 
diff --git a/xsettingsui.ui b/xsettingsui.ui
index 43d6d61..fa06cbf 100644
--- a/xsettingsui.ui
+++ b/xsettingsui.ui
@@ -47,7 +47,7 @@
    <item>
     <widget class="QRadioButton" name="rbXming">
      <property name="text">
-      <string>use integrated XMing</string>
+      <string>use integrated X-Server</string>
      </property>
      <property name="checked">
       <bool>true</bool>
@@ -158,33 +158,6 @@
         </layout>
        </widget>
       </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_3">
-        <item>
-         <widget class="QLabel" name="label_6">
-          <property name="text">
-           <string>delay after X-Server start (s):</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QSpinBox" name="spDelay"/>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </item>
      </layout>
     </widget>
    </item>
diff --git a/xsettingswidget.cpp b/xsettingswidget.cpp
index 3991552..7cd117b 100644
--- a/xsettingswidget.cpp
+++ b/xsettingswidget.cpp
@@ -26,8 +26,8 @@ XSettingsWidget::XSettingsWidget(QWidget* parent)
     setupUi(this);
 
     X2goSettings st ( "settings" );
-    rbXming->setChecked(st.setting()->value("usexming",true).toBool());
-    rbOther->setChecked(!(st.setting()->value("usexming",true).toBool()));
+    rbXming->setChecked(st.setting()->value("useintx",true).toBool());
+    rbOther->setChecked(!(st.setting()->value("useintx",true).toBool()));
     leExec->setText(st.setting()->value("xexec","C:\\program files\\vcxsrv\\vcxsrv.exe").toString());
     leCmdOptions->setText(st.setting()->value("options","-multiwindow -notrayicon -clipboard").toString());
 
@@ -37,7 +37,7 @@ XSettingsWidget::XSettingsWidget(QWidget* parent)
     leWinMod->setText(st.setting()->value("optionswin","-screen 0 %wx%h -notrayicon -clipboard").toString());
     leFSMod->setText(st.setting()->value("optionsfs","-fullscreen -notrayicon -clipboard").toString());
     leSingApp->setText(st.setting()->value("optionssingle","-multiwindow -notrayicon -clipboard").toString());
-    spDelay->setValue(st.setting()->value("delay",3).toInt());
+//     spDelay->setValue(st.setting()->value("delay",3).toInt());
     pbExec->setIcon( QPixmap ( ":/icons/16x16/file-open.png" ) );
 }
 
@@ -58,21 +58,21 @@ void XSettingsWidget::slotSetExecutable()
 
 void XSettingsWidget::setDefaults()
 {
-    rbXming->setChecked("usexming");
+    rbXming->setChecked(true);
     leExec->setText("C:\\program files\\vcxsrv\\vcxsrv.exe");
     leCmdOptions->setText("-multiwindow -notrayicon -clipboard");
     cbOnstart->setChecked(true);
     leWinMod->setText("-screen 0 %wx%h -notrayicon -clipboard");
     leFSMod->setText("-fullscreen -notrayicon -clipboard");
     leSingApp->setText("-multiwindow -notrayicon -clipboard");
-    spDelay->setValue(3);
+//     spDelay->setValue(3);
   
 }
 
 void XSettingsWidget::saveSettings()
 {
     X2goSettings st ( "settings" );
-    st.setting()->setValue("usexming",rbXming->isChecked());
+    st.setting()->setValue("useintx",rbXming->isChecked());
     st.setting()->setValue("xexec",leExec->text());
     st.setting()->setValue("options",leCmdOptions->text());
     st.setting()->setValue("onstart",cbOnstart->isChecked());
@@ -80,7 +80,7 @@ void XSettingsWidget::saveSettings()
     st.setting()->setValue("optionswin",leWinMod->text());
     st.setting()->setValue("optionsfs",leFSMod->text());    
     st.setting()->setValue("optionssingle",leSingApp->text());
-    st.setting()->setValue("delay",spDelay->value());
+//     st.setting()->setValue("delay",spDelay->value());
     st.setting()->sync();
 }
 


hooks/post-receive
-- 
x2goclient.git (X2go Client)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2goclient.git" (X2go Client).




More information about the x2go-commits mailing list