[X2go-Commits] x2goclient.git - master (branch) updated: 3.99.2.2-7-g4adfcbf
X2Go dev team
git-admin at x2go.org
Thu Aug 30 17:11:35 CEST 2012
The branch, master has been updated
via 4adfcbf0aa5f34283089786032b47727530e5d78 (commit)
from 6f97d0f1a8141411f2ac1c171ca2648053302ee1 (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 4adfcbf0aa5f34283089786032b47727530e5d78
Author: Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
Date: Thu Aug 30 18:11:28 2012 +0300
Add settings for direct RDP connection
-----------------------------------------------------------------------
Summary of changes:
debian/changelog | 7 +-
editconnectiondialog.cpp | 190 +++++++++++++++++++++++++---------------------
editconnectiondialog.h | 1 +
sessionwidget.cpp | 91 ++++++++++++++++++++---
sessionwidget.h | 11 +++
settingswidget.cpp | 137 ++++++++++++++++++++++++++++++++-
settingswidget.h | 19 +++++
7 files changed, 354 insertions(+), 102 deletions(-)
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 2ef8a6d..753b008 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-x2goclient (3.99.2.3-0~x2go1) UNRELEASED; urgency=low
+x2goclient (3.99.2.3-0~x2go2) UNRELEASED; urgency=low
[ Mike Gabriel ]
* New upstream version (3.99.2.2):
@@ -8,7 +8,10 @@ x2goclient (3.99.2.3-0~x2go1) UNRELEASED; urgency=low
[ Christoffer Krakou ]
- Add Danish translation to x2goclient.
- -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de> Wed, 15 Aug 2012 15:14:05 +0200
+ [ Oleksandr Shneyder ]
+ * Add settings for direct RDP connection
+
+ -- Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de> Thu, 30 Aug 2012 18:10:57 +0300
x2goclient (3.99.2.2-0~x2go2) unstable; urgency=low
diff --git a/editconnectiondialog.cpp b/editconnectiondialog.cpp
index 99b3b25..f50ed85 100644
--- a/editconnectiondialog.cpp
+++ b/editconnectiondialog.cpp
@@ -24,78 +24,84 @@
EditConnectionDialog::EditConnectionDialog ( QString id, QWidget * par,
int ind,Qt::WFlags f )
- : QDialog ( par,f )
+ : QDialog ( par,f )
{
- QVBoxLayout* ml=new QVBoxLayout ( this );
+ QVBoxLayout* ml=new QVBoxLayout ( this );
#ifdef Q_WS_HILDON
- ml->setMargin ( 2 );
+ ml->setMargin ( 2 );
#endif
- fr=new QTabWidget ( this );
- ml->addWidget ( fr );
- ONMainWindow* parent= ( ONMainWindow* ) par;
+ fr=new QTabWidget ( this );
+ ml->addWidget ( fr );
+ ONMainWindow* parent= ( ONMainWindow* ) par;
- QFont fnt=font();
- if ( parent->retMiniMode() )
+ QFont fnt=font();
+ if ( parent->retMiniMode() )
#ifdef Q_WS_HILDON
- fnt.setPointSize ( 10 );
+ fnt.setPointSize ( 10 );
#else
- fnt.setPointSize ( 9 );
+ fnt.setPointSize ( 9 );
#endif
- setFont ( fnt );
-
- sessSet=new SessionWidget ( id,parent );
- conSet=new ConnectionWidget ( id,parent );
- otherSet=new SettingsWidget ( id,parent );
- exportDir=new ShareWidget ( id,parent );
-
-
- fr->addTab ( sessSet,tr ( "&Session" ) );
- fr->addTab ( conSet,tr ( "&Connection" ) );
- fr->addTab ( otherSet,tr ( "&Settings" ) );
- fr->addTab ( exportDir,tr ( "&Shared folders" ) );
-
- QPushButton* ok=new QPushButton ( tr ( "&OK" ),this );
- QPushButton* cancel=new QPushButton ( tr ( "&Cancel" ),this );
- QPushButton* def=new QPushButton ( tr ( "Defaults" ),this );
- QHBoxLayout* bLay=new QHBoxLayout();
- bLay->setSpacing ( 5 );
- bLay->addStretch();
- bLay->addWidget ( ok );
- bLay->addWidget ( cancel );
- bLay->addWidget ( def );
- ml->addLayout ( bLay );
+ setFont ( fnt );
+
+ sessSet=new SessionWidget ( id,parent );
+ conSet=new ConnectionWidget ( id,parent );
+ otherSet=new SettingsWidget ( id,parent );
+ exportDir=new ShareWidget ( id,parent );
+
+
+ fr->addTab ( sessSet,tr ( "&Session" ) );
+ fr->addTab ( conSet,tr ( "&Connection" ) );
+ fr->addTab ( otherSet,tr ( "&Settings" ) );
+ fr->addTab ( exportDir,tr ( "&Shared folders" ) );
+
+ QPushButton* ok=new QPushButton ( tr ( "&OK" ),this );
+ QPushButton* cancel=new QPushButton ( tr ( "&Cancel" ),this );
+ QPushButton* def=new QPushButton ( tr ( "Defaults" ),this );
+ QHBoxLayout* bLay=new QHBoxLayout();
+ bLay->setSpacing ( 5 );
+ bLay->addStretch();
+ bLay->addWidget ( ok );
+ bLay->addWidget ( cancel );
+ bLay->addWidget ( def );
+ ml->addLayout ( bLay );
#ifdef Q_WS_HILDON
- bLay->setMargin ( 2 );
+ bLay->setMargin ( 2 );
#endif
- setSizeGripEnabled ( true );
- setWindowIcon ( QIcon ( parent->iconsPath ( "/32x32/edit.png" ) ) );
- connect ( ok,SIGNAL ( clicked() ),this,SLOT ( accept() ) );
- connect ( cancel,SIGNAL ( clicked() ),this,SLOT ( reject() ) );
- connect ( def,SIGNAL ( clicked() ),this,SLOT ( slot_default() ) );
- connect ( sessSet,SIGNAL ( nameChanged ( const QString & ) ),this,
- SLOT ( slot_changeCaption ( const QString& ) ) );
- connect ( this,SIGNAL ( accepted() ),this,SLOT ( slot_accepted() ) );
-
- ok->setDefault ( true );
+ setSizeGripEnabled ( true );
+ setWindowIcon ( QIcon ( parent->iconsPath ( "/32x32/edit.png" ) ) );
+ connect ( ok,SIGNAL ( clicked() ),this,SLOT ( accept() ) );
+ connect ( cancel,SIGNAL ( clicked() ),this,SLOT ( reject() ) );
+ connect ( def,SIGNAL ( clicked() ),this,SLOT ( slot_default() ) );
+ 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(settingsChanged(QString,QString,QString)), otherSet,
+ SLOT(setServerSettings(QString,QString,QString)));
+
+ ok->setDefault ( true );
#ifdef Q_WS_HILDON
- QSize sz=ok->sizeHint();
- sz.setWidth ( ( int ) ( sz.width() /1.5 ) );
- sz.setHeight ( ( int ) ( sz.height() /1.5 ) );
- ok->setFixedSize ( sz );
- sz=cancel->sizeHint();
- sz.setWidth ( ( int ) ( sz.width() ) );
- sz.setHeight ( ( int ) ( sz.height() /1.5 ) );
- cancel->setFixedSize ( sz );
- sz=def->sizeHint();
- sz.setWidth ( ( int ) ( sz.width() ) );
- sz.setHeight ( ( int ) ( sz.height() /1.5 ) );
- def->setFixedSize ( sz );
+ QSize sz=ok->sizeHint();
+ sz.setWidth ( ( int ) ( sz.width() /1.5 ) );
+ sz.setHeight ( ( int ) ( sz.height() /1.5 ) );
+ ok->setFixedSize ( sz );
+ sz=cancel->sizeHint();
+ sz.setWidth ( ( int ) ( sz.width() ) );
+ sz.setHeight ( ( int ) ( sz.height() /1.5 ) );
+ cancel->setFixedSize ( sz );
+ sz=def->sizeHint();
+ sz.setWidth ( ( int ) ( sz.width() ) );
+ sz.setHeight ( ( int ) ( sz.height() /1.5 ) );
+ def->setFixedSize ( sz );
#endif
- if ( parent->retMiniMode() )
- setContentsMargins ( 3,3,3,3 );
- fr->setCurrentIndex ( ind );
- slot_changeCaption(sessSet->sessionName());
+ if ( parent->retMiniMode() )
+ setContentsMargins ( 3,3,3,3 );
+ fr->setCurrentIndex ( ind );
+ slot_changeCaption(sessSet->sessionName());
+ sessSet->slot_rdpDirectClicked();
}
@@ -106,43 +112,51 @@ EditConnectionDialog::~EditConnectionDialog()
void EditConnectionDialog::slot_changeCaption ( const QString& newName )
{
- setWindowTitle ( tr ( "Session preferences - " ) +newName );
+ setWindowTitle ( tr ( "Session preferences - " ) +newName );
}
void EditConnectionDialog::slot_accepted()
{
- conSet->saveSettings();
- exportDir->saveSettings();
- otherSet->saveSettings();
- sessSet->saveSettings();
+ conSet->saveSettings();
+ exportDir->saveSettings();
+ otherSet->saveSettings();
+ sessSet->saveSettings();
}
void EditConnectionDialog::slot_default()
{
- switch ( fr->currentIndex() )
- {
- case 0:
- {
- sessSet->setDefaults();
- }
- break;
- case 1:
- {
- conSet->setDefaults();
- }
- break;
- case 2:
- {
- otherSet->setDefaults();
- }
- break;
- case 3:
- {
- exportDir->setDefaults();
- }
- break;
- }
+ switch ( fr->currentIndex() )
+ {
+ case 0:
+ {
+ sessSet->setDefaults();
+ }
+ break;
+ case 1:
+ {
+ conSet->setDefaults();
+ }
+ break;
+ case 2:
+ {
+ otherSet->setDefaults();
+ }
+ break;
+ case 3:
+ {
+ exportDir->setDefaults();
+ }
+ break;
+ }
}
+void EditConnectionDialog::slot_directRDP(bool direct)
+{
+ fr->setTabEnabled(1,!direct);
+ fr->setTabEnabled(3,!direct);
+ otherSet->setDirectRdp(direct);
+}
+
+
diff --git a/editconnectiondialog.h b/editconnectiondialog.h
index 45c524a..ea177db 100644
--- a/editconnectiondialog.h
+++ b/editconnectiondialog.h
@@ -57,6 +57,7 @@ class EditConnectionDialog : public QDialog
void slot_changeCaption ( const QString& newName );
void slot_accepted();
void slot_default();
+ void slot_directRDP(bool direct);
};
#endif
diff --git a/sessionwidget.cpp b/sessionwidget.cpp
index 2f66aa2..be73c9b 100644
--- a/sessionwidget.cpp
+++ b/sessionwidget.cpp
@@ -67,10 +67,14 @@ SessionWidget::SessionWidget ( QString id, ONMainWindow * mw,
sshPort->setValue ( mainWindow->getDefaultSshPort().toInt() );
sshPort->setMinimum ( 1 );
sshPort->setMaximum ( 999999999 );
+ rdpPort=new QSpinBox ( sgb );
+ rdpPort->setValue ( mainWindow->getDefaultSshPort().toInt() );
+ rdpPort->setMinimum ( 1 );
+ rdpPort->setMaximum ( 999999999 );
key=new QLineEdit ( sgb );
#ifndef Q_WS_HILDON
- QPushButton* openKey=new QPushButton (
+ openKey=new QPushButton (
QIcon ( mainWindow->iconsPath (
"/32x32/file-open.png" ) ),
QString::null,sgb );
@@ -86,10 +90,12 @@ SessionWidget::SessionWidget ( QString id, ONMainWindow * mw,
QVBoxLayout *elLay =new QVBoxLayout();
slLay->addWidget ( new QLabel ( tr ( "Host:" ),sgb ) );
slLay->addWidget ( new QLabel ( tr ( "Login:" ),sgb ) );
- slLay->addWidget ( new QLabel ( tr ( "SSH port:" ),sgb ) );
+ lPort=new QLabel ( tr ( "SSH port:" ),sgb );
+ slLay->addWidget ( lPort );
elLay->addWidget ( server );
elLay->addWidget ( uname );
elLay->addWidget ( sshPort );
+ elLay->addWidget ( rdpPort );
suLay->addLayout ( slLay );
suLay->addLayout ( elLay );
#ifdef Q_WS_HILDON
@@ -97,8 +103,8 @@ SessionWidget::SessionWidget ( QString id, ONMainWindow * mw,
#endif
QHBoxLayout *keyLay =new QHBoxLayout();
- keyLay->addWidget (
- new QLabel ( tr ( "Use RSA/DSA key for ssh connection:" ),sgb ) );
+ lKey=new QLabel ( tr ( "Use RSA/DSA key for ssh connection:" ),sgb );
+ keyLay->addWidget (lKey );
keyLay->addWidget ( key );
keyLay->addWidget ( openKey );
@@ -111,7 +117,7 @@ SessionWidget::SessionWidget ( QString id, ONMainWindow * mw,
#ifndef Q_WS_HILDON
QGroupBox *deskSess=new QGroupBox ( tr ( "&Session type" ),this );
- QHBoxLayout* cmdLay=new QHBoxLayout ( deskSess );
+ QGridLayout* cmdLay=new QGridLayout ( deskSess );
#else
QFrame* deskSess=this;
QHBoxLayout* cmdLay=new QHBoxLayout ();
@@ -131,13 +137,14 @@ SessionWidget::SessionWidget ( QString id, ONMainWindow * mw,
sessBox->addItem ( tr ( "Custom desktop" ) );
sessBox->addItem ( tr ( "Single application" ) );
sessBox->addItem ( tr ( "Published applications" ) );
- cmdLay->addWidget ( sessBox );
+ cmdLay->addWidget ( sessBox,0,1,Qt::AlignLeft );
leCmdIp=new QLabel ( tr ( "Command:" ),deskSess );
pbAdvanced=new QPushButton ( tr ( "Advanced options..." ),deskSess );
- cmdLay->addWidget ( leCmdIp );
- cmdLay->addWidget ( cmd );
- cmdLay->addWidget ( cmdCombo );
- cmdLay->addWidget ( pbAdvanced );
+ cmdLay->addWidget ( leCmdIp,0,2 );
+ cmdLay->setColumnStretch(6,1);
+ cmdLay->addWidget ( cmd ,0,3);
+ cmdLay->addWidget ( cmdCombo,0,4 );
+ cmdLay->addWidget ( pbAdvanced ,0,5);
cmdCombo->setSizePolicy ( QSizePolicy::Expanding,
QSizePolicy::Preferred );
cmdCombo->hide();
@@ -153,6 +160,13 @@ SessionWidget::SessionWidget ( QString id, ONMainWindow * mw,
sessLay->addSpacing ( 15 );
sessLay->addWidget ( sgb );
sessLay->addWidget ( deskSess );
+#ifdef Q_OS_LINUX
+ cbDirectRDP=new QCheckBox("Direct RDP Connection", deskSess);
+ cmdLay->addWidget(cbDirectRDP,1,0,1,6);
+ cbDirectRDP->hide();
+ connect(cbDirectRDP,SIGNAL(clicked()), this, SLOT(slot_rdpDirectClicked()));
+#endif
+
#else
QVBoxLayout* sHildILay = new QVBoxLayout();
sHildILay->addLayout ( slay );
@@ -181,6 +195,9 @@ SessionWidget::SessionWidget ( QString id, ONMainWindow * mw,
SLOT ( slot_changeCmd ( int ) ) );
connect ( sessName,SIGNAL ( textChanged ( const QString & ) ),this,
SIGNAL ( nameChanged ( const QString & ) ) );
+ connect (server, SIGNAL(textChanged(const QString&)),this, SLOT(slot_emitSettings()));
+ connect (uname, SIGNAL(textChanged(const QString&)),this, SLOT(slot_emitSettings()));
+ connect (rdpPort, SIGNAL(valueChanged(int)),this, SLOT(slot_emitSettings()));
readConfig();
cbKrbLogin->setChecked(false);
cbKrbLogin->setVisible(false);
@@ -191,6 +208,33 @@ SessionWidget::~SessionWidget()
}
+void SessionWidget::slot_rdpDirectClicked()
+{
+ bool isDirectRDP=cbDirectRDP->isChecked();
+ if (cbDirectRDP->isHidden())
+ isDirectRDP=false;
+ pbAdvanced->setVisible(!isDirectRDP);
+ leCmdIp->setVisible(!isDirectRDP);
+ cmd->setVisible(!isDirectRDP);
+ key->setVisible(!isDirectRDP);
+ cbAutoLogin->setVisible(!isDirectRDP);
+ lKey->setVisible(!isDirectRDP);
+ openKey->setVisible(!isDirectRDP);
+ sshPort->setVisible(!isDirectRDP);
+ rdpPort->setVisible(isDirectRDP);
+ if (isDirectRDP)
+ {
+ lPort->setText(("RDP port"));
+ }
+ else
+ {
+ lPort->setText(tr("SSH port"));
+ }
+
+ emit directRDP(isDirectRDP);
+ slot_emitSettings();
+}
+
void SessionWidget::slot_getIcon()
{
QString path= QFileDialog::getOpenFileName (
@@ -253,6 +297,9 @@ void SessionWidget::slot_changeCmd ( int var )
{
leCmdIp->setText ( tr ( "Command:" ) );
pbAdvanced->hide();
+ cbDirectRDP->hide();
+ leCmdIp->show();
+ cmd->show();
if ( var==APPLICATION )
{
cmd->hide();
@@ -276,6 +323,7 @@ void SessionWidget::slot_changeCmd ( int var )
leCmdIp->setText ( tr ( "Server:" ) );
pbAdvanced->show();
cmd->setText ( rdpServer );
+ cbDirectRDP->show();
}
if ( var== XDMCP )
{
@@ -289,6 +337,7 @@ void SessionWidget::slot_changeCmd ( int var )
cmd->setText ( "" );
}
}
+ slot_rdpDirectClicked();
}
void SessionWidget::slot_rdpOptions()
@@ -336,6 +385,10 @@ void SessionWidget::readConfig()
sessionId+"/sshport",
( QVariant ) mainWindow->getDefaultSshPort().toInt()
).toInt() );
+ rdpPort->setValue (
+ st.setting()->value (
+ sessionId+"/rdpport",3389
+ ).toInt() );
QStringList appNames=st.setting()->value (
sessionId+"/applications" ).toStringList();
@@ -356,6 +409,10 @@ void SessionWidget::readConfig()
xdmcpServer=st.setting()->value ( sessionId+"/xdmcpserver",
( QVariant ) "localhost" ).toString();
+ cbDirectRDP->setChecked(st.setting()->value (
+ sessionId+"/directrdp",false ).toBool());
+
+
for ( int i=0;i<appNames.count();++i )
{
QString app=mainWindow->transAppName ( appNames[i] );
@@ -409,6 +466,8 @@ void SessionWidget::readConfig()
cmd->setEnabled ( true );
cmd->setText ( rdpServer );
pbAdvanced->show();
+ cbDirectRDP->show();
+ slot_rdpDirectClicked();
}
else if ( command=="XDMCP" )
{
@@ -429,6 +488,7 @@ void SessionWidget::readConfig()
sessName->selectAll();
sessName->setFocus();
}
+ slot_rdpDirectClicked();
}
void SessionWidget::setDefaults()
@@ -450,6 +510,7 @@ void SessionWidget::setDefaults()
icon->setIcon ( QIcon ( sessIcon ) );
sshPort->setValue (
mainWindow->getDefaultSshPort().toInt() );
+ rdpPort->setValue (3389);
}
@@ -468,10 +529,14 @@ void SessionWidget::saveSettings()
st.setting()->setValue ( sessionId+"/key",
( QVariant ) key->text() );
+ st.setting()->setValue ( sessionId+"/rdpport",
+ ( QVariant ) rdpPort->value() );
+
st.setting()->setValue ( sessionId+"/sshport",
( QVariant ) sshPort->value() );
st.setting()->setValue(sessionId+"/autologin",( QVariant ) cbAutoLogin->isChecked());
st.setting()->setValue(sessionId+"/krblogin",( QVariant ) cbKrbLogin->isChecked());
+ st.setting()->setValue(sessionId+"/directrdp",( QVariant ) cbDirectRDP->isChecked());
QString command;
bool rootless=false;
bool published=false;
@@ -538,3 +603,9 @@ QString SessionWidget::sessionName()
{
return sessName->text();
}
+
+void SessionWidget::slot_emitSettings()
+{
+ emit settingsChanged(server->text(), QString::number( rdpPort->value()), uname->text());
+}
+
diff --git a/sessionwidget.h b/sessionwidget.h
index 869d9bb..9ad5c35 100644
--- a/sessionwidget.h
+++ b/sessionwidget.h
@@ -23,6 +23,7 @@ class QPushButton;
class QComboBox;
class QLabel;
class QCheckBox;
+class QGroupBox;
class SessionWidget : public ConfigWidget
{
Q_OBJECT
@@ -38,6 +39,9 @@ private slots:
void slot_getKey();
void slot_changeCmd ( int var );
void slot_rdpOptions();
+public slots:
+ void slot_rdpDirectClicked();
+ void slot_emitSettings();
private:
enum {KDE,GNOME,LXDE,UNITY,RDP,XDMCP,SHADOW,OTHER,APPLICATION,PUBLISHED};
@@ -45,23 +49,30 @@ private:
QLineEdit* uname;
QLineEdit* server;
QSpinBox* sshPort;
+ QSpinBox* rdpPort;
QLineEdit* key;
QCheckBox* cbAutoLogin;
QCheckBox* cbKrbLogin;
+ QCheckBox* cbDirectRDP;
QString sessIcon;
QPushButton* icon;
QLineEdit* cmd;
QComboBox* cmdCombo;
QComboBox* sessBox;
QLabel* leCmdIp;
+ QLabel* lPort;
+ QLabel* lKey;
QPushButton* pbAdvanced;
QString rdpOptions;
QString rdpServer;
QString xdmcpServer;
+ QPushButton* openKey;
private:
void readConfig();
signals:
void nameChanged ( const QString & );
+ void directRDP(bool);
+ void settingsChanged(const QString &, const QString &, const QString &);
};
#endif
diff --git a/settingswidget.cpp b/settingswidget.cpp
index 1d1a229..5439059 100644
--- a/settingswidget.cpp
+++ b/settingswidget.cpp
@@ -26,6 +26,7 @@
#include <QTimer>
#include <QSplashScreen>
#include "x2gologdebug.h"
+#include <QGridLayout>
SettingsWidget::SettingsWidget ( QString id, ONMainWindow * mw,
QWidget * parent, Qt::WindowFlags f )
@@ -42,8 +43,9 @@ SettingsWidget::SettingsWidget ( QString id, ONMainWindow * mw,
tabSettings->addTab ( sbgr,tr ( "Sound" ) );
#else
QGroupBox *dgb=new QGroupBox ( tr ( "&Display" ),this );
- QGroupBox *kgb=new QGroupBox ( tr ( "&Keyboard" ),this );
- QGroupBox *sbgr=new QGroupBox ( tr ( "Sound" ),this );
+ kgb=new QGroupBox ( tr ( "&Keyboard" ),this );
+ sbgr=new QGroupBox ( tr ( "Sound" ),this );
+ rdpBox=new QGroupBox ( tr ( "RDP Client" ),this );
#endif
QVBoxLayout *dbLay = new QVBoxLayout ( dgb );
QVBoxLayout *sndLay=new QVBoxLayout ( sbgr );
@@ -61,11 +63,13 @@ SettingsWidget::SettingsWidget ( QString id, ONMainWindow * mw,
custom=new QRadioButton ( tr ( "Window" ),dgb );
#endif
display=new QRadioButton ( tr ( "Use whole display" ),dgb );
+ maxRes=new QRadioButton ( tr ( "Maximum available" ),dgb );
radio->addButton ( fs );
radio->addButton ( custom );
radio->setExclusive ( true );
radio->addButton(display);
+ radio->addButton(maxRes);
width=new QSpinBox ( dgb );
height=new QSpinBox ( dgb );
cbSetDPI=new QCheckBox ( tr ( "Set display DPI" ),dgb );
@@ -98,6 +102,7 @@ SettingsWidget::SettingsWidget ( QString id, ONMainWindow * mw,
dwLay->addStretch();
dispLay->addWidget(display);
+ dispLay->addWidget(maxRes);
dispLay->addSpacing(15);
dispLay->addWidget(lDisplay=new QLabel(tr("&Display:"),dgb));
dispLay->addWidget(displayNumber=new QSpinBox(dgb));
@@ -123,10 +128,12 @@ SettingsWidget::SettingsWidget ( QString id, ONMainWindow * mw,
dbLay->addLayout ( dwLay );
dbLay->addLayout(dispLay);
QFrame* dhl=new QFrame ( dgb );
+ hLine1=dhl;
dhl->setFrameStyle ( QFrame::HLine | QFrame::Sunken );
dbLay->addWidget ( dhl );
dbLay->addLayout ( ddLay );
dhl=new QFrame ( dgb );
+ hLine2=dhl;
dhl->setFrameStyle ( QFrame::HLine | QFrame::Sunken );
dbLay->addWidget ( dhl );
dbLay->addWidget ( cbXinerama );
@@ -223,6 +230,27 @@ SettingsWidget::SettingsWidget ( QString id, ONMainWindow * mw,
setLay->addWidget ( dgb );
setLay->addWidget ( kgb );
setLay->addWidget ( sbgr );
+ setLay->addWidget ( rdpBox );
+
+
+ rRdesktop=new QRadioButton ("rdesktop",rdpBox );
+ rRdesktop->setChecked(true);
+ rXfreeRDP=new QRadioButton ( "xfreerdp",rdpBox);
+
+ QButtonGroup* rClient=new QButtonGroup(rdpBox);
+ rClient->addButton ( rRdesktop );
+ rClient->addButton ( rXfreeRDP );
+ rClient->setExclusive ( true );
+ QGridLayout *rdpLay=new QGridLayout(rdpBox);
+ rdpLay->addWidget(rRdesktop,0,0);
+ rdpLay->addWidget(rXfreeRDP,1,0);
+ rdpLay->addWidget(new QLabel(tr("Additional parameters:")),2,0);
+ rdpLay->addWidget(new QLabel(tr("Command line:")),3,0);
+ cmdLine=new QLineEdit(rdpBox);
+ cmdLine->setReadOnly(true);
+ params=new QLineEdit(rdpBox);
+ rdpLay->addWidget(cmdLine,4,0,1,2);
+ rdpLay->addWidget(params,2,1);
#else
setLay->addWidget ( tabSettings );
// cbClientPrint->hide();
@@ -267,6 +295,12 @@ SettingsWidget::SettingsWidget ( QString id, ONMainWindow * mw,
SLOT ( slot_sndStartClicked() ) );
connect ( cbDefSndPort,SIGNAL ( toggled ( bool ) ),this,
SLOT ( slot_sndDefPortChecked ( bool ) ) );
+
+ connect (rClient, SIGNAL(buttonClicked(int)), this, SLOT(updateCmdLine()));
+ connect (radio, SIGNAL(buttonClicked(int)), this, SLOT(updateCmdLine()));
+ connect (params, SIGNAL(textChanged(QString)), this, SLOT(updateCmdLine()));
+ connect (width, SIGNAL(valueChanged(int)), this, SLOT(updateCmdLine()));
+ connect (height, SIGNAL(valueChanged(int)), this, SLOT(updateCmdLine()));
kbd->setChecked ( true );
custom->setChecked ( true );
readConfig();
@@ -277,6 +311,39 @@ SettingsWidget::~SettingsWidget()
{
}
+void SettingsWidget::setDirectRdp(bool direct)
+{
+ cbClientPrint->setVisible(!direct);
+ kgb->setVisible(!direct);
+ sbgr->setVisible(!direct);
+ cbSetDPI->setVisible(!direct);
+ cbXinerama->setVisible(!direct);
+ display->setVisible(!direct);
+ maxRes->setVisible(direct);
+ DPI->setVisible(!direct);
+ lDisplay->setVisible(!direct);
+ displayNumber->setVisible(!direct);
+ pbIdentDisp->setVisible(!direct);
+ hLine1->setVisible(!direct);
+ hLine2->setVisible(!direct);
+ rdpBox->setVisible(direct);
+ if (direct)
+ {
+ if (display->isChecked())
+ {
+ display->setChecked(false);
+ custom->setChecked(true);
+ }
+ }
+ else
+ {
+ if (maxRes->isChecked())
+ {
+ maxRes->setChecked(false);
+ custom->setChecked(true);
+ }
+ }
+}
void SettingsWidget::slot_identDisplays()
{
@@ -457,6 +524,20 @@ void SettingsWidget::readConfig()
displayNumber->setValue(1);
}
+
+ maxRes->setChecked(st.setting()->value ( sessionId+"/maxdim", false).toBool());
+
+ QString client=st.setting()->value ( sessionId+"/rdpclient","rdesktop").toString();
+
+ if(client=="rdesktop")
+ rRdesktop->setChecked(true);
+ else
+ rXfreeRDP->setChecked(true);
+
+ params->setText(st.setting()->value ( sessionId+"/directrdpsettings","").toString());
+
+
+
cbSetDPI->setChecked (
st.setting()->value ( sessionId+"/setdpi",
( QVariant ) mainWindow->getDefaultSetDPI() ).toBool() );
@@ -575,6 +656,19 @@ void SettingsWidget::saveSettings()
( QVariant ) display->isChecked() );
st.setting()->setValue ( sessionId+"/display",
( QVariant ) displayNumber->value() );
+
+ st.setting()->setValue ( sessionId+"/maxdim",
+ ( QVariant ) maxRes->isChecked() );
+
+ if (rXfreeRDP->isChecked())
+ st.setting()->setValue ( sessionId+"/rdpclient",
+ ( QVariant ) "xfreerdp" );
+ else
+ st.setting()->setValue ( sessionId+"/rdpclient",
+ ( QVariant ) "rdesktop" );
+ st.setting()->setValue ( sessionId+"/directrdpsettings",
+ ( QVariant ) params->text());
+
st.setting()->setValue ( sessionId+"/height",
( QVariant ) height->value() );
st.setting()->setValue ( sessionId+"/dpi",
@@ -614,3 +708,42 @@ void SettingsWidget::saveSettings()
( QVariant ) cbClientPrint->isChecked() );
st.setting()->sync();
}
+
+void SettingsWidget::setServerSettings(QString server, QString port, QString user)
+{
+ this->server=server;
+ this->port=port;
+ this->user=user;
+ updateCmdLine();
+}
+
+void SettingsWidget::updateCmdLine()
+{
+ QString client="xfreerdp";
+ QString userOpt;
+ if (user.length()>0)
+ {
+ userOpt=" -u ";
+ userOpt+=user;
+ }
+ if (rRdesktop->isChecked())
+ {
+ client="rdesktop";
+ }
+
+ QString grOpt;
+
+ if (fs->isChecked())
+ {
+ grOpt=" -f ";
+ }
+ if (maxRes->isChecked())
+ {
+ grOpt=" -g <maxW>x<maxH>";
+ }
+ if (custom->isChecked())
+ {
+ grOpt=" -g "+QString::number(width->value())+"x"+QString::number(height->value());
+ }
+ cmdLine->setText(client +" "+params->text()+ grOpt +userOpt+" -p <"+tr("password")+"> "+ server+":"+port );
+}
diff --git a/settingswidget.h b/settingswidget.h
index 8c5ebf8..79aae0c 100644
--- a/settingswidget.h
+++ b/settingswidget.h
@@ -25,6 +25,7 @@ class QSpinBox;
class QLabel;
class QPushButton;
class QMainWindow;
+class QGroupBox;
class SettingsWidget : public ConfigWidget
@@ -36,6 +37,10 @@ public:
~SettingsWidget();
void setDefaults();
void saveSettings();
+ void setDirectRdp(bool direct);
+public slots:
+ void setServerSettings(QString server, QString port, QString user);
+ void updateCmdLine();
private slots:
void slot_sndSysSelected ( int system );
void slot_sndToggled ( bool val );
@@ -54,6 +59,7 @@ private:
QLineEdit* type;
QRadioButton* custom;
QRadioButton* display;
+ QRadioButton* maxRes;
QRadioButton* arts;
QRadioButton* pulse;
QRadioButton* esd;
@@ -76,6 +82,19 @@ private:
bool multiDisp;
QPushButton* pbIdentDisp;
QList <QMainWindow*> identWins;
+ QGroupBox *kgb;
+ QGroupBox *sbgr;
+ QGroupBox *rdpBox;
+ QRadioButton* rRdesktop;
+ QRadioButton* rXfreeRDP;
+ QLineEdit* cmdLine;
+ QLineEdit* params;
+ QFrame* hLine1;
+ QFrame* hLine2;
+ QString server;
+ QString user;
+ QString port;
+
private:
void readConfig();
};
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