From 88dbb997a823ff77f752ac08105d12474345dfcb Mon Sep 17 00:00:00 2001 From: Sebastien Braun Date: Wed, 4 Aug 2010 17:24:21 +0200 Subject: Implement GUI for receiving incoming multicast transfers --- src/pvsgui.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/pvsgui.cpp') diff --git a/src/pvsgui.cpp b/src/pvsgui.cpp index 25f1cd6..e949d5b 100644 --- a/src/pvsgui.cpp +++ b/src/pvsgui.cpp @@ -119,6 +119,7 @@ PVSGUI::PVSGUI(QWidget *parent) : connect(_ifaceDBus, SIGNAL(disconnected()), this, SLOT(disconnected())); connect(_ifaceDBus, SIGNAL(addHost(QString)), this, SLOT(addHost(QString))); connect(_ifaceDBus, SIGNAL(delHost(QString)), this, SLOT(delHost(QString))); + connect(_ifaceDBus, SIGNAL(incomingMulticastTransferNew(qulonglong, QString, QString, qulonglong)), SLOT(incomingMulticastFile(qulonglong, QString, QString, qulonglong))); // show toolbar setWindowFlags(Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint); @@ -421,6 +422,12 @@ void PVSGUI::receiveFile() d->open(); } +void PVSGUI::incomingMulticastFile(qulonglong transferID, QString sender, QString basename, qulonglong size) +{ + ClientFileReceiveDialog *d = new ClientFileReceiveDialog(sender, transferID, basename, size, _ifaceDBus, this); + d->open(); +} + //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3-55-g7522 From f8e6e94b25a092d51acdec600465074b4eb32cb8 Mon Sep 17 00:00:00 2001 From: Sebastien Braun Date: Wed, 4 Aug 2010 17:28:45 +0200 Subject: Make PGM interface configurable --- src/gui/clientConfigDialog.cpp | 61 +++++++++++++++++++++++++++++++++++++- src/gui/clientConfigDialog.h | 2 ++ src/gui/ui/clientConfigDialog.ui | 64 ++++++++++++++++++++++++++++++++++++++-- src/pvs.cpp | 7 +++++ src/pvs.h | 2 +- src/pvsgui.cpp | 3 ++ 6 files changed, 134 insertions(+), 5 deletions(-) (limited to 'src/pvsgui.cpp') diff --git a/src/gui/clientConfigDialog.cpp b/src/gui/clientConfigDialog.cpp index 76b4f5e..3867118 100644 --- a/src/gui/clientConfigDialog.cpp +++ b/src/gui/clientConfigDialog.cpp @@ -16,15 +16,32 @@ # ----------------------------------------------------------------------------- */ +#include #include "clientConfigDialog.h" +#include +#include +#include + +// For getting the network interface list: +#ifdef __linux +# include +# include +#endif + +using namespace std; ClientConfigDialog::ClientConfigDialog(QWidget *parent) : - QDialog(parent) + QDialog(parent), + _interfaceListModel(0) { setupUi(this); connect(this, SIGNAL(accepted()), this, SLOT(writeSettings())); connect(radioButtonOtherRO, SIGNAL(clicked()), this, SLOT(checkPermissions())); + connect(reloadInterfaceListButton, SIGNAL(clicked()), this, SLOT(reloadNetworkInterfaceList())); + reloadNetworkInterfaceList(); + interfaceList->setModel(_interfaceListModel); + interfaceList->setModelColumn(0); } @@ -66,6 +83,9 @@ void ClientConfigDialog::readSettings() checkBoxAllowFiletransfer->setChecked(_settings.value( "Permissions/allow_filetransfer").toBool()); + if(!_settings.value("Muticast/interface").isNull()) + interfaceList->setEditText(_settings.value("Multicast/interface").toString()); + qDebug("[%s] Setting read from: '%s'", metaObject()->className(), qPrintable(_settings.fileName())); } @@ -88,6 +108,7 @@ void ClientConfigDialog::writeSettings() _settings.setValue("Permissions/allow_chat", checkBoxAllowChat->isChecked()); _settings.setValue("Permissions/allow_filetransfer", checkBoxAllowFiletransfer->isChecked()); + _settings.setValue("Multicast/interface", interfaceList->currentText()); _settings.sync(); emit configChanged(); @@ -103,3 +124,41 @@ void ClientConfigDialog::checkPermissions() if (radioButtonLecturerNO->isChecked() && radioButtonOtherRO->isChecked()) radioButtonLecturerRO->setChecked(true); } + +void ClientConfigDialog::reloadNetworkInterfaceList() +{ +#ifdef __linux + static struct ifreq ifreqs[20]; + ifconf ifconfigs; + memset(&ifconfigs, 0, sizeof(ifconfigs)); + ifconfigs.ifc_len = sizeof(ifreqs); + ifconfigs.ifc_buf = (char*)&ifreqs; + + int nosock = socket(AF_INET, SOCK_STREAM, 0); + if (nosock < 0) + { + qWarning() << "Could not get a socket descriptor:" << strerror(errno); + } + int retval; + if ((retval = ioctl(nosock, SIOCGIFCONF, (char*)(&ifconfigs))) < 0) + { + qWarning() << "Could not get the list of interfaces:" << strerror(errno); + return; + } + + QStringList interfaces; + for(int i = 0; i < ifconfigs.ifc_len/sizeof(struct ifreq); i++) + { + char ifname[IFNAMSIZ + 1]; + strncpy(ifname, ifreqs[i].ifr_name, IFNAMSIZ); + ifname[IFNAMSIZ] = '\0'; + interfaces << QString::fromLocal8Bit(ifname); + } + if(!_interfaceListModel) + _interfaceListModel = new QStringListModel(interfaces, this); + else + _interfaceListModel->setStringList(interfaces); +#else +# warning "We have no way to get your system's network interface list. Some porting may be required." +#endif +} diff --git a/src/gui/clientConfigDialog.h b/src/gui/clientConfigDialog.h index 706bd8a..803f2c8 100644 --- a/src/gui/clientConfigDialog.h +++ b/src/gui/clientConfigDialog.h @@ -35,9 +35,11 @@ Q_SIGNALS: private Q_SLOTS: void checkPermissions(); + void reloadNetworkInterfaceList(); private: QSettings _settings; + QStringListModel* _interfaceListModel; }; diff --git a/src/gui/ui/clientConfigDialog.ui b/src/gui/ui/clientConfigDialog.ui index 3262b6b..bb4bdc9 100644 --- a/src/gui/ui/clientConfigDialog.ui +++ b/src/gui/ui/clientConfigDialog.ui @@ -6,8 +6,8 @@ 0 0 - 438 - 257 + 445 + 266 @@ -27,7 +27,7 @@ QTabWidget::North - 0 + 2 @@ -197,6 +197,64 @@ + + + + 0 + 0 + + + + false + + + Network + + + + + + + 0 + 0 + + + + true + + + QComboBox::NoInsert + + + true + + + + + + + + 0 + 0 + + + + Network Interface + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Reload List + + + + + diff --git a/src/pvs.cpp b/src/pvs.cpp index 202aa32..c217d52 100644 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -728,6 +728,13 @@ void PVS::cancelIncomingMulticastTransfer(qulonglong transferID) } } +void PVS::setMulticastInterface(QString const& interfaceName) +{ + QSettings settings; + settings.setValue("multicast/interface", interfaceName); + settings.sync(); +} + void PVS::onIncomingMulticastTransfer(QString const& sender, qulonglong transferID, QString const& basename, qulonglong size, ushort port) { diff --git a/src/pvs.h b/src/pvs.h index ef6454e..4c61ffd 100644 --- a/src/pvs.h +++ b/src/pvs.h @@ -87,7 +87,7 @@ public Q_SLOTS: bool createMulticastTransfer(QString const& objectPath, quint64& transferID, QString& errorReason); void cancelOutgoingMulticastTransfer(quint64 transferID); void cancelIncomingMulticastTransfer(qulonglong transferID); - + void setMulticastInterface(QString const& interfaceName); Q_SIGNALS: void project(QString host, int port, QString passwd, bool fullscreen, diff --git a/src/pvsgui.cpp b/src/pvsgui.cpp index e949d5b..40112b4 100644 --- a/src/pvsgui.cpp +++ b/src/pvsgui.cpp @@ -143,6 +143,9 @@ void PVSGUI::updateConfig() setLocation(POSITION_TOP_CENTER); else setLocation(_settings.value("Display/location").toInt()); + + if (!_settings.value("Multicast/interface").isNull()) + _ifaceDBus->setMulticastInterface(_settings.value("Multicast/interface").toString()); } //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3-55-g7522 From a498546d6200bdce6027110122d518b15747b3c1 Mon Sep 17 00:00:00 2001 From: jjl Date: Thu, 14 Oct 2010 17:57:55 +0200 Subject: [PVSGUI] No X required for --help and --version --- AUTHORS | 11 ++++++----- CMakeLists.txt | 4 ++-- TRANSLATION | 4 +--- src/pvsgui.cpp | 37 +++++++++++++++++++------------------ src/version.h | 4 ++-- 5 files changed, 30 insertions(+), 30 deletions(-) (limited to 'src/pvsgui.cpp') diff --git a/AUTHORS b/AUTHORS index daf9a81..a081ceb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,19 +2,20 @@ Initial design and first versions: Simon Wittenberg Involved team members at the moment: +Fabian Schillinger +Johann Latocha +Sébastien Braun + +Credits of left team members: Johann Betz Javier Castillo -Johann Latocha Achille Nana Simon Rettberg Fadi Salameh Alexander Hoppe Benjamin Lieberwirt -Credits of left team members: -- - Project management, supervision: Dirk von Suchodoletz Sebastian Schmelzer -Simon Wittenberg \ No newline at end of file +Johann Latocha \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index cc695ce..a78e1ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -445,8 +445,8 @@ SET( CPACK_GENERATOR "DEB;RPM" ) SET( CPACK_SET_DESTDIR "ON" ) SET( CPACK_PACKAGE_NAME "pvs" ) SET( CPACK_PACKAGE_VERSION_MAJOR "2" ) -SET( CPACK_PACKAGE_VERSION_MINOR "0" ) -SET( CPACK_PACKAGE_VERSION_PATCH "3" ) +SET( CPACK_PACKAGE_VERSION_MINOR "8" ) +SET( CPACK_PACKAGE_VERSION_PATCH "0" ) SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Pool Video Switch" ) SET( CPACK_PACKAGE_DESCRIPTION "") SET( CPACK_PACKAGE_CONTACT "Simon Wittenberg " ) diff --git a/TRANSLATION b/TRANSLATION index 74a10cb..1d04f06 100644 --- a/TRANSLATION +++ b/TRANSLATION @@ -1,4 +1,2 @@ Javier Castillo -Johann Latocha -Achille Nana -Fadi Salameh \ No newline at end of file +Johann Latocha \ No newline at end of file diff --git a/src/pvsgui.cpp b/src/pvsgui.cpp index eb1383b..1520c81 100644 --- a/src/pvsgui.cpp +++ b/src/pvsgui.cpp @@ -450,24 +450,6 @@ void printVersion() int main(int argc, char *argv[]) { - QtSingleApplication app(argc, argv); - app.setQuitOnLastWindowClosed(false); - app.setOrganizationName("openslx"); - app.setOrganizationDomain("openslx.org"); - app.setApplicationName("pvsgui"); - - // only one instance should be allowed - if (app.sendMessage("")) - { - qDebug("[PVSGUI] ERROR: Already running. Exiting"); - return 0; - } - - // use system locale as language to translate gui - QTranslator translator; - translator.load(":pvsgui"); - app.installTranslator(&translator); - bool visible = false; int position = -1; @@ -506,6 +488,25 @@ int main(int argc, char *argv[]) opt = getopt_long( argc, argv, optString, longOpts, &longIndex ); } + + QtSingleApplication app(argc, argv); + app.setQuitOnLastWindowClosed(false); + app.setOrganizationName("openslx"); + app.setOrganizationDomain("openslx.org"); + app.setApplicationName("pvsgui"); + + // only one instance should be allowed + if (app.sendMessage("")) + { + qDebug("[PVSGUI] ERROR: Already running. Exiting"); + return 0; + } + + // use system locale as language to translate gui + QTranslator translator; + translator.load(":pvsgui"); + app.installTranslator(&translator); + PVSGUI pvsgui; pvsgui.setPosition(position); pvsgui.setVisible(visible); diff --git a/src/version.h b/src/version.h index de5c6aa..a08c819 100644 --- a/src/version.h +++ b/src/version.h @@ -1,2 +1,2 @@ -#define VERSION_STRING "2.0.5" -#define VERSION_NUMBER 205 +#define VERSION_STRING "2.8.0" +#define VERSION_NUMBER 280 -- cgit v1.2.3-55-g7522