This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch bugfix/osx in repository x2goclient. from 83a4d7d src/configdialog.cpp: whitespace only. new 2651e92 src/onmainwindow.{cpp,h}: hook PulseManager in - for both OS X and Windows. new 1faee7c src/mediawidget.cpp: reflect new capabilities through PulseManager. The 2 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/mediawidget.cpp | 35 ++--- src/onmainwindow.cpp | 349 ++++++++++++++------------------------------------ src/onmainwindow.h | 38 +++--- 4 files changed, 138 insertions(+), 287 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 bugfix/osx in repository x2goclient. commit 2651e925ad028318e91521c973f822de285dd580 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed May 4 23:23:07 2016 +0200 src/onmainwindow.{cpp,h}: hook PulseManager in - for both OS X and Windows. --- debian/changelog | 2 + src/onmainwindow.cpp | 349 ++++++++++++++------------------------------------ src/onmainwindow.h | 38 +++--- 3 files changed, 117 insertions(+), 272 deletions(-) diff --git a/debian/changelog b/debian/changelog index cd04b96..9fea125 100644 --- a/debian/changelog +++ b/debian/changelog @@ -266,6 +266,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - src/configdialog.{cpp,h}: add "no record" support for OS X (through PulseManager.) - src/configdialog.cpp: whitespace only. + - src/onmainwindow.{cpp,h}: hook PulseManager in - for both OS X and + Windows. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 724eefa..15a3b1b 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -147,10 +147,7 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) #ifdef Q_OS_WIN clientSshPort="7022"; - pulsePort=4713; - pulseStarted=false; X2goSettings st ( "settings" ); - pulseNoRecord=st.setting()->value ( "pulse/norecord", false ).toBool(); winSshdStarted=false; #else userSshd=false; @@ -173,7 +170,6 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) #ifdef Q_OS_WIN pulseVersionTest=0l; - pulseServer=0l; xorg=0l; xDisplay=0; #endif @@ -461,6 +457,10 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) QTimer::singleShot ( 500, this, SLOT ( startWinServers() ) ); #endif + /* FIXME: add Linux. */ +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) + QTimer::singleShot (500, this, SLOT (pulseManagerWrapper ())); +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ mainL->setSpacing ( 0 ); mainL->setMargin ( 0 ); @@ -1487,24 +1487,6 @@ void ONMainWindow::closeClient() } #endif #ifdef Q_OS_WIN - if ( pulseServer && pulseStarted ) - { - x2goDebug<<"Deleting the pulse timer ..."; - delete pulseTimer; - x2goDebug<<"Deleted the pulse timer."; - x2goDebug<<"Killing the PulseAudio sound server ..."; - pulseServer->kill(); - x2goDebug<<"Killed the PulseAudio sound server."; - x2goDebug<<"Deleting the PulseAudio process ..."; - delete pulseServer; - x2goDebug<<"Deleted the PulseAudio process."; - - QDir dr ( homeDir ); - dr.remove ( pulseDir+"/config.pa" ); - dr.remove ( pulseDir+"/pulse-pulseuser/pid" ); - dr.rmdir ( pulseDir+"/pulse-pulseuser" ); - dr.rmdir ( pulseDir ); - } if ( xorg ) { x2goDebug<<"Terminating the X.Org Server ..."; @@ -1521,7 +1503,20 @@ void ONMainWindow::closeClient() CloseHandle ( sshd.hProcess ); CloseHandle ( sshd.hThread ); } -#else +#endif /* defined (Q_OS_WIN) */ + +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) + if (pulseManager) { + delete (pulseManager); + + pulseManagerThread->quit (); + pulseManagerThread->wait (); + + delete (pulseManagerThread); + } +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ + +#ifndef (Q_OS_WIN) if ( userSshd && sshd ) { x2goDebug<<"Terminating the OpenSSH server ..."; @@ -1529,8 +1524,8 @@ void ONMainWindow::closeClient() x2goDebug<<"Terminated the OpenSSH server."; delete sshd; } +#endif /* !defined (Q_OS_WIN) */ -#endif if ( embedMode ) { passForm->close(); @@ -2113,11 +2108,31 @@ void ONMainWindow::slotConfig() delete ld; ld=0; +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) + bool oldDisableInput = false; + { + X2goSettings st ("settings"); + oldDisableInput = st.setting ()->value ("pulse/norecord", + (QVariant) false).toBool (); + } +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ + ConfigDialog dlg ( this ); if ( dlg.exec() ==QDialog::Accepted ) { int i; +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) + X2goSettings st ("settings"); + bool newDisableInput = st.setting ()->value ("pulse/norecord", + (QVariant) false).toBool (); + + if (oldDisableInput != newDisableInput) { + pulseManager->set_record (!newDisableInput); + pulseManager->restart (); + } +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ + if ( passForm->isVisible() && !embedMode ) slotClosePass(); if ( sessionStatusDlg->isVisible() || embedMode ) @@ -4979,9 +4994,9 @@ void ONMainWindow::slotRetResumeSess ( bool result, bool sound=true; int sndSystem=PULSE; QString sndPort; -#ifndef Q_OS_WIN +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) sndPort="4713"; -#endif +#endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ bool startSoundServer=true; bool sshSndTunnel=true; @@ -5018,9 +5033,9 @@ void ONMainWindow::slotRetResumeSess ( bool result, sndSystem=ARTS; if ( sndsys=="esd" ) sndSystem=ESD; -#ifndef Q_OS_WIN +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) sndPort=st->setting()->value ( sid+"/sndport" ).toString(); -#endif +#endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ startSoundServer=st->setting()->value ( sid+"/startsoundsystem", true ).toBool(); @@ -5031,7 +5046,7 @@ void ONMainWindow::slotRetResumeSess ( bool result, } -#ifndef Q_OS_WIN +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) bool defPort=st->setting()->value ( sid+ "/defsndport",true ).toBool(); if ( defPort ) @@ -5046,25 +5061,24 @@ void ONMainWindow::slotRetResumeSess ( bool result, break; } } -#endif +#endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ sshSndTunnel=st->setting()->value ( sid+"/soundtunnel", true ).toBool(); -#ifdef Q_OS_WIN - switch ( sndSystem ) - { - case PULSE: - if(!pulseStarted && sound) - { - startPulsed(); - } - sndPort=QString::number ( pulsePort ); - break; - case ESD: - sndPort=QString::number ( esdPort ); - break; +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) + if ((sound) && (!(pulseManager->is_server_running ()))) { + pulseManager->start (); } -#endif + + switch (sndSystem) { + case PULSE: + sndPort = QString::number (pulseManager->getPulsePort ()); + break; + case ESD: + sndPort = QString::number (pulseManager->getEsdPort ()); + break; + } +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ delete st; @@ -5275,7 +5289,7 @@ void ONMainWindow::slotRetResumeSess ( bool result, } else { -#ifndef Q_OS_WIN +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) if ( QFile::exists(homeDir+"/.config/pulse/cookie") ) { pulsecookie_filename = homeDir+"/.config/pulse/cookie"; } @@ -5289,49 +5303,37 @@ void ONMainWindow::slotRetResumeSess ( bool result, resumingSession.sessionId+ "/.pulse-cookie", this, SLOT ( slotPCookieReady ( bool, QString,int ))); } -#else - QString cooFile= - wapiShortFileName ( homeDir ) + - "/.x2go/pulse/.pulse-cookie"; +#else /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ + QString cooFile = QDir::toNativeSeparators (QDir (pulseManager->get_pulse_dir () + + "/.pulse-cookie").absolutePath ()); QString destFile="$HOME/.x2go/C-"+ resumingSession.sessionId+ "/.pulse-cookie"; sshConnection->copyFile(cooFile, destFile, this, SLOT ( slotPCookieReady ( bool, QString,int ))); parecTunnelOk=true; -#endif +#endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ } } if ( sndSystem==ESD ) { -#ifndef Q_OS_WIN +#ifdef Q_OS_LINUX sshConnection->copyFile(homeDir+"/.esd_auth", "$HOME/.esd_auth" ); -#else - QString cooFile= - wapiShortFileName ( homeDir ) + - "/.x2go/pulse/.esd_auth"; +#else /* defined (Q_OS_LINUX) */ + QString cooFile = QDir::toNativeSeparators (QDir (pulseManager->get_pulse_dir () + + "/.esd_auth").absolutePath ()); QString destFile="$HOME/.esd_auth"; sshConnection->copyFile(cooFile, destFile ); - -#endif +#endif /* defined (Q_OS_LINUX) */ } -#ifndef Q_OS_WIN +/* Windows and Darwin are covered by PulseManager. */ +#if !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) if ( startSoundServer ) { soundServer=new QProcess ( this ); QString acmd="artsd",ecmd="esd"; -#ifdef Q_OS_DARWIN - QStringList env = soundServer->environment(); - QDir dir ( appDir ); - dir.cdUp(); - dir.cd ( "esd" ); - env.insert ( 0,"DYLD_LIBRARY_PATH="+ - dir.absolutePath() ); - soundServer->setEnvironment ( env ); - ecmd="\""+dir.absolutePath() +"\"/esd"; -#endif //Q_OS_DARWIN if ( sndSystem==ESD ) soundServer->start ( ecmd+ @@ -5342,11 +5344,11 @@ void ONMainWindow::slotRetResumeSess ( bool result, resumingSession.sndPort ); sndPort=resumingSession.sndPort; } -#endif //Q_OS_WIN +#endif /* !defined (Q_OS_WIN) && !defined (Q_OS_DARWIN) */ if ( sshSndTunnel ) { const char* okSlot=0; -#ifdef Q_OS_WIN +#ifdef Q_OS_WIN /* FIXME: Do we need explicit parec support in PulseManager? */ if ( sndSystem==PULSE ) { parecTunnelOk=false; @@ -6479,6 +6481,29 @@ x2goSession ONMainWindow::getNewSessionFromString ( const QString& string ) return s; } +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) +void ONMainWindow::pulseManagerWrapper () { +#ifdef Q_OS_WIN + if (!embedMode || !config.confSnd || + (config.confSnd && config.useSnd)) +#endif /* defined (Q_OS_WIN) */ + { + pulseManagerThread = new QThread (0); + pulseManager = new PulseManager (); + + pulseManager->moveToThread (pulseManagerThread); + + /* + * Spawn PulseManager::start() once the thread started up successfully. + * Another means of doing that would be via + * QMetaObject::invokeMethod (pulseManager, "start", Qt::QueuedConnection); + */ + connect (pulseManagerThread, SIGNAL (started ()), pulseManager, SLOT (start ())); + + pulseManagerThread->start (); + } +} +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ void ONMainWindow::slotAppDialog() { @@ -9998,15 +10023,11 @@ void ONMainWindow::startWinServers() QString etcDir=homeDir+"/.x2go/etc"; QDir dr ( homeDir ); - pulseServer=0l; - WinServerStarter* xStarter = new WinServerStarter ( WinServerStarter::X, this ); WinServerStarter* sshStarter = new WinServerStarter ( WinServerStarter::SSH, this ); - - if ( !embedMode || !config.confFS || ( config.confFS && config.useFs ) ) { @@ -10015,14 +10036,7 @@ void ONMainWindow::startWinServers() generateEtcFiles(); sshStarter->start(); } - if(embedMode) - { - if ( !config.confSnd || - ( config.confSnd && config.useSnd ) ) - { - startPulsed(); - } - } + // #ifdef CFGCLIENT //x2goDebug<<"Xorg settings: "<< startXorgOnStart <<" useXming: "<< useXming; @@ -10096,177 +10110,6 @@ void ONMainWindow::removeCygwinEntry() } -void ONMainWindow::startPulsed() -{ -#ifdef Q_OS_WIN - if(pulseStarted) - { - return; - } - pulseVersionTest=new QProcess ( 0 ); - pulseVersionTest->start ( "pulse\\pulseaudio.exe --version" ); - - pulseVersionTest->waitForFinished(); - QString pulseVersionLine= - pulseVersionTest->readAllStandardOutput().replace("\n"," ").simplified(); - - x2goDebug <<"PulseAudio version line: "<<pulseVersionLine; - if (pulseVersionLine.contains("pulseaudio 0.", Qt::CaseInsensitive)) - pulseVersionIsLegacy = true; - if (pulseVersionLine.contains("pulseaudio 1.", Qt::CaseInsensitive)) - pulseVersionIsLegacy = true; - if (pulseVersionLine.contains("pulseaudio 2.", Qt::CaseInsensitive)) - pulseVersionIsLegacy = true; - - if (pulseVersionIsLegacy) - { - x2goDebug <<"PulseAudio <= 2.1 detected. PulseAudio will automatically use .pulse-cookie"; - } - else - { - x2goDebug <<"PulseAudio >= 3.0 detected. X2Go Client will tell PulseAudio to use .pulse-cookie."; - } -#endif - while ( isServerRunning ( pulsePort ) ) - ++pulsePort; - esdPort=pulsePort+1; - while ( isServerRunning ( esdPort ) ) - ++esdPort; - - // The permanent dir for the pulse auth cookie - pulseBaseDir=homeDir+"/.x2go/pulse"; - QDir dr ( homeDir ); - dr.mkpath ( pulseBaseDir ); - - // The tempoerary dir for config.pa (and pulse.log if it exists) - pulseDir=pulseBaseDir; - pulseDir=wapiShortFileName ( pulseDir ); - x2goDebug<<"PulseAudio template: "<<pulseDir+"/tmp"; - QTemporaryFile* fl=new QTemporaryFile ( pulseDir+"/tmp" ); - fl->open(); - pulseDir=fl->fileName(); - fl->close(); - delete fl; - QFile::remove ( pulseDir ); - dr.mkpath ( pulseDir ); - - x2goDebug<<"PulseAudio tmp file: "<<pulseDir; - - QStringList pEnv=QProcess::systemEnvironment(); - for ( int i=0; i<pEnv.size(); ++i ) - { - if ( pEnv[i].indexOf ( "USERPROFILE=" ) !=-1 ) - pEnv[i]="USERPROFILE="+ - QDir::toNativeSeparators( wapiShortFileName( pulseBaseDir )); - if ( pEnv[i].indexOf ( "TEMP=" ) !=-1 ) - pEnv[i]="TEMP="+pulseDir; - if ( pEnv[i].indexOf ( "USERNAME=" ) !=-1 ) - pEnv[i]="USERNAME=pulseuser"; - } - - QFile file ( pulseDir+"/config.pa" ); - if ( !file.open ( QIODevice::WriteOnly | QIODevice::Text ) ) - return; - QTextStream out ( &file ); - /* - Reference: - http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modul... - - Setting auth-cookie fixes bug #422 - - PulseAudio 6.0 changed the path that auth-cookie is relative to, so - Tanu Kaskinen recommended we specify the absolute path instead. - The abs path works with at least 5.0 and 6.0 - */ - if (pulseVersionIsLegacy) - { - out << "load-module module-native-protocol-tcp port="+ - QString::number ( pulsePort ) <<endl; - } - else - { - pulseCookieArg="auth-cookie="+ - QDir::toNativeSeparators (wapiShortFileName( pulseBaseDir))+ - "\\.pulse-cookie"; - // Double backslashes are required in config.pa - pulseCookieArg.replace("\\", "\\\\"); - out << "load-module module-native-protocol-tcp port="+ - QString::number ( pulsePort )+" "+pulseCookieArg <<endl; - } - out << "load-module module-esound-protocol-tcp port="+ - QString::number ( esdPort ) <<endl; - out << "load-module module-waveout"; -#ifdef Q_OS_WIN - if(pulseNoRecord) - out << " record=0"; -#endif - out << endl; - file.close(); - pulseServer=new QProcess ( 0 ); - pulseServer->setEnvironment ( pEnv ); - pulseArgs.clear(); -#ifdef Q_OS_WIN - // FIXME: Explain why this dir needs to be created. - pulseRuntimeDir=pulseBaseDir+"/.pulse/"+QHostInfo::localHostName ()+"-runtime"; - QDir drr(pulseRuntimeDir); - if (!drr.exists()) - drr.mkpath(drr.path()); - if (QFile::exists(pulseRuntimeDir+"/pid")) - QFile::remove(pulseRuntimeDir+"/pid"); - - pulseDir=QDir::toNativeSeparators( pulseDir ); - pulseArgs<<"--exit-idle-time=-1"<<"-n"<<"-F"<<pulseDir+"\\config.pa"; - if (debugging) - pulseArgs<<"--log-level=debug"<<"--verbose"<<"--log-target=file:"+pulseDir+"\\pulse.log"; - /* - Fix for x2goclient bug #526. - Works Around PulseAudio bug #80772. - Tested with PulseAudio 5.0. - This argument will not cause PulseAudio 0.9.6 or 1.1 (the legacy versions) - to fail to launch. - However, 0.9.6 defaults to normal priority anyway, - and 1.1 ignores it for some reason. - So yes, the fact that 1.1 ignores it would be a bug in x2goclient if we - ever ship 1.1 again. - */ - if (QSysInfo::WindowsVersion == QSysInfo::WV_XP || - QSysInfo::WindowsVersion == QSysInfo::WV_2003 ) - { - x2goDebug<<"Windows XP or Server 2003 (R2) detected."; - x2goDebug<<"Setting PulseAudio to \"normal\" CPU priority."; - pulseArgs<<"--high-priority=no"; - } -#else - pulseArgs<<"--exit-idle-time=-1"<<"-n"<<"-F"<<pulseDir+"/config.pa"; -#endif - pulseServer->setWorkingDirectory ( QDir::toNativeSeparators ( - wapiShortFileName ( appDir+"/pulse/" ) ) ); - pulseServer->start ( "pulse\\pulseaudio.exe",pulseArgs ); - - x2goDebug<<"Starting pulse\\pulseaudio.exe "<<pulseArgs.join ( " " ) << - " working dir: "<< - QDir::toNativeSeparators ( wapiShortFileName ( appDir+"/pulse" ) ); - - pulseTimer=new QTimer(this); - - connect (pulseTimer, SIGNAL(timeout()), this, SLOT(slotCheckPulse())); - x2goDebug<<"Connected timer."; - pulseTimer->start(2000); - pulseStarted=true; -} - -void ONMainWindow::slotCheckPulse() -{ - //restart pulse server - if(pulseServer->state()!=QProcess::Running) - { - pulseServer->start ( "pulse\\pulseaudio.exe",pulseArgs ); - - x2goDebug<<"Restarting pulse\\pulseaudio.exe "<<pulseArgs.join ( " " ); - - } -} - // #ifdef CFGCLIENT void ONMainWindow::xorgSettings() diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 0962ac6..65f5e6f 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -52,6 +52,11 @@ #include <windows.h> #include <QSysInfo> #endif + +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) +#include "pulsemanager.h" +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ + /** @author Oleksandr Shneyder */ @@ -248,7 +253,7 @@ class ONMainWindow; class WinServerStarter: public QThread { public: - enum daemon {X,SSH,PULSE}; + enum daemon {X,SSH}; WinServerStarter ( daemon server, ONMainWindow * par ); void run(); private: @@ -575,7 +580,6 @@ public: #ifdef Q_OS_WIN static QString cygwinPath ( const QString& winPath ); void startXOrg(); - void startPulsed(); static bool haveCygwinEntry(); static void removeCygwinEntry(); static QString U3DevicePath() @@ -830,14 +834,7 @@ private: PROCESS_INFORMATION sshd; bool winSshdStarted; static QString u3Device; - bool pulseStarted; - - QString pulseVersionTestOutput; - QProcess* pulseVersionTest; - bool pulseVersionIsLegacy; - QProcess* pulseServer; - QStringList pulseArgs; - QTimer* pulseTimer; + int xDisplay; int sshdPort; bool winServersReady; @@ -847,14 +844,6 @@ private: bool cyEntry; - QString pulseDir; - QString pulseBaseDir; - QString pulseRuntimeDir; - QString pulseCookieArg; - int pulsePort; - bool pulseNoRecord; - - int esdPort; bool maximizeProxyWin; int proxyWinWidth; int proxyWinHeight; @@ -867,6 +856,12 @@ private: QTextEdit* stInfo; int localDisplayNumber; +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) + QThread *pulseManagerThread; + PulseManager *pulseManager; +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ + + SVGFrame* ln; int tunnel; int sndTunnel; @@ -1010,9 +1005,14 @@ private slots: void startWinServers(); void slotCheckXOrgLog(); void slotCheckXOrgConnection(); - void slotCheckPulse(); void slotStartParec (); #endif + +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) +private slots: + void pulseManagerWrapper (); +#endif /* defined (Q_OS_DARWIN) || defined (Q_OS_WIN) */ + private slots: void slotAppDialog(); void slotShowPassForm(); -- 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 bugfix/osx in repository x2goclient. commit 1faee7cc180a8fa8fad60acad13ad1e32e846031 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed May 4 23:24:43 2016 +0200 src/mediawidget.cpp: reflect new capabilities through PulseManager. --- debian/changelog | 1 + src/mediawidget.cpp | 35 ++++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9fea125..ce565f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -268,6 +268,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - src/configdialog.cpp: whitespace only. - src/onmainwindow.{cpp,h}: hook PulseManager in - for both OS X and Windows. + - src/mediawidget.cpp: reflect new capabilities through PulseManager. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/mediawidget.cpp b/src/mediawidget.cpp index 03b952f..c937ba4 100644 --- a/src/mediawidget.cpp +++ b/src/mediawidget.cpp @@ -71,7 +71,7 @@ MediaWidget::MediaWidget ( QString id, ONMainWindow * mw, cbDefSndPort=new QCheckBox ( tr ( "Use default sound port" ),sbgr ); sbSndPort=new QSpinBox ( sbgr ); sbSndPort->setMinimum ( 1 ); - sbSndPort->setMaximum ( 99999999 ); + sbSndPort->setMaximum ( 65535 ); QHBoxLayout *sndPortLay = new QHBoxLayout(); @@ -93,22 +93,17 @@ MediaWidget::MediaWidget ( QString id, ONMainWindow * mw, sLay_opt->addLayout ( sndPortLay ); sndLay->addWidget ( sound ); sndLay->addLayout ( sLay ); -#ifdef Q_OS_WIN +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) arts->hide(); hl->hide(); cbDefSndPort->hide(); lSndPort->hide(); sbSndPort->hide(); -#endif +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ cbClientPrint=new QCheckBox ( tr ( "Client side printing support" ), this ); -#ifdef Q_OS_DARWIN - arts->hide(); - pulse->hide(); - esd->setChecked ( true ); -#endif setLay->addWidget(sbgr); setLay->addWidget ( cbClientPrint ); setLay->addStretch(); @@ -166,7 +161,12 @@ void MediaWidget::slot_sndSysSelected ( int system ) cbSndSshTun->show(); cbSndSshTun->setEnabled ( false ); cbSndSshTun->setChecked ( true ); -#endif +#elif defined (Q_OS_DARWIN) + rbStartSnd->hide (); + rbNotStartSnd->hide (); + cbSndSshTun->show (); + cbSndSshTun->setEnabled (true); +#endif /* defined (Q_OS_WIN) */ sbSndPort->setValue ( 16001 ); break; } @@ -184,8 +184,16 @@ void MediaWidget::slot_sndToggled ( bool val ) rbNotStartSnd->setEnabled ( val ); cbSndSshTun->setEnabled ( false ); - if ( pulse->isChecked() ) + /* ESD is also handled by PA on Windows and OS X. */ +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) + if ((pulse->isChecked ()) || (esd->isChecked ())) { + cbSndSshTun->setEnabled (val); + } +#else + if (pulse->isChecked ()) { cbSndSshTun->setEnabled ( val ); + } +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ lSndPort->setEnabled ( val ); if ( !arts->isChecked() ) cbDefSndPort->setEnabled ( val ); @@ -261,20 +269,17 @@ void MediaWidget::readConfig() pulse->setChecked ( true ); slot_sndSysSelected ( PULSE ); -#ifdef Q_OS_WIN +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) if ( sndsys=="arts" ) { sndsys="pulse"; } -#endif +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ if ( sndsys=="arts" ) { arts->setChecked ( true ); slot_sndSysSelected ( ARTS ); } -#ifdef Q_OS_DARWIN - sndsys="esd"; -#endif if ( sndsys=="esd" ) { esd->setChecked ( true ); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git