From cbfe94d6a287ceb31340596623235a9caaa2969d Mon Sep 17 00:00:00 2001 From: agilob Date: Tue, 6 Jan 2015 14:36:03 +0000 Subject: [PATCH 01/11] closes tux3/qtox#988 --- src/widget/form/genericchatform.cpp | 33 +++++++++++++++++------------ 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/widget/form/genericchatform.cpp b/src/widget/form/genericchatform.cpp index 411af8350..0e0701367 100644 --- a/src/widget/form/genericchatform.cpp +++ b/src/widget/form/genericchatform.cpp @@ -57,7 +57,10 @@ GenericChatForm::GenericChatForm(QWidget *parent) : QVBoxLayout *mainLayout = new QVBoxLayout(), *footButtonsSmall = new QVBoxLayout(), - *volMicLayout = new QVBoxLayout(); + *micButtonsLayout = new QVBoxLayout(); + + QGridLayout *buttonsLayout = new QGridLayout(); + headTextLayout = new QVBoxLayout(); chatWidget = new ChatAreaWidget(); @@ -123,23 +126,25 @@ GenericChatForm::GenericChatForm(QWidget *parent) : mainFootLayout->addWidget(sendButton); mainFootLayout->setSpacing(0); - headTextLayout->addStretch(); + headTextLayout->addStretch(); headTextLayout->addWidget(nameLabel); + headTextLayout->addStretch(); + + micButtonsLayout->addWidget(micButton, Qt::AlignTop | Qt::AlignRight); + micButtonsLayout->addWidget(volButton, Qt::AlignTop | Qt::AlignRight); + + buttonsLayout->addLayout(micButtonsLayout, 0, 0, Qt::AlignTop | Qt::AlignRight); + buttonsLayout->addWidget(callButton, 0, 1, 2, 1, Qt::AlignTop); + buttonsLayout->addWidget(videoButton, 0, 2, 2, 1, Qt::AlignTop); + buttonsLayout->setSpacing(1); - volMicLayout->addWidget(micButton, Qt::AlignTop); - volMicLayout->addSpacing(2); - volMicLayout->addWidget(volButton, Qt::AlignBottom); + headLayout->addWidget(avatar, Qt::AlignTop | Qt::AlignLeft); + headLayout->addSpacing(5); + headLayout->addLayout(headTextLayout, Qt::AlignTop | Qt::AlignAbsolute); + headLayout->addLayout(buttonsLayout, Qt::AlignTop | Qt::AlignRight); headWidget->setLayout(headLayout); - headLayout->addWidget(avatar); - headLayout->addSpacing(5); - headLayout->addLayout(headTextLayout); - headLayout->addLayout(volMicLayout); - headLayout->addWidget(callButton); - headLayout->addSpacing(3); - headLayout->addWidget(videoButton); - headLayout->setSpacing(0); - + //Fix for incorrect layouts on OS X as per //https://bugreports.qt-project.org/browse/QTBUG-14591 sendButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); From 3a107e33c8c4bd69926d72efc2a20f51792c3896 Mon Sep 17 00:00:00 2001 From: derMart Date: Mon, 12 Jan 2015 16:10:12 +0100 Subject: [PATCH 02/11] fix utf8 audio device specifier names on windows --- src/widget/form/settings/avform.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/widget/form/settings/avform.cpp b/src/widget/form/settings/avform.cpp index 31f9b6dd9..96bfce2c8 100644 --- a/src/widget/form/settings/avform.cpp +++ b/src/widget/form/settings/avform.cpp @@ -140,7 +140,11 @@ void AVForm::getAudioInDevices() while (*pDeviceList) { int len = strlen(pDeviceList); - QString inDev = QString::fromLocal8Bit(pDeviceList,len); +#ifdef Q_OS_WIN32 + QString inDev = QString::fromUtf8(pDeviceList,len); +#else + QString inDev = QString::fromLocal8Bit(pDeviceList,len); +#endif bodyUI->inDevCombobox->addItem(inDev); if (settingsInDev == inDev) { @@ -170,7 +174,11 @@ void AVForm::getAudioOutDevices() while (*pDeviceList) { int len = strlen(pDeviceList); - QString outDev = QString::fromLocal8Bit(pDeviceList,len); +#ifdef Q_OS_WIN32 + QString outDev = QString::fromUtf8(pDeviceList,len); +#else + QString outDev = QString::fromLocal8Bit(pDeviceList,len); +#endif bodyUI->outDevCombobox->addItem(outDev); if (settingsOutDev == outDev) { From e5d736e6c0973a771cc6cec66397ef4519f6095e Mon Sep 17 00:00:00 2001 From: derMart Date: Mon, 12 Jan 2015 16:11:04 +0100 Subject: [PATCH 03/11] fix videosurface flipping buffers --- src/widget/videosurface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/videosurface.cpp b/src/widget/videosurface.cpp index 48ae9d015..c7d263033 100644 --- a/src/widget/videosurface.cpp +++ b/src/widget/videosurface.cpp @@ -30,7 +30,7 @@ VideoSurface::VideoSurface(QWidget* parent) , hasSubscribed(false) , pboIndex(0) { - setAutoBufferSwap(false); + setAutoBufferSwap(true); } VideoSurface::VideoSurface(VideoSource *source, QWidget* parent) From 7d11e9192c76fd3372229aa82292e5486a8f02d6 Mon Sep 17 00:00:00 2001 From: derMart Date: Mon, 12 Jan 2015 16:50:00 +0100 Subject: [PATCH 04/11] 0x0 resolution removed better camera initializing in av settings --- src/video/cameraworker.cpp | 2 +- src/widget/form/settings/avform.cpp | 8 +++++++- src/widget/form/settings/avform.h | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/video/cameraworker.cpp b/src/video/cameraworker.cpp index da98e58f4..f7304520c 100644 --- a/src/video/cameraworker.cpp +++ b/src/video/cameraworker.cpp @@ -112,7 +112,7 @@ void CameraWorker::_probeResolutions() //qDebug() << "PROBING:" << res << " got " << w << h; - if (!resolutions.contains(QSize(w,h))) + if (w>0 && h>0 && !resolutions.contains(QSize(w,h))) resolutions.append(QSize(w,h)); } diff --git a/src/widget/form/settings/avform.cpp b/src/widget/form/settings/avform.cpp index 96bfce2c8..42c587631 100644 --- a/src/widget/form/settings/avform.cpp +++ b/src/widget/form/settings/avform.cpp @@ -67,6 +67,10 @@ void AVForm::present() Camera::getInstance()->probeProp(Camera::HUE); Camera::getInstance()->probeResolutions(); + + bodyUI->videoModescomboBox->blockSignals(true); + bodyUI->videoModescomboBox->addItem(tr("Initializing Camera...")); + bodyUI->videoModescomboBox->blockSignals(false); } void AVForm::on_ContrastSlider_sliderMoved(int position) @@ -89,7 +93,7 @@ void AVForm::on_HueSlider_sliderMoved(int position) Camera::getInstance()->setProp(Camera::HUE, position / 100.0); } -void AVForm::on_videoModescomboBox_activated(int index) +void AVForm::on_videoModescomboBox_currentIndexChanged(int index) { Camera::getInstance()->setResolution(bodyUI->videoModescomboBox->itemData(index).toSize()); } @@ -118,8 +122,10 @@ void AVForm::onPropProbingFinished(Camera::Prop prop, double val) void AVForm::onResProbingFinished(QList res) { bodyUI->videoModescomboBox->clear(); + bodyUI->videoModescomboBox->blockSignals(true); for (QSize r : res) bodyUI->videoModescomboBox->addItem(QString("%1x%2").arg(QString::number(r.width()),QString::number(r.height())), r); + bodyUI->videoModescomboBox->blockSignals(false); bodyUI->videoModescomboBox->setCurrentIndex(bodyUI->videoModescomboBox->count()-1); } diff --git a/src/widget/form/settings/avform.h b/src/widget/form/settings/avform.h index 64b34d410..f691d6c27 100644 --- a/src/widget/form/settings/avform.h +++ b/src/widget/form/settings/avform.h @@ -47,7 +47,7 @@ private slots: void on_SaturationSlider_sliderMoved(int position); void on_BrightnessSlider_sliderMoved(int position); void on_HueSlider_sliderMoved(int position); - void on_videoModescomboBox_activated(int index); + void on_videoModescomboBox_currentIndexChanged(int index); // audio void onInDevChanged(const QString& deviceDescriptor); From 290f6d4697d02ac43df600401b1a0d62e4684fcf Mon Sep 17 00:00:00 2001 From: derMart Date: Mon, 12 Jan 2015 17:36:57 +0100 Subject: [PATCH 05/11] refactoring audio device initialization in av setting to prevent opening devices twice --- src/widget/form/settings/avform.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/widget/form/settings/avform.cpp b/src/widget/form/settings/avform.cpp index 42c587631..4bf5d18f6 100644 --- a/src/widget/form/settings/avform.cpp +++ b/src/widget/form/settings/avform.cpp @@ -138,11 +138,13 @@ void AVForm::hideEvent(QHideEvent *) void AVForm::getAudioInDevices() { QString settingsInDev = Settings::getInstance().getInDev(); - bool inDevFound = false; + int inDevIndex = 0; bodyUI->inDevCombobox->clear(); const ALchar *pDeviceList = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER); if (pDeviceList) { + //prevent currentIndexChanged to be fired while adding items + bodyUI->inDevCombobox->blockSignals(true); while (*pDeviceList) { int len = strlen(pDeviceList); @@ -154,21 +156,21 @@ void AVForm::getAudioInDevices() bodyUI->inDevCombobox->addItem(inDev); if (settingsInDev == inDev) { - bodyUI->inDevCombobox->setCurrentIndex(bodyUI->inDevCombobox->count()-1); - inDevFound = true; + inDevIndex = bodyUI->inDevCombobox->count()-1; } pDeviceList += len+1; } + //addItem changes currentIndex -> reset + bodyUI->inDevCombobox->setCurrentIndex(-1); + bodyUI->inDevCombobox->blockSignals(false); } - - if (!inDevFound) - Settings::getInstance().setInDev(bodyUI->inDevCombobox->itemText(0)); + bodyUI->inDevCombobox->setCurrentIndex(inDevIndex); } void AVForm::getAudioOutDevices() { QString settingsOutDev = Settings::getInstance().getOutDev(); - bool outDevFound = false; + int outDevIndex = 0; bodyUI->outDevCombobox->clear(); const ALchar *pDeviceList; if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE) @@ -177,6 +179,8 @@ void AVForm::getAudioOutDevices() pDeviceList = alcGetString(NULL, ALC_DEVICE_SPECIFIER); if (pDeviceList) { + //prevent currentIndexChanged to be fired while adding items + bodyUI->outDevCombobox->blockSignals(true); while (*pDeviceList) { int len = strlen(pDeviceList); @@ -188,15 +192,15 @@ void AVForm::getAudioOutDevices() bodyUI->outDevCombobox->addItem(outDev); if (settingsOutDev == outDev) { - bodyUI->outDevCombobox->setCurrentIndex(bodyUI->outDevCombobox->count()-1); - outDevFound = true; + outDevIndex = bodyUI->outDevCombobox->count()-1; } pDeviceList += len+1; } + //addItem changes currentIndex -> reset + bodyUI->outDevCombobox->setCurrentIndex(-1); + bodyUI->outDevCombobox->blockSignals(false); } - - if (!outDevFound) - Settings::getInstance().setOutDev(bodyUI->outDevCombobox->itemText(0)); + bodyUI->outDevCombobox->setCurrentIndex(outDevIndex); } void AVForm::onInDevChanged(const QString &deviceDescriptor) From ad445128429d5855e7e5473e78da5d28c1c6706d Mon Sep 17 00:00:00 2001 From: Lednerb Date: Mon, 12 Jan 2015 19:43:15 +0100 Subject: [PATCH 06/11] Added German translations --- translations/de.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/translations/de.ts b/translations/de.ts index 49de50342..64d686815 100644 --- a/translations/de.ts +++ b/translations/de.ts @@ -251,6 +251,11 @@ Soll der Proxy ignoriert und eine direkte Internetverbindung genutzt werden?Call duration: Anrufdauer: + + + is typing... + tippt gerade... + ChatTextEdit @@ -607,6 +612,11 @@ Alias: Faux offline messaging Imitiert Offline Benachrichtigung + + + Compact layout + Kompakte Darstellung + Provided in minutes From a45b72701f2084923767ffbc70627660251cc449 Mon Sep 17 00:00:00 2001 From: Zetok Zalbavar Date: Tue, 13 Jan 2015 15:55:06 +0000 Subject: [PATCH 07/11] Small spelling fix --- src/core.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index cfdfa422f..dd61351a9 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -355,7 +355,7 @@ void Core::bootstrapDht() } static int j = qrand() % listSize; - qDebug() << "Core: Bootstraping to the DHT ..."; + qDebug() << "Core: Bootstrapping to the DHT ..."; int i=0; while (i < 2) // i think the more we bootstrap, the more we jitter because the more we overwrite nodes @@ -363,10 +363,10 @@ void Core::bootstrapDht() const Settings::DhtServer& dhtServer = dhtServerList[j % listSize]; if (tox_bootstrap_from_address(tox, dhtServer.address.toLatin1().data(), dhtServer.port, CUserId(dhtServer.userId).data()) == 1) - qDebug() << QString("Core: Bootstraping from ")+dhtServer.name+QString(", addr ")+dhtServer.address.toLatin1().data() + qDebug() << QString("Core: Bootstrapping from ")+dhtServer.name+QString(", addr ")+dhtServer.address.toLatin1().data() +QString(", port ")+QString().setNum(dhtServer.port); else - qDebug() << "Core: Error bootstraping from "+dhtServer.name; + qDebug() << "Core: Error bootstrapping from "+dhtServer.name; j++; i++; From def43706eb930faa5865a2d33df1aa80572c36c5 Mon Sep 17 00:00:00 2001 From: derMart Date: Wed, 14 Jan 2015 15:26:02 +0100 Subject: [PATCH 08/11] fix incompatibility of MSAA (SampleBuffers) and SingleBuffer mode in VideoSurface --- src/widget/videosurface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widget/videosurface.cpp b/src/widget/videosurface.cpp index c7d263033..9a7fd69b7 100644 --- a/src/widget/videosurface.cpp +++ b/src/widget/videosurface.cpp @@ -22,7 +22,7 @@ #include VideoSurface::VideoSurface(QWidget* parent) - : QGLWidget(QGLFormat(QGL::SampleBuffers | QGL::SingleBuffer), parent) + : QGLWidget(QGLFormat(QGL::SingleBuffer), parent) , source(nullptr) , pbo{nullptr, nullptr} , textureId(0) @@ -30,7 +30,7 @@ VideoSurface::VideoSurface(QWidget* parent) , hasSubscribed(false) , pboIndex(0) { - setAutoBufferSwap(true); + } VideoSurface::VideoSurface(VideoSource *source, QWidget* parent) @@ -65,8 +65,8 @@ void VideoSurface::setSource(VideoSource *src) void VideoSurface::initializeGL() { + QGLWidget::initializeGL(); qDebug() << "VideoSurface: Init"; - // pbo pbo[0] = new QOpenGLBuffer(QOpenGLBuffer::PixelUnpackBuffer); pbo[0]->setUsagePattern(QOpenGLBuffer::StreamDraw); From c01816549701c194b0f13914c2cbc4318ff59d08 Mon Sep 17 00:00:00 2001 From: derMart Date: Wed, 14 Jan 2015 15:27:57 +0100 Subject: [PATCH 09/11] fix missing showEvent in AVForm --- src/widget/form/settings/avform.cpp | 5 +++++ src/widget/form/settings/avform.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/widget/form/settings/avform.cpp b/src/widget/form/settings/avform.cpp index 4bf5d18f6..2823f1fd9 100644 --- a/src/widget/form/settings/avform.cpp +++ b/src/widget/form/settings/avform.cpp @@ -135,6 +135,11 @@ void AVForm::hideEvent(QHideEvent *) bodyUI->CamVideoSurface->setSource(nullptr); } +void AVForm::showEvent(QShowEvent *) +{ + bodyUI->CamVideoSurface->setSource(Camera::getInstance()); +} + void AVForm::getAudioInDevices() { QString settingsInDev = Settings::getInstance().getInDev(); diff --git a/src/widget/form/settings/avform.h b/src/widget/form/settings/avform.h index f691d6c27..2c6cb61aa 100644 --- a/src/widget/form/settings/avform.h +++ b/src/widget/form/settings/avform.h @@ -59,6 +59,7 @@ private slots: void onResProbingFinished(QList res); virtual void hideEvent(QHideEvent*); + virtual void showEvent(QShowEvent*); private: Ui::AVSettings *bodyUI; From 4540fb09aa86d8c97e676266a00f9771575f5c79 Mon Sep 17 00:00:00 2001 From: derMart Date: Wed, 14 Jan 2015 23:44:38 +0100 Subject: [PATCH 10/11] fix resetting AVForm resolution combobox index to get change signal always fired during init --- src/widget/form/settings/avform.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widget/form/settings/avform.cpp b/src/widget/form/settings/avform.cpp index 2823f1fd9..ed7905fa2 100644 --- a/src/widget/form/settings/avform.cpp +++ b/src/widget/form/settings/avform.cpp @@ -125,7 +125,9 @@ void AVForm::onResProbingFinished(QList res) bodyUI->videoModescomboBox->blockSignals(true); for (QSize r : res) bodyUI->videoModescomboBox->addItem(QString("%1x%2").arg(QString::number(r.width()),QString::number(r.height())), r); - bodyUI->videoModescomboBox->blockSignals(false); + //reset index, otherwise cameras with only one resolution won't get initialized + bodyUI->videoModescomboBox->setCurrentIndex(-1); + bodyUI->videoModescomboBox->blockSignals(false); bodyUI->videoModescomboBox->setCurrentIndex(bodyUI->videoModescomboBox->count()-1); } From 1ab9bb77e6a9ac385d3b431967bd3fcd1f2242d1 Mon Sep 17 00:00:00 2001 From: Dubslow Date: Thu, 15 Jan 2015 01:45:42 -0600 Subject: [PATCH 11/11] Fix OS X bug with overlapping buttons Fixes #910 --- src/widget/form/genericchatform.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/widget/form/genericchatform.cpp b/src/widget/form/genericchatform.cpp index 0e0701367..799558775 100644 --- a/src/widget/form/genericchatform.cpp +++ b/src/widget/form/genericchatform.cpp @@ -150,6 +150,10 @@ GenericChatForm::GenericChatForm(QWidget *parent) : sendButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); fileButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); emoteButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); + micButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); + volButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); + callButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); + videoButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); menu.addAction(tr("Save chat log"), this, SLOT(onSaveLogClicked())); menu.addAction(tr("Clear displayed messages"), this, SLOT(clearChatArea(bool)));