This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2goclient. from a929156 Reconnect ssh broker in case of IO Error. new 468b0de Reformat source onmainwindow.cpp. new 1828803 Disable settings editing if a directory with central settings is exists. new aea2684 Format long names on session buttons. The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 3 + src/exportdialog.cpp | 5 ++ src/onmainwindow.cpp | 184 ++++++++++++++++++++++++++----------------------- src/sessionbutton.cpp | 12 +++- src/sessionbutton.h | 1 + src/x2gosettings.cpp | 9 +++ src/x2gosettings.h | 1 + 7 files changed, 125 insertions(+), 90 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 468b0de22e9cf26a7768b16398d7b4a92c477fc5 Author: Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> Date: Wed Dec 2 15:52:58 2015 +0100 Reformat source onmainwindow.cpp. --- debian/changelog | 1 + src/onmainwindow.cpp | 156 +++++++++++++++++++++++++------------------------- 2 files changed, 79 insertions(+), 78 deletions(-) diff --git a/debian/changelog b/debian/changelog index 505cbca..0445e4e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,7 @@ x2goclient (4.0.5.1-0x2go1) UNRELEASED; urgency=low - Fix crashing client when editing session from SessionManageDialog. - Configure audio input in pulseaudio on Windows. - Reconnect ssh broker in case of IO Error. + - Reformat source onmainwindow.cpp. [ Mike Gabriel ] * New upstream release (4.0.5.1): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 9104a2d..d228607 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -149,7 +149,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) clientSshPort="7022"; pulsePort=4713; pulseStarted=false; - X2goSettings st ( "settings" ); + X2goSettings st ( "settings" ); pulseNoRecord=st.setting()->value ( "pulse/norecord", false ).toBool(); winSshdStarted=false; #else @@ -2596,7 +2596,7 @@ void ONMainWindow::slotSelectedFromList ( SessionButton* session ) sessIcon = wrap_legacy_resource_URIs (st->setting()->value (sid+"/icon", - (QVariant) ":/img/icons/128x128/x2gosession.png" + (QVariant) ":/img/icons/128x128/x2gosession.png" ).toString ()); sessIcon = expandHome(sessIcon); @@ -3409,7 +3409,7 @@ bool ONMainWindow::startSession ( const QString& sid ) false).toBool ()); QString prtype = (st->setting ()->value (sid + "/sshproxytype", - "SSH").toString ()); + "SSH").toString ()); if (prtype.toLower () == "http") { proxyType = SshMasterConnection::PROXYHTTP; } @@ -3431,7 +3431,7 @@ bool ONMainWindow::startSession ( const QString& sid ) 22).toInt ()); proxyAutologin = (st->setting ()->value (sid + "/sshproxyautologin", - false).toBool ()); + false).toBool ()); proxyKrbLogin = (st->setting ()->value (sid + "/sshproxykrblogin", false).toBool ()); @@ -5453,7 +5453,7 @@ void ONMainWindow::slotTunnelOk(int) #ifdef Q_OS_WIN if (xorgMode==WIN) { #endif - proxyWinTimer->start ( 300 ); + proxyWinTimer->start ( 300 ); #ifdef Q_OS_WIN } #endif @@ -5588,10 +5588,10 @@ void ONMainWindow::slotProxyFinished ( int,QProcess::ExitStatus ) #ifdef Q_OS_DARWIN if (modMapTimer) { - disconnect (modMapTimer, SIGNAL (timeout ()), this, SLOT (slotSetModMap ())); - modMapTimer->stop (); - delete (modMapTimer); - modMapTimer = 0; + disconnect (modMapTimer, SIGNAL (timeout ()), this, SLOT (slotSetModMap ())); + modMapTimer->stop (); + delete (modMapTimer); + modMapTimer = 0; } kbMap = QString (); //fixes bug, when mainwindow inputs not accepting focus under mac @@ -6458,9 +6458,9 @@ void ONMainWindow::runCommand() void ONMainWindow::runApplication(QString exec) { QString cmd = "PULSE_CLIENTCONFIG=\"${HOME}/.x2go/C-" - + resumingSession.sessionId+"/.pulse-client.conf\" DISPLAY=:" - + resumingSession.display - + " setsid " + exec + " 1> /dev/null 2>/dev/null & exit"; + + resumingSession.sessionId+"/.pulse-client.conf\" DISPLAY=:" + + resumingSession.display + + " setsid " + exec + " 1> /dev/null 2>/dev/null & exit"; sshConnection->executeCommand (cmd); } @@ -7617,7 +7617,7 @@ void ONMainWindow::exportDirs ( QString exports,bool removable ) // Key creation failure or the like. if (dr.key.isEmpty ()) { - return; + return; } QString passwd; @@ -8502,53 +8502,53 @@ void ONMainWindow::slotScDaemonError (QProcess::ProcessError error) { QString informative_text; switch (error) { - case QProcess::FailedToStart: { - main_text += tr ("failed to start."); - informative_text = tr ("Check whether the package providing \"scdaemon\" is installed.\n" - "The current search path is: "); + case QProcess::FailedToStart: { + main_text += tr ("failed to start."); + informative_text = tr ("Check whether the package providing \"scdaemon\" is installed.\n" + "The current search path is: "); - QProcessEnvironment tmp_env = QProcessEnvironment::systemEnvironment (); + QProcessEnvironment tmp_env = QProcessEnvironment::systemEnvironment (); - if (!(scDaemon->processEnvironment ().isEmpty ())) { - tmp_env = scDaemon->processEnvironment (); - } + if (!(scDaemon->processEnvironment ().isEmpty ())) { + tmp_env = scDaemon->processEnvironment (); + } - QString path_val = tmp_env.value ("PATH", "unknown"); + QString path_val = tmp_env.value ("PATH", "unknown"); - /* Add a newline every 100 characters. */ - for (std::size_t i = 100; i < static_cast<std::size_t> (path_val.size ()); i += 100) { - path_val.insert (i, "\n"); - } - - informative_text += path_val; - break; - } - case QProcess::Crashed: { - /* This means the process exited with a non-zero exit code. - * It didn't really crash at all. Everything is fine. - * Just restart it. */ - return; - } - case QProcess::Timedout: { - main_text += tr ("didn't start yet."); - informative_text = tr ("This error shouldn't come up."); - break; - } - case QProcess::WriteError: { - main_text += tr ("didn't accept a write operation."); - informative_text = tr ("It is probably not running correctly or crashed in-between."); - break; - } - case QProcess::ReadError: { - main_text = tr ("Unable to read from scdaemon."); - informative_text = tr ("It is probably not running correctly or crashed in-between."); - break; - } - case QProcess::UnknownError: { - } - default: { - main_text += tr ("experienced an unknown error."); + /* Add a newline every 100 characters. */ + for (std::size_t i = 100; i < static_cast<std::size_t> (path_val.size ()); i += 100) { + path_val.insert (i, "\n"); } + + informative_text += path_val; + break; + } + case QProcess::Crashed: { + /* This means the process exited with a non-zero exit code. + * It didn't really crash at all. Everything is fine. + * Just restart it. */ + return; + } + case QProcess::Timedout: { + main_text += tr ("didn't start yet."); + informative_text = tr ("This error shouldn't come up."); + break; + } + case QProcess::WriteError: { + main_text += tr ("didn't accept a write operation."); + informative_text = tr ("It is probably not running correctly or crashed in-between."); + break; + } + case QProcess::ReadError: { + main_text = tr ("Unable to read from scdaemon."); + informative_text = tr ("It is probably not running correctly or crashed in-between."); + break; + } + case QProcess::UnknownError: { + } + default: { + main_text += tr ("experienced an unknown error."); + } } if (!informative_text.isEmpty ()) { @@ -10053,7 +10053,7 @@ void ONMainWindow::generateEtcFiles() "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"<< "AuthorizedKeysFile \""<<authKeyPath<<"\""; #else - /* This may need some sanitization, i.e., appDir could potentially include whitespace. */ + /* This may need some sanitization, i.e., appDir could potentially include whitespace. */ "Subsystem sftp " <<appDir<<"/sftp-server\n"; #endif @@ -10098,7 +10098,7 @@ bool ONMainWindow::startSshd() // Should also automatically create keys if Remote Login is enabled // under Sharing in System Preferences. if (!isServerRunning (clientSshPort.toInt ())) { - clientSshPort = "7022"; + clientSshPort = "7022"; } #endif // defined (Q_OS_DARWIN) #endif // defined (Q_OS_LINUX) @@ -10898,10 +10898,10 @@ void ONMainWindow::processCfgLine ( QString line ) { config.useproxy = true; if (lst[1].toLower () == "true") { - config.useproxy = true; + config.useproxy = true; } else { - config.useproxy = false; + config.useproxy = false; } return; } @@ -11633,7 +11633,7 @@ void ONMainWindow::printSshDError_startupFailure() "If you see this message, please report a bug on:\n" "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" - "https://wiki.x2go.org/doku.php/wiki:bugs" + "https://wiki.x2go.org/doku.php/wiki:bugs" "</a></center>\n"); #else // defined (Q_OS_WIN) if (userSshd) { @@ -11643,7 +11643,7 @@ void ONMainWindow::printSshDError_startupFailure() "Please report a bug on:\n" "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" - "https://wiki.x2go.org/doku.php/wiki:bugs" + "https://wiki.x2go.org/doku.php/wiki:bugs" "</a></center>\n"); } else { @@ -11652,16 +11652,16 @@ void ONMainWindow::printSshDError_startupFailure() detailed_error_message += tr ("On OS X, please follow the following steps to enable " "SSH service:" "<ul>" - "<li>Open <b>System Preferences</b> (Applications -> System Preferences)</li>" - "<li>Go to <b>Sharing</b></li>" - "<li>Tick the checkbox besides <b>Remote Login</b></li>" - "<li>Check that <b>Allow access for:</b> is set to either:" - "<ul>" - "<li>All users: <b>no further steps necessary</b></li>" - "<li>Only these users <b>and your user name is included in the list</b></li>" - "</ul>" - "<li>Optionally, add your user name to the allowed list " - "via the <b>Plus Button</b></li>" + "<li>Open <b>System Preferences</b> (Applications -> System Preferences)</li>" + "<li>Go to <b>Sharing</b></li>" + "<li>Tick the checkbox besides <b>Remote Login</b></li>" + "<li>Check that <b>Allow access for:</b> is set to either:" + "<ul>" + "<li>All users: <b>no further steps necessary</b></li>" + "<li>Only these users <b>and your user name is included in the list</b></li>" + "</ul>" + "<li>Optionally, add your user name to the allowed list " + "via the <b>Plus Button</b></li>" "</ul>" "<b>Warning: enabling SSH access will allow any user on the network to connect " "to your machine. It is your responsibility to set a strong password for every " @@ -11701,7 +11701,7 @@ void ONMainWindow::printSshDError_noHostPubKey() "If you see this message, please report a bug on:\n" "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" - "https://wiki.x2go.org/doku.php/wiki:bugs" + "https://wiki.x2go.org/doku.php/wiki:bugs" "</a></center>\n"); #else // defined (Q_OS_WIN) if (userSshd) { @@ -11709,7 +11709,7 @@ void ONMainWindow::printSshDError_noHostPubKey() "Please report a bug on:\n" "<center><a href=\"https://wiki.x2go.org/doku.php/wiki:bugs\">" - "https://wiki.x2go.org/doku.php/wiki:bugs" + "https://wiki.x2go.org/doku.php/wiki:bugs" "</a></center>\n"); } else { @@ -11718,11 +11718,11 @@ void ONMainWindow::printSshDError_noHostPubKey() "required keys:" "<ul>" - "<li>Open a <b>Terminal Window</b> (Applications -> Utilities -> Terminal)</li>" - "<li>Run this command: <b>ssh -p " + clientSshPort.toAscii () - + " localhost</b></li>" - "<li>You do not need to login. Just quit the Terminal application " - "via Cmd + Q</li>" + "<li>Open a <b>Terminal Window</b> (Applications -> Utilities -> Terminal)</li>" + "<li>Run this command: <b>ssh -p " + clientSshPort.toAscii () + + " localhost</b></li>" + "<li>You do not need to login. Just quit the Terminal application " + "via Cmd + Q</li>" "</ul>"); #else // defined (Q_OS_DARWIN) detailed_error_message += tr ("Please ask your system administrator to generate the required host keys.\n\n" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 1828803ce0c086829378b0015f8069ca8518a3a2 Author: Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> Date: Wed Dec 2 16:26:16 2015 +0100 Disable settings editing if a directory with central settings is exists. --- debian/changelog | 1 + src/exportdialog.cpp | 5 +++++ src/onmainwindow.cpp | 28 +++++++++++++++++++--------- src/x2gosettings.cpp | 9 +++++++++ src/x2gosettings.h | 1 + 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0445e4e..c406240 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,7 @@ x2goclient (4.0.5.1-0x2go1) UNRELEASED; urgency=low - Configure audio input in pulseaudio on Windows. - Reconnect ssh broker in case of IO Error. - Reformat source onmainwindow.cpp. + - Disable settings editing if a directory with central settings is exists. [ Mike Gabriel ] * New upstream release (4.0.5.1): diff --git a/src/exportdialog.cpp b/src/exportdialog.cpp index 6d4495c..6017d24 100644 --- a/src/exportdialog.cpp +++ b/src/exportdialog.cpp @@ -52,6 +52,11 @@ ExportDialog::ExportDialog ( QString sid,QWidget * par, Qt::WFlags f ) editSession=new QPushButton ( tr ( "&Preferences ..." ),fr ); newDir=new QPushButton ( tr ( "&Custom folder ..." ),fr ); + if(X2goSettings::centralSettings()) + { + editSession->setEnabled(false); + editSession->setVisible(false); + } QVBoxLayout* actLay=new QVBoxLayout(); actLay->addWidget ( exportDir ); diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index d228607..4e94f9a 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -178,6 +178,11 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) xDisplay=0; #endif + if(X2goSettings::centralSettings()) + { + x2goInfof(0)<<"using central configuration"; + noSessionEdit=true; + } cleanAskPass(); setWindowTitle ( tr ( "X2Go Client" ) ); @@ -924,8 +929,10 @@ void ONMainWindow::initWidgetsNormal() if ( drawMenu ) { QMenu* menu_sess=menuBar()->addMenu ( tr ( "&Session" ) ); - QMenu* menu_opts=menuBar()->addMenu ( tr ( "&Options" ) ); - if (!brokerMode) + QMenu* menu_opts=0; + if(!X2goSettings::centralSettings()) + menu_opts=menuBar()->addMenu ( tr ( "&Options" ) ); + if (!brokerMode && !X2goSettings::centralSettings()) { menu_sess->addAction ( act_new ); menu_sess->addAction ( act_edit ); @@ -936,12 +943,15 @@ void ONMainWindow::initWidgetsNormal() 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); - if (connTest) - menu_opts->addAction(act_testCon); + if(!X2goSettings::centralSettings()) + { + menu_opts->addAction ( act_set ); + menu_opts->addAction ( act_tb ); + if (changeBrokerPass) + menu_opts->addAction(act_changeBrokerPass); + if (connTest) + menu_opts->addAction(act_testCon); + } QMenu* menu_help=menuBar()->addMenu ( tr ( "&Help" ) ); if (supportMenuFile!=QString::null) @@ -965,7 +975,7 @@ void ONMainWindow::initWidgetsNormal() if (connTest) stb->addAction(act_testCon); - if ( !showToolBar ) + if ( !showToolBar || X2goSettings::centralSettings()) stb->hide(); connect ( act_tb,SIGNAL ( toggled ( bool ) ),stb, SLOT ( setVisible ( bool ) ) ); diff --git a/src/x2gosettings.cpp b/src/x2gosettings.cpp index 32161e2..943cdf0 100644 --- a/src/x2gosettings.cpp +++ b/src/x2gosettings.cpp @@ -20,6 +20,7 @@ #include "x2gologdebug.h" #include "onmainwindow.h" #include <QTemporaryFile> +#include <QDir> X2goSettings::X2goSettings(QString fileContent, QSettings::Format format) { @@ -70,4 +71,12 @@ X2goSettings::~X2goSettings() delete cfgFile; } +bool X2goSettings::centralSettings() +{ +#ifndef Q_OS_WIN + QDir d("/etc/x2goclient/settings"); + x2goDebug<<d.exists(); + return d.exists(); +#endif +} diff --git a/src/x2gosettings.h b/src/x2gosettings.h index dd5913b..a72005c 100644 --- a/src/x2gosettings.h +++ b/src/x2gosettings.h @@ -31,6 +31,7 @@ public: X2goSettings ( QString fileContent, QSettings::Format format); ~X2goSettings(); + static bool centralSettings(); QSettings* setting() { return set; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit aea2684a6a6a4afda235ae5a74213dbba1d2ffb8 Author: Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> Date: Wed Dec 2 17:31:42 2015 +0100 Format long names on session buttons. --- debian/changelog | 1 + src/sessionbutton.cpp | 12 +++++++++--- src/sessionbutton.h | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index c406240..a4cd4d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,7 @@ x2goclient (4.0.5.1-0x2go1) UNRELEASED; urgency=low - Reconnect ssh broker in case of IO Error. - Reformat source onmainwindow.cpp. - Disable settings editing if a directory with central settings is exists. + - Format long names on session buttons. [ Mike Gabriel ] * New upstream release (4.0.5.1): diff --git a/src/sessionbutton.cpp b/src/sessionbutton.cpp index 2d51a23..9d08cf5 100644 --- a/src/sessionbutton.cpp +++ b/src/sessionbutton.cpp @@ -289,6 +289,7 @@ void SessionButton::redraw() QString name=st->setting()->value ( sid+"/name", ( QVariant ) tr ( "New Session" ) ).toString(); + QStringList tails=name.split("/",QString::SkipEmptyParts); if(tails.count()>0) { @@ -297,7 +298,12 @@ void SessionButton::redraw() path=tails.join("/"); } - sessName->setText (name); + QFontMetrics metr(sessName->font()); + nameofSession=name; + + QString elName=metr.elidedText(name, Qt::ElideRight, 250); + sessName->setText (elName); + sessName->setToolTip(nameofSession); QString status=st->setting()->value ( sid+"/status", ( QVariant ) QString::null ).toString(); @@ -311,7 +317,7 @@ void SessionButton::redraw() } QString sessIcon = wrap_legacy_resource_URIs (st->setting()->value (sid+"/icon", - (QVariant) ":/img/icons/128x128/x2gosession.png" + (QVariant) ":/img/icons/128x128/x2gosession.png" ).toString ()); sessIcon = expandHome(sessIcon); QPixmap* pix; @@ -873,7 +879,7 @@ bool SessionButton::lessThen ( const SessionButton* b1, QString SessionButton::name() { - return sessName->text(); + return nameofSession; } void SessionButton::slotMenuHide() diff --git a/src/sessionbutton.h b/src/sessionbutton.h index 7590591..876f0f3 100644 --- a/src/sessionbutton.h +++ b/src/sessionbutton.h @@ -54,6 +54,7 @@ public: } private: + QString nameofSession; QString sid; QString path; QLabel* sessName; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git