diff options
-rw-r--r-- | src/Makefile.am | 7 | ||||
-rw-r--r-- | src/paprefs.cc | 32 |
2 files changed, 31 insertions, 8 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 7729bee..f304f2d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,6 +17,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. +# Needs fixing on some borked OS +SHREXT=.so + desktopdir = $(datadir)/applications gladedir = $(pkgdatadir) localedir = $(datadir)/locale @@ -29,8 +32,8 @@ desktop_DATA=$(desktop_in_files:.desktop.in=.desktop) paprefs_SOURCES=paprefs.cc paprefs_LDADD=$(AM_LDADD) $(GUILIBS_LIBS) -paprefs_CXXFLAGS=$(AM_CXXFLAGS) $(GUILIBS_CFLAGS) -paprefs_CXXFLAGS+=-DGLADE_FILE=\"$(gladedir)/paprefs.glade\" -DLOCALEDIR=\"$(localedir)\" +paprefs_CXXFLAGS=$(AM_CXXFLAGS) $(GUILIBS_CFLAGS) +paprefs_CXXFLAGS+=-DGLADE_FILE=\"$(gladedir)/paprefs.glade\" -DLOCALEDIR=\"$(localedir)\" -DMODULESDIR=\""${libdir}/pulse-0.9/modules/"\" -DSHREXT=\"$(SHREXT)\" EXTRA_DIST = $(glade_DATA) $(desktop_in_files) diff --git a/src/paprefs.cc b/src/paprefs.cc index 2cad665..871f2de 100644 --- a/src/paprefs.cc +++ b/src/paprefs.cc @@ -63,10 +63,13 @@ public: void onChangeRtpReceive(); void onChangeRtpSend(); void readFromGConf(); + void checkForModules(); void writeToGConfRemoteAccess(); void writeToGConfRtpReceive(); void writeToGConfRtpSend(); void onGConfChange(const Glib::ustring& key, const Gnome::Conf::Value& value); + + bool rtpRecvAvailable, rtpSendAvailable, zeroconfAvailable, remoteAvailable; }; MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& x) : @@ -89,6 +92,8 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade: Gdk::Color c("white"); titleEventBox->modify_bg(Gtk::STATE_NORMAL, c); + checkForModules(); + gconf = Gnome::Conf::Client::get_default_client(); gconf->set_error_handling(Gnome::Conf::CLIENT_HANDLE_ALL); gconf->add_dir(PA_GCONF_ROOT, Gnome::Conf::CLIENT_PRELOAD_RECURSIVE); @@ -125,15 +130,18 @@ void MainWindow::onCloseButtonClicked() { void MainWindow::updateSensitive() { bool b; + remoteAccessCheckButton->set_sensitive(remoteAvailable); b = remoteAccessCheckButton->get_active(); - zeroconfCheckButton->set_sensitive(b); - anonymousAuthCheckButton->set_sensitive(b); + zeroconfCheckButton->set_sensitive(b && zeroconfAvailable); + anonymousAuthCheckButton->set_sensitive(b && remoteAvailable); + rtpReceiveCheckButton->set_sensitive(rtpRecvAvailable); + rtpSendCheckButton->set_sensitive(rtpSendAvailable); b = rtpSendCheckButton->get_active(); - rtpLoopbackCheckButton->set_sensitive(b && !rtpSpeakerRadioButton->get_active()); - rtpMikeRadioButton->set_sensitive(b); - rtpSpeakerRadioButton->set_sensitive(b); - rtpNullSinkRadioButton->set_sensitive(b); + rtpLoopbackCheckButton->set_sensitive(b && !rtpSpeakerRadioButton->get_active() && rtpSendAvailable); + rtpMikeRadioButton->set_sensitive(b && rtpSendAvailable); + rtpSpeakerRadioButton->set_sensitive(b && rtpSendAvailable); + rtpNullSinkRadioButton->set_sensitive(b && rtpSendAvailable); } void MainWindow::onChangeRemoteAccess() { @@ -303,6 +311,18 @@ void MainWindow::readFromGConf() { updateSensitive(); } +void MainWindow::checkForModules() { + + remoteAvailable = + access(MODULESDIR "module-esound-protocol-tcp" SHREXT, F_OK) == 0 || + access(MODULESDIR "module-native-protocol-tcp" SHREXT, F_OK) == 0; + + zeroconfAvailable = access(MODULESDIR "module-zeroconf-publish" SHREXT, F_OK) == 0; + + rtpRecvAvailable = access(MODULESDIR "module-rtp-recv" SHREXT, F_OK) == 0; + rtpSendAvailable = access(MODULESDIR "module-rtp-send" SHREXT, F_OK) == 0; +} + int main(int argc, char *argv[]) { /* Initialize the i18n stuff */ |