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++; 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/genericchatform.cpp b/src/widget/form/genericchatform.cpp index 411af8350..799558775 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,28 +126,34 @@ 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); 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))); diff --git a/src/widget/form/settings/avform.cpp b/src/widget/form/settings/avform.cpp index 31f9b6dd9..ed7905fa2 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,12 @@ 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); + //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); } @@ -129,36 +137,47 @@ 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(); - 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); - 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) { - 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) @@ -167,22 +186,28 @@ 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); - 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) { - 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) diff --git a/src/widget/form/settings/avform.h b/src/widget/form/settings/avform.h index 64b34d410..2c6cb61aa 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); @@ -59,6 +59,7 @@ private slots: void onResProbingFinished(QList res); virtual void hideEvent(QHideEvent*); + virtual void showEvent(QShowEvent*); private: Ui::AVSettings *bodyUI; diff --git a/src/widget/videosurface.cpp b/src/widget/videosurface.cpp index 48ae9d015..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(false); + } 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); 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