[X2go-Commits] x2goclient.git - master (branch) updated: 3.99.2.2-8-gb9e0f34

X2Go dev team git-admin at x2go.org
Tue Sep 4 12:14:49 CEST 2012


The branch, master has been updated
       via  b9e0f3498b4b681341f6bb4bfad28a64d2afee37 (commit)
      from  4adfcbf0aa5f34283089786032b47727530e5d78 (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 -----------------------------------------------------------------
commit b9e0f3498b4b681341f6bb4bfad28a64d2afee37
Author: Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
Date:   Tue Sep 4 12:14:43 2012 +0200

    Implement direct RDP connection using standalone client

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog   |    5 +-
 onmainwindow.cpp   |  139 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 onmainwindow.h     |    2 +
 sessionbutton.cpp  |   35 +++++++++++--
 settingswidget.cpp |    2 +-
 5 files changed, 173 insertions(+), 10 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 753b008..3dfcf1d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-x2goclient (3.99.2.3-0~x2go2) UNRELEASED; urgency=low
+x2goclient (3.99.2.3-0~x2go3) UNRELEASED; urgency=low
 
   [ Mike Gabriel ]
   * New upstream version (3.99.2.2):
@@ -10,8 +10,9 @@ x2goclient (3.99.2.3-0~x2go2) UNRELEASED; urgency=low
 
   [ Oleksandr Shneyder ]
   * Add settings for direct RDP connection 
+  * Implement direct RDP connection using standalone client
 
- -- Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>  Thu, 30 Aug 2012 18:10:57 +0300
+ -- Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>  Tue, 04 Sep 2012 12:13:43 +0200
 
 x2goclient (3.99.2.2-0~x2go2) unstable; urgency=low
 
diff --git a/onmainwindow.cpp b/onmainwindow.cpp
index 1bded10..7294d56 100644
--- a/onmainwindow.cpp
+++ b/onmainwindow.cpp
@@ -2950,6 +2950,7 @@ void ONMainWindow::slotSshUserAuthError ( QString error )
 
 void ONMainWindow::slotSessEnter()
 {
+
     if ( useLdap )
     {
         slotPassEnter();
@@ -3005,10 +3006,102 @@ void ONMainWindow::continueLDAPSession()
     proc->startNormal ( "x2gogetservers" );
 }
 
+void ONMainWindow::startDirectRDP()
+{
+
+    X2goSettings st ( "sessions" );
+    QString sid;
+    if ( !embedMode )
+        sid=lastSession->id();
+    else
+        sid="embedded";
+
+
+    bool fullscreen=st.setting()->value ( sid+"/fullscreen",
+                                          ( QVariant )
+                                          defaultFullscreen ).toBool();
+    bool maxRes=st.setting()->value ( sid+"/maxdim",
+                                      ( QVariant )
+                                      false ).toBool();
+    int height=st.setting()->value ( sid+"/height",
+                                     ( QVariant ) defaultHeight ).toInt();
+    int width=st.setting()->value ( sid+"/width",
+                                    ( QVariant ) defaultWidth ).toInt();
+
+    QString client=st.setting()->value ( sid+"/rdpclient",
+                                         ( QVariant ) "rdesktop").toString();
+    QString host=st.setting()->value ( sid+"/host",
+                                       ( QVariant ) "").toString();
+    QString port=st.setting()->value ( sid+"/rdpport",
+                                       ( QVariant ) "3389").toString();
+    QString params=st.setting()->value ( sid+"/directrdpsettings",
+                                         ( QVariant ) "").toString();
+    QString user=login->text();
+    QString password=pass->text();
+
+    nxproxy=new QProcess;
+    connect ( nxproxy,SIGNAL ( error ( QProcess::ProcessError ) ),this,
+              SLOT ( slotProxyError ( QProcess::ProcessError ) ) );
+    connect ( nxproxy,SIGNAL ( finished ( int,QProcess::ExitStatus ) ),this,
+              SLOT ( slotProxyFinished ( int,QProcess::ExitStatus ) ) );
+    connect ( nxproxy,SIGNAL ( readyReadStandardError() ),this,
+              SLOT ( slotProxyStderr() ) );
+    connect ( nxproxy,SIGNAL ( readyReadStandardOutput() ),this,
+              SLOT ( slotProxyStdout() ) );
+
+
+    QString userOpt;
+    if (user.length()>0)
+    {
+        userOpt=" -u ";
+        userOpt+=user+" ";
+    }
+
+    QString passOpt;
+    if (password.length()>0)
+    {
+        passOpt=" -p \"";
+        passOpt+=password+"\" ";
+    }
+
+    QString grOpt;
+
+    if (fullscreen)
+    {
+        grOpt=" -f ";
+    }
+    else if (maxRes)
+    {
+        QDesktopWidget wd;
+        grOpt=" -D -g "+QString::number( wd.screenGeometry().width())+"x"+QString::number(wd.screenGeometry().height())+" ";
+    }
+    else
+    {
+        grOpt=" -g "+QString::number(width)+"x"+QString::number(height);
+    }
+
+    QString proxyCmd=client +" "+params+ grOpt +userOpt+passOpt + host +":"+port ;
+    nxproxy->start ( proxyCmd );
+
+    resumingSession.display="RDP";
+    resumingSession.server=host;
+    resumingSession.sessionId=lastSession->name();
+    resumingSession.crTime=QDateTime::currentDateTime().toString("dd.MM.yy HH:mm:ss");
+
+    showSessionStatus();
+//     QTimer::singleShot ( 30000,this,SLOT ( slotRestartProxy() ) );
+
+}
+
+
+
+
+
 
 bool ONMainWindow::startSession ( const QString& sid )
 {
     setEnabled ( false );
+    directRDP=false;
     QString passwd;
     QString user;
     QString host;
@@ -3040,6 +3133,13 @@ bool ONMainWindow::startSession ( const QString& sid )
                                         ( QVariant ) false ).toBool();
         krblogin=st.setting()->value ( sid+"/krblogin",
                                        ( QVariant ) false ).toBool();
+        directRDP=st.setting()->value ( sid+"/directrdp",
+                                        ( QVariant ) false ).toBool();
+        if (cmd =="RDP" && directRDP)
+        {
+            startDirectRDP();
+            return true;
+        }
         if ( cmd=="SHADOW" )
             shadowSession=true;
     }
@@ -4021,6 +4121,12 @@ void ONMainWindow::slotResumeSess()
 void ONMainWindow::slotSuspendSess()
 {
 
+    if (directRDP)
+    {
+        nxproxy->terminate();
+        return;
+    }
+
     QString passwd;
     QString user=getCurrentUname();
 
@@ -4069,6 +4175,12 @@ void ONMainWindow::slotSuspendSess()
 
 void ONMainWindow::slotSuspendSessFromSt()
 {
+    x2goDebug<<"suspend from st";
+    if (directRDP)
+    {
+        nxproxy->terminate();
+        return;
+    }
     QString passwd;
     QString user=getCurrentUname();
     passwd=getCurrentPass();
@@ -4085,7 +4197,12 @@ void ONMainWindow::slotSuspendSessFromSt()
 
 void ONMainWindow::slotTermSessFromSt()
 {
-
+    x2goDebug<<"term from st";
+    if (directRDP)
+    {
+        nxproxy->terminate();
+        return;
+    }
     /*	x2goDebug <<"disconnect export"<<endl;
     	disconnect ( sbExp,SIGNAL ( clicked() ),this,
     	             SLOT ( slot_exportDirectory() ) );*/
@@ -4147,6 +4264,13 @@ void ONMainWindow::slotRetSuspSess ( bool result, QString output,
 void ONMainWindow::slotTermSess()
 {
 
+    if (directRDP)
+    {
+        nxproxy->terminate();
+        return;
+    }
+
+
     selectSessionDlg->setEnabled ( false );
 
 
@@ -4950,7 +5074,10 @@ void ONMainWindow::slotProxyFinished ( int,QProcess::ExitStatus )
             }
         }
         x2goDebug<<"nxproxy not running"<<endl;
-        delete nxproxy;
+        if (!directRDP)
+            delete nxproxy;
+        else
+            nxproxy=0;
     }
 #endif
     x2goDebug<<"proxy deleted"<<endl;
@@ -4960,6 +5087,14 @@ void ONMainWindow::slotProxyFinished ( int,QProcess::ExitStatus )
     nxproxy=0l;
     proxyWinId=0;
 
+    if (directRDP)
+    {
+        pass->setText ( "" );
+        QTimer::singleShot ( 2000,this,
+                             SLOT ( slotShowPassForm() ) );
+        return;
+    }
+
     if ( !shadowSession && !usePGPCard && ! ( embedMode &&
             ( config.checkexitstatus==false ) ) )
         check_cmd_status();
diff --git a/onmainwindow.h b/onmainwindow.h
index 2d75273..2fadcfd 100644
--- a/onmainwindow.h
+++ b/onmainwindow.h
@@ -670,6 +670,7 @@ private:
     bool ldapOnly;
     bool isScDaemonOk;
     bool parecTunnelOk;
+    bool directRDP;
 
 
     bool startSessSound;
@@ -1027,6 +1028,7 @@ private:
     void printSshDError();
     void loadPulseModuleNativeProtocol();
     void initEmbedToolBar();
+    void startDirectRDP();
     bool isServerRunning ( int port );
     void filterDesktops ( const QString& filter,
                           bool strict=false );
diff --git a/sessionbutton.cpp b/sessionbutton.cpp
index f53d82a..4ece426 100644
--- a/sessionbutton.cpp
+++ b/sessionbutton.cpp
@@ -345,6 +345,7 @@ void SessionButton::redraw()
 
     cmdBox->addItems ( par->transApplicationsNames() );
 
+    bool directRDP=false;
     QPixmap cmdpix;
     if ( command=="KDE" )
     {
@@ -374,6 +375,9 @@ void SessionButton::redraw()
     }
     else if ( command =="RDP" )
     {
+        if (st->setting()->value ( sid+"/directrdp",
+                                   ( QVariant ) false ).toBool())
+            directRDP=true;
         cmdpix.load ( par->iconsPath ( "/16x16/rdp.png" ) );
         cmdBox->setCurrentIndex ( RDP );
         command=tr ( "RDP connection" );
@@ -413,10 +417,11 @@ void SessionButton::redraw()
     geomBox->clear();
     geomBox->addItem ( tr ( "fullscreen" ) );
     uint displays=QApplication::desktop()->numScreens();
-    for (uint i=0;i<displays;++i)
-    {
-        geomBox->addItem ( tr( "Display " )+QString::number(i+1));
-    }
+    if (!directRDP)
+        for (uint i=0;i<displays;++i)
+        {
+            geomBox->addItem ( tr( "Display " )+QString::number(i+1));
+        }
 #ifndef Q_WS_HILDON
     geomBox->addItem ( "1440x900" );
     geomBox->addItem ( "1280x1024" );
@@ -432,7 +437,7 @@ void SessionButton::redraw()
     }
     else
         if (st->setting()->value ( sid+"/multidisp",
-                                   ( QVariant ) false ).toBool())
+                                   ( QVariant ) false ).toBool() && !directRDP)
         {
             uint disp=st->setting()->value ( sid+"/display",
                                              ( QVariant ) 1 ).toUInt();
@@ -468,6 +473,17 @@ void SessionButton::redraw()
 #endif
         }
 
+    if (directRDP)
+    {
+        geomBox->addItem ( tr("Maximum") );
+        if (st->setting()->value ( sid+"/maxdim",
+                                   ( QVariant ) false ).toBool())
+        {
+            geom->setText ( tr("Maximum") );
+            geomBox->setCurrentIndex ( geomBox->findText ( tr("Maximum") ));
+        }
+    }
+
 
     snd=st->setting()->value ( sid+"/sound", ( QVariant ) true ).toBool();
     if ( snd )
@@ -710,6 +726,13 @@ void SessionButton::slot_geom_change ( const QString& new_g )
     {
         st.setting()->setValue ( sid+"/fullscreen", ( QVariant ) true );
         st.setting()->setValue ( sid+"/multidisp", ( QVariant ) false );
+        st.setting()->setValue ( sid+"/maxdim", ( QVariant ) false );
+    }
+    else if ( new_g==tr ( "Maximum" ))
+    {
+        st.setting()->setValue ( sid+"/fullscreen", ( QVariant ) false );
+        st.setting()->setValue ( sid+"/multidisp", ( QVariant ) false );
+        st.setting()->setValue ( sid+"/maxdim", ( QVariant ) true );
     }
     else
         if (new_g.indexOf(tr("Display "))==0)
@@ -719,6 +742,7 @@ void SessionButton::slot_geom_change ( const QString& new_g )
             st.setting()->setValue ( sid+"/multidisp", ( QVariant ) true );
             st.setting()->setValue ( sid+"/display", ( QVariant ) g.toUInt());
             st.setting()->setValue ( sid+"/fullscreen", ( QVariant ) false );
+            st.setting()->setValue ( sid+"/maxdim", ( QVariant ) false );
         }
         else
         {
@@ -728,6 +752,7 @@ void SessionButton::slot_geom_change ( const QString& new_g )
 #endif
             st.setting()->setValue ( sid+"/fullscreen", ( QVariant ) false );
             st.setting()->setValue ( sid+"/multidisp", ( QVariant ) false );
+            st.setting()->setValue ( sid+"/maxdim", ( QVariant ) false );
             QStringList lst=new_geom.split ( 'x' );
             st.setting()->setValue ( sid+"/width", ( QVariant ) lst[0] );
             st.setting()->setValue ( sid+"/height", ( QVariant ) lst[1] );
diff --git a/settingswidget.cpp b/settingswidget.cpp
index 5439059..2529a76 100644
--- a/settingswidget.cpp
+++ b/settingswidget.cpp
@@ -739,7 +739,7 @@ void SettingsWidget::updateCmdLine()
     }
     if (maxRes->isChecked())
     {
-        grOpt=" -g <maxW>x<maxH>";
+        grOpt=" -D -g <maxW>x<maxH>";
     }
     if (custom->isChecked())
     {


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