This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch release/4.1.0.1 in repository x2goclient.
commit 77b0859e8819e38d993f1eb232a37dd2c81ecc47 Author: Oleksandr Shneyder <o.shney...@phoca-gmbh.de> Date: Fri Feb 24 16:46:58 2017 +0100 - Add "direct XDMCP" functionality. --- debian/changelog | 4 +- src/editconnectiondialog.cpp | 6 +-- src/editconnectiondialog.h | 2 +- src/onmainwindow.cpp | 85 ++++++++++++++++++++++++++++++++++- src/sessionwidget.cpp | 41 ++++++++++++++--- src/sessionwidget.h | 3 +- src/settingswidget.cpp | 104 ++++++++++++++++++++++++++++++++++++++++++- src/settingswidget.h | 8 +++- 8 files changed, 237 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index 605a504..43c1ff1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - * Continue development + [ Oleksandr Shneyder ] + * New upstream version (4.1.0.1): + - Add "direct XDMCP" functionality. -- X2Go Release Manager <git-ad...@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/editconnectiondialog.cpp b/src/editconnectiondialog.cpp index d5eb063..df3fe26 100644 --- a/src/editconnectiondialog.cpp +++ b/src/editconnectiondialog.cpp @@ -85,7 +85,7 @@ EditConnectionDialog::EditConnectionDialog ( bool newSession, QString id, QWidge connect ( sessSet,SIGNAL ( nameChanged ( const QString & ) ),this, SLOT ( slot_changeCaption ( const QString& ) ) ); connect ( this,SIGNAL ( accepted() ),this,SLOT ( slot_accepted() ) ); - connect (sessSet, SIGNAL(directRDP(bool)), this, SLOT(slot_directRDP(bool))); + connect (sessSet, SIGNAL(directRDP(bool,bool)), this, SLOT(slot_directRDP(bool,bool))); connect (sessSet, SIGNAL(settingsChanged(QString,QString,QString)), otherSet, @@ -170,11 +170,11 @@ void EditConnectionDialog::slot_default() } #ifdef Q_OS_LINUX -void EditConnectionDialog::slot_directRDP(bool direct) +void EditConnectionDialog::slot_directRDP(bool direct, bool isXDMCP) { fr->setTabEnabled(1,!direct); fr->setTabEnabled(3,!direct); fr->setTabEnabled(4,!direct); - otherSet->setDirectRdp(direct); + otherSet->setDirectRdp(direct, isXDMCP); } #endif diff --git a/src/editconnectiondialog.h b/src/editconnectiondialog.h index 393390f..05a3a9e 100644 --- a/src/editconnectiondialog.h +++ b/src/editconnectiondialog.h @@ -65,7 +65,7 @@ private slots: void slot_accepted(); void slot_default(); #ifdef Q_OS_LINUX - void slot_directRDP(bool direct); + void slot_directRDP(bool direct, bool isXDMCP); #endif }; diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 604d25d..279800c 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -3235,7 +3235,7 @@ void ONMainWindow::slotSessEnter() QString sid=sessionExplorer->getLastSession()->id(); QString cmd=st->setting()->value ( sid+"/command", ( QVariant ) QString::null ).toString(); - bool directRDP=(st->setting()->value ( sid+"/directrdp", + directRDP=(st->setting()->value ( sid+"/directrdp", ( QVariant ) false ).toBool() && cmd == "RDP"); if (cmd =="RDP" && directRDP) @@ -3244,6 +3244,16 @@ void ONMainWindow::slotSessEnter() startSession ( sid ); return; } + + directRDP=(st->setting()->value ( sid+"/directxdmcp", + ( QVariant ) false ).toBool() && cmd == "RDP"); + + if (cmd =="XDMCP" && directRDP) + { + x2goDebug<<"Starting direct RDP Session from broker"; + startSession ( sid ); + return; + } #endif broker->selectUserSession(sessionExplorer->getLastSession()->id()); config.session=sessionExplorer->getLastSession()->id(); @@ -3313,6 +3323,8 @@ void ONMainWindow::startDirectRDP() ( QVariant ) defaultHeight ).toInt(); int width=st->setting()->value ( sid+"/width", ( QVariant ) defaultWidth ).toInt(); + QString sessionType=st->setting()->value ( sid+"/command", + ( QVariant ) "").toString(); QString client=st->setting()->value ( sid+"/rdpclient", ( QVariant ) "rdesktop").toString(); @@ -3410,6 +3422,58 @@ void ONMainWindow::startDirectRDP() } proxyCmd= client +" "+params+ grOpt +userOpt+passOpt + "/v:"+host +":"+port ; } + if(sessionType=="XDMCP") + { + x2goDebug<<"starting direct XDMCP session"; + client=st->setting()->value ( sid+"/xdmcpclient", + ( QVariant ) "Xnest").toString(); + params=st->setting()->value ( sid+"/directxdmcpsettings", + ( QVariant ) "").toString(); + if(client == "Xephyr") + { + if (fullscreen) + { + grOpt=" -fullscreen "; + } + else if (maxRes) + { + QDesktopWidget wd; + grOpt=" -screen "+QString::number( wd.screenGeometry().width())+"x"+QString::number(wd.screenGeometry().height())+" "; + } + else + { + grOpt=" -screen "+QString::number(width)+"x"+QString::number(height); + } + } + else + { + if (maxRes) + { + QDesktopWidget wd; + grOpt=" -geometry "+QString::number( wd.screenGeometry().width())+"x"+QString::number(wd.screenGeometry().height())+" "; + } + else + { + grOpt=" -geometry "+QString::number(width)+"x"+QString::number(height); + } + } + int p=0; + while(true) + { + QString fname="/tmp/.X"+QString::number(p)+"-lock"; + if(QFile::exists(fname)) + { + ++p; + } + else + break; + } + proxyCmd= client +" "+params+ grOpt + " -query "+host +" :"+QString::number(p) ; + } + else + { + x2goDebug<<"starting direct RDP session"; + } // x2goDebug<<"starting direct session with cmd:"<<proxyCmd; nxproxy->start ( proxyCmd ); resumingSession.display="RDP"; @@ -3536,6 +3600,16 @@ bool ONMainWindow::startSession ( const QString& sid ) startDirectRDP(); return true; } + + directRDP=(st->setting()->value ( sid+"/directxdmcp", + ( QVariant ) false ).toBool() && cmd == "XDMCP"); + + + if (cmd =="XDMCP" && directRDP) + { + startDirectRDP(); + return true; + } #endif if ( cmd=="SHADOW" ) shadowSession=true; @@ -5866,8 +5940,15 @@ void ONMainWindow::handle_xmodmap_error (QProcess &proc) { } #endif -void ONMainWindow::slotProxyError ( QProcess::ProcessError ) +void ONMainWindow::slotProxyError ( QProcess::ProcessError err ) { + if(err==QProcess::FailedToStart && directRDP) + { + QString main_text = tr("Failed to start RDP or XMDCP client"); + QString informative_text = tr ("Check session settings and ensure that selected client is installed on your system."); + + show_RichText_ErrorMsgBox (main_text, informative_text); + } slotProxyFinished ( -1,QProcess::CrashExit ); } diff --git a/src/sessionwidget.cpp b/src/sessionwidget.cpp index 9fd2781..686c3cb 100644 --- a/src/sessionwidget.cpp +++ b/src/sessionwidget.cpp @@ -114,7 +114,8 @@ SessionWidget::SessionWidget ( bool newSession, QString id, ONMainWindow * mw, QVBoxLayout *slLay =new QVBoxLayout(); QVBoxLayout *elLay =new QVBoxLayout(); slLay->addWidget ( new QLabel ( tr ( "Host:" ),sgb ) ); - slLay->addWidget ( new QLabel ( tr ( "Login:" ),sgb ) ); + lLogin= new QLabel ( tr ( "Login:" ),sgb ); + slLay->addWidget (lLogin ); lPort=new QLabel ( tr ( "SSH port:" ),sgb ); slLay->addWidget ( lPort ); elLay->addWidget ( server ); @@ -369,6 +370,16 @@ void SessionWidget::slot_proxyType() void SessionWidget::slot_rdpDirectClicked() { bool isDirectRDP=cbDirectRDP->isChecked(); + bool isXDMCP=false; + if(sessBox->currentText()== tr("XDMCP")) + { + cbDirectRDP->setText( tr("Direct XDMCP connection")); + isXDMCP=true; + } + else + { + cbDirectRDP->setText( tr("Direct RDP connection")); + } if (cbDirectRDP->isHidden()) isDirectRDP=false; pbAdvanced->setVisible((!isDirectRDP) && (sessBox->currentIndex()==RDP)); @@ -379,7 +390,9 @@ void SessionWidget::slot_rdpDirectClicked() lKey->setVisible(!isDirectRDP); openKey->setVisible(!isDirectRDP); sshPort->setVisible(!isDirectRDP); - rdpPort->setVisible(isDirectRDP); + rdpPort->setVisible(isDirectRDP && (!isXDMCP)); + lPort->setVisible(!(isDirectRDP && isXDMCP)); + cbKrbDelegation->setVisible(!isDirectRDP); cbKrbLogin->setVisible(!isDirectRDP); @@ -394,8 +407,11 @@ void SessionWidget::slot_rdpDirectClicked() { lPort->setText(tr("SSH port:")); } + lLogin->setVisible(!(isXDMCP&&isDirectRDP)); + uname->setVisible(!(isXDMCP&&isDirectRDP)); + - emit directRDP(isDirectRDP); + emit directRDP(isDirectRDP, isXDMCP); slot_emitSettings(); } #endif @@ -498,6 +514,10 @@ void SessionWidget::slot_changeCmd ( int var ) { leCmdIp->setText ( tr ( "XDMCP server:" ) ); cmd->setText ( xdmcpServer ); +#ifdef Q_OS_LINUX + cbDirectRDP->show(); + cbDirectRDP->setText(tr ("direct XDMCP connection")); +#endif } } else @@ -670,8 +690,14 @@ void SessionWidget::readConfig() xdmcpServer=st.setting()->value ( sessionId+"/xdmcpserver", ( QVariant ) "localhost" ).toString().trimmed(); #ifdef Q_OS_LINUX - cbDirectRDP->setChecked(st.setting()->value ( - sessionId+"/directrdp",false ).toBool()); + if(st.setting()->value (sessionId+"/directrdp",false ).toBool()) + { + cbDirectRDP->setChecked(true); + } + if(st.setting()->value (sessionId+"/directxdmcp",false ).toBool()) + { + cbDirectRDP->setChecked(true); + } #endif for ( int i=0; i<appNames.count(); ++i ) @@ -743,6 +769,10 @@ void SessionWidget::readConfig() sessBox->setCurrentIndex ( XDMCP ); cmd->setEnabled ( true ); cmd->setText ( xdmcpServer ); +#ifdef Q_OS_LINUX + cbDirectRDP->show(); + slot_rdpDirectClicked(); +#endif } else { @@ -838,6 +868,7 @@ void SessionWidget::saveSettings() st.setting()->setValue(sessionId+"/krbdelegation",( QVariant ) cbKrbDelegation->isChecked()); #ifdef Q_OS_LINUX st.setting()->setValue(sessionId+"/directrdp",( QVariant ) cbDirectRDP->isChecked()); + st.setting()->setValue(sessionId+"/directxdmcp",( QVariant ) cbDirectRDP->isChecked()); #endif QString command; bool rootless=false; diff --git a/src/sessionwidget.h b/src/sessionwidget.h index 60ee046..5eda2a1 100644 --- a/src/sessionwidget.h +++ b/src/sessionwidget.h @@ -85,6 +85,7 @@ private: QLabel* lPort; QLabel* lKey; QLabel* lPath; + QLabel* lLogin; QPushButton* pbAdvanced; QString rdpOptions; QString rdpServer; @@ -110,7 +111,7 @@ private: signals: void nameChanged ( const QString & ); #ifdef Q_OS_LINUX - void directRDP(bool); + void directRDP(bool, bool); void settingsChanged(const QString &, const QString &, const QString &); #endif }; diff --git a/src/settingswidget.cpp b/src/settingswidget.cpp index b15836c..9e9d69d 100644 --- a/src/settingswidget.cpp +++ b/src/settingswidget.cpp @@ -228,6 +228,32 @@ SettingsWidget::SettingsWidget ( QString id, ONMainWindow * mw, connect (params, SIGNAL(textChanged(QString)), this, SLOT(updateCmdLine())); connect (width, SIGNAL(valueChanged(int)), this, SLOT(updateCmdLine())); connect (height, SIGNAL(valueChanged(int)), this, SLOT(updateCmdLine())); + + + xdmcpBox=new QGroupBox ( tr ( "XDMCP client" ),this ); + setLay->addWidget ( xdmcpBox ); + rXnest=new QRadioButton ("Xnest",xdmcpBox ); + rXnest->setChecked(true); + rXephyr=new QRadioButton ( "Xephyr",xdmcpBox); + rX2goagent=new QRadioButton ( "x2goagent ",xdmcpBox); + QButtonGroup* rXdmcpClient=new QButtonGroup(xdmcpBox); + rXdmcpClient->addButton ( rXnest ); + rXdmcpClient->addButton ( rXephyr ); + rXdmcpClient->addButton ( rX2goagent ); + rXdmcpClient->setExclusive ( true ); + QGridLayout *xdmcpLay=new QGridLayout(xdmcpBox); + xdmcpLay->addWidget(rXnest,0,0); + xdmcpLay->addWidget(rXephyr,1,0); + xdmcpLay->addWidget(rX2goagent,2,0); + xdmcpLay->addWidget(new QLabel(tr("Additional parameters:")),3,0); + xdmcpLay->addWidget(new QLabel(tr("Command line:")),4,0); + xdmcpCmdLine=new QLineEdit(xdmcpBox); + xdmcpCmdLine->setReadOnly(true); + xdmcpParams=new QLineEdit(xdmcpBox); + xdmcpLay->addWidget(xdmcpCmdLine,4,0,1,2); + xdmcpLay->addWidget(xdmcpParams,3,1); + connect (rXdmcpClient, SIGNAL(buttonClicked(int)), this, SLOT(updateCmdLine())); + connect (xdmcpParams, SIGNAL(textChanged(QString)), this, SLOT(updateCmdLine())); #endif //CFGCLIENT #endif //Q_OS_LINUX #else @@ -276,7 +302,7 @@ void SettingsWidget::slot_kbdClicked() #ifdef Q_OS_LINUX -void SettingsWidget::setDirectRdp(bool direct) +void SettingsWidget::setDirectRdp(bool direct, bool isXDMCP) { clipGr->setVisible(!direct); kgb->setVisible(!direct); @@ -290,7 +316,8 @@ void SettingsWidget::setDirectRdp(bool direct) pbIdentDisp->setVisible(!direct); hLine1->setVisible(!direct); hLine2->setVisible(!direct); - rdpBox->setVisible(direct); + rdpBox->setVisible(direct && !isXDMCP); + xdmcpBox->setVisible(direct && isXDMCP); if (direct) { if (display->isChecked()) @@ -307,6 +334,7 @@ void SettingsWidget::setDirectRdp(bool direct) custom->setChecked(true); } } + updateCmdLine(); } #endif @@ -398,6 +426,15 @@ void SettingsWidget::readConfig() else rXfreeRDPOld->setChecked(true); params->setText(st.setting()->value ( sessionId+"/directrdpsettings","").toString()); + + client=st.setting()->value ( sessionId+"/xdmcpclient","Xnest").toString(); + if(client=="Xnest") + rXnest->setChecked(true); + else if(client=="x2goagent") + rX2goagent->setChecked(true); + else + rXephyr->setChecked(true); + xdmcpParams->setText(st.setting()->value ( sessionId+"/directxdmcpsettings","").toString()); #endif #endif @@ -536,6 +573,25 @@ void SettingsWidget::saveSettings() } st.setting()->setValue ( sessionId+"/directrdpsettings", ( QVariant ) params->text()); + + if (rXnest->isChecked()) + { + st.setting()->setValue ( sessionId+"/xdmcpclient", + ( QVariant ) "Xnest" ); + } + else if (rXephyr->isChecked()) + { + st.setting()->setValue ( sessionId+"/xdmcpclient", + ( QVariant ) "Xephyr" ); + } + else + { + st.setting()->setValue ( sessionId+"/xdmcpclient", + ( QVariant ) "x2goagent" ); + } + st.setting()->setValue ( sessionId+"/directxdmcpsettings", + ( QVariant ) xdmcpParams->text()); + #endif #endif @@ -668,6 +724,50 @@ void SettingsWidget::updateCmdLine() } cmdLine->setText(client +" "+params->text()+ grOpt +userOpt+" /p:<"+tr("password")+"> /v:"+ server+":"+port ); } + fs->setEnabled(true); + if(!rXephyr->isChecked() && !xdmcpBox->isHidden()) + { + fs->setEnabled(false); + if(fs->isChecked()) + { + custom->setChecked(true); + } + } + if(rX2goagent->isChecked()) + { + client="x2goagent"; + } + else + { + client="Xnest"; + } + if (maxRes->isChecked()) + { + grOpt=" -geometry <maxW>x<maxH>"; + } + if (custom->isChecked()) + { + grOpt=" -geometry "+QString::number(width->value())+"x"+QString::number(height->value()); + } + + if(rXephyr->isChecked()) + { + client="Xephyr"; + if (fs->isChecked()) + { + grOpt=" -fullscreen "; + } + if (maxRes->isChecked()) + { + grOpt=" -screen <maxW>x<maxH>"; + } + if (custom->isChecked()) + { + grOpt=" -screen "+QString::number(width->value())+"x"+QString::number(height->value()); + } + } + xdmcpCmdLine->setText(client +" "+xdmcpParams->text()+ grOpt +" -query "+ server+ " :<DISPLAY>"); + #endif } #endif diff --git a/src/settingswidget.h b/src/settingswidget.h index 2ebe51c..01e081b 100644 --- a/src/settingswidget.h +++ b/src/settingswidget.h @@ -44,7 +44,7 @@ public: void setDefaults(); void saveSettings(); #ifdef Q_OS_LINUX - void setDirectRdp(bool direct); + void setDirectRdp(bool direct, bool isXDMCP); public slots: void setServerSettings(QString server, QString port, QString user); void updateCmdLine(); @@ -97,6 +97,12 @@ private: QString server; QString user; QString port; + QGroupBox *xdmcpBox; + QRadioButton* rXnest; + QRadioButton* rXephyr; + QRadioButton* rX2goagent; + QLineEdit* xdmcpCmdLine; + QLineEdit* xdmcpParams; #endif QFrame* hLine1; QFrame* hLine2; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git _______________________________________________ x2go-commits mailing list x2go-commits@lists.x2go.org https://lists.x2go.org/listinfo/x2go-commits