mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge branches 'pr990', 'pr1008', 'pr1009' and 'pr1011'
This commit is contained in:
commit
33dfb88962
|
@ -355,7 +355,7 @@ void Core::bootstrapDht()
|
||||||
}
|
}
|
||||||
static int j = qrand() % listSize;
|
static int j = qrand() % listSize;
|
||||||
|
|
||||||
qDebug() << "Core: Bootstraping to the DHT ...";
|
qDebug() << "Core: Bootstrapping to the DHT ...";
|
||||||
|
|
||||||
int i=0;
|
int i=0;
|
||||||
while (i < 2) // i think the more we bootstrap, the more we jitter because the more we overwrite nodes
|
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];
|
const Settings::DhtServer& dhtServer = dhtServerList[j % listSize];
|
||||||
if (tox_bootstrap_from_address(tox, dhtServer.address.toLatin1().data(),
|
if (tox_bootstrap_from_address(tox, dhtServer.address.toLatin1().data(),
|
||||||
dhtServer.port, CUserId(dhtServer.userId).data()) == 1)
|
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);
|
+QString(", port ")+QString().setNum(dhtServer.port);
|
||||||
else
|
else
|
||||||
qDebug() << "Core: Error bootstraping from "+dhtServer.name;
|
qDebug() << "Core: Error bootstrapping from "+dhtServer.name;
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -112,7 +112,7 @@ void CameraWorker::_probeResolutions()
|
||||||
|
|
||||||
//qDebug() << "PROBING:" << res << " got " << w << h;
|
//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));
|
resolutions.append(QSize(w,h));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,10 @@ GenericChatForm::GenericChatForm(QWidget *parent) :
|
||||||
|
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout(),
|
QVBoxLayout *mainLayout = new QVBoxLayout(),
|
||||||
*footButtonsSmall = new QVBoxLayout(),
|
*footButtonsSmall = new QVBoxLayout(),
|
||||||
*volMicLayout = new QVBoxLayout();
|
*micButtonsLayout = new QVBoxLayout();
|
||||||
|
|
||||||
|
QGridLayout *buttonsLayout = new QGridLayout();
|
||||||
|
|
||||||
headTextLayout = new QVBoxLayout();
|
headTextLayout = new QVBoxLayout();
|
||||||
|
|
||||||
chatWidget = new ChatAreaWidget();
|
chatWidget = new ChatAreaWidget();
|
||||||
|
@ -125,26 +128,32 @@ GenericChatForm::GenericChatForm(QWidget *parent) :
|
||||||
|
|
||||||
headTextLayout->addStretch();
|
headTextLayout->addStretch();
|
||||||
headTextLayout->addWidget(nameLabel);
|
headTextLayout->addWidget(nameLabel);
|
||||||
|
headTextLayout->addStretch();
|
||||||
|
|
||||||
volMicLayout->addWidget(micButton, Qt::AlignTop);
|
micButtonsLayout->addWidget(micButton, Qt::AlignTop | Qt::AlignRight);
|
||||||
volMicLayout->addSpacing(2);
|
micButtonsLayout->addWidget(volButton, Qt::AlignTop | Qt::AlignRight);
|
||||||
volMicLayout->addWidget(volButton, Qt::AlignBottom);
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
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);
|
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
|
//Fix for incorrect layouts on OS X as per
|
||||||
//https://bugreports.qt-project.org/browse/QTBUG-14591
|
//https://bugreports.qt-project.org/browse/QTBUG-14591
|
||||||
sendButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
|
sendButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
|
||||||
fileButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
|
fileButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
|
||||||
emoteButton->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("Save chat log"), this, SLOT(onSaveLogClicked()));
|
||||||
menu.addAction(tr("Clear displayed messages"), this, SLOT(clearChatArea(bool)));
|
menu.addAction(tr("Clear displayed messages"), this, SLOT(clearChatArea(bool)));
|
||||||
|
|
|
@ -67,6 +67,10 @@ void AVForm::present()
|
||||||
Camera::getInstance()->probeProp(Camera::HUE);
|
Camera::getInstance()->probeProp(Camera::HUE);
|
||||||
|
|
||||||
Camera::getInstance()->probeResolutions();
|
Camera::getInstance()->probeResolutions();
|
||||||
|
|
||||||
|
bodyUI->videoModescomboBox->blockSignals(true);
|
||||||
|
bodyUI->videoModescomboBox->addItem(tr("Initializing Camera..."));
|
||||||
|
bodyUI->videoModescomboBox->blockSignals(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AVForm::on_ContrastSlider_sliderMoved(int position)
|
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);
|
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());
|
Camera::getInstance()->setResolution(bodyUI->videoModescomboBox->itemData(index).toSize());
|
||||||
}
|
}
|
||||||
|
@ -118,8 +122,12 @@ void AVForm::onPropProbingFinished(Camera::Prop prop, double val)
|
||||||
void AVForm::onResProbingFinished(QList<QSize> res)
|
void AVForm::onResProbingFinished(QList<QSize> res)
|
||||||
{
|
{
|
||||||
bodyUI->videoModescomboBox->clear();
|
bodyUI->videoModescomboBox->clear();
|
||||||
|
bodyUI->videoModescomboBox->blockSignals(true);
|
||||||
for (QSize r : res)
|
for (QSize r : res)
|
||||||
bodyUI->videoModescomboBox->addItem(QString("%1x%2").arg(QString::number(r.width()),QString::number(r.height())), r);
|
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);
|
bodyUI->videoModescomboBox->setCurrentIndex(bodyUI->videoModescomboBox->count()-1);
|
||||||
}
|
}
|
||||||
|
@ -129,36 +137,47 @@ void AVForm::hideEvent(QHideEvent *)
|
||||||
bodyUI->CamVideoSurface->setSource(nullptr);
|
bodyUI->CamVideoSurface->setSource(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AVForm::showEvent(QShowEvent *)
|
||||||
|
{
|
||||||
|
bodyUI->CamVideoSurface->setSource(Camera::getInstance());
|
||||||
|
}
|
||||||
|
|
||||||
void AVForm::getAudioInDevices()
|
void AVForm::getAudioInDevices()
|
||||||
{
|
{
|
||||||
QString settingsInDev = Settings::getInstance().getInDev();
|
QString settingsInDev = Settings::getInstance().getInDev();
|
||||||
bool inDevFound = false;
|
int inDevIndex = 0;
|
||||||
bodyUI->inDevCombobox->clear();
|
bodyUI->inDevCombobox->clear();
|
||||||
const ALchar *pDeviceList = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
|
const ALchar *pDeviceList = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
|
||||||
if (pDeviceList)
|
if (pDeviceList)
|
||||||
{
|
{
|
||||||
|
//prevent currentIndexChanged to be fired while adding items
|
||||||
|
bodyUI->inDevCombobox->blockSignals(true);
|
||||||
while (*pDeviceList)
|
while (*pDeviceList)
|
||||||
{
|
{
|
||||||
int len = strlen(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);
|
bodyUI->inDevCombobox->addItem(inDev);
|
||||||
if (settingsInDev == inDev)
|
if (settingsInDev == inDev)
|
||||||
{
|
{
|
||||||
bodyUI->inDevCombobox->setCurrentIndex(bodyUI->inDevCombobox->count()-1);
|
inDevIndex = bodyUI->inDevCombobox->count()-1;
|
||||||
inDevFound = true;
|
|
||||||
}
|
}
|
||||||
pDeviceList += len+1;
|
pDeviceList += len+1;
|
||||||
}
|
}
|
||||||
|
//addItem changes currentIndex -> reset
|
||||||
|
bodyUI->inDevCombobox->setCurrentIndex(-1);
|
||||||
|
bodyUI->inDevCombobox->blockSignals(false);
|
||||||
}
|
}
|
||||||
|
bodyUI->inDevCombobox->setCurrentIndex(inDevIndex);
|
||||||
if (!inDevFound)
|
|
||||||
Settings::getInstance().setInDev(bodyUI->inDevCombobox->itemText(0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AVForm::getAudioOutDevices()
|
void AVForm::getAudioOutDevices()
|
||||||
{
|
{
|
||||||
QString settingsOutDev = Settings::getInstance().getOutDev();
|
QString settingsOutDev = Settings::getInstance().getOutDev();
|
||||||
bool outDevFound = false;
|
int outDevIndex = 0;
|
||||||
bodyUI->outDevCombobox->clear();
|
bodyUI->outDevCombobox->clear();
|
||||||
const ALchar *pDeviceList;
|
const ALchar *pDeviceList;
|
||||||
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE)
|
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE)
|
||||||
|
@ -167,22 +186,28 @@ void AVForm::getAudioOutDevices()
|
||||||
pDeviceList = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
pDeviceList = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
|
||||||
if (pDeviceList)
|
if (pDeviceList)
|
||||||
{
|
{
|
||||||
|
//prevent currentIndexChanged to be fired while adding items
|
||||||
|
bodyUI->outDevCombobox->blockSignals(true);
|
||||||
while (*pDeviceList)
|
while (*pDeviceList)
|
||||||
{
|
{
|
||||||
int len = strlen(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);
|
bodyUI->outDevCombobox->addItem(outDev);
|
||||||
if (settingsOutDev == outDev)
|
if (settingsOutDev == outDev)
|
||||||
{
|
{
|
||||||
bodyUI->outDevCombobox->setCurrentIndex(bodyUI->outDevCombobox->count()-1);
|
outDevIndex = bodyUI->outDevCombobox->count()-1;
|
||||||
outDevFound = true;
|
|
||||||
}
|
}
|
||||||
pDeviceList += len+1;
|
pDeviceList += len+1;
|
||||||
}
|
}
|
||||||
|
//addItem changes currentIndex -> reset
|
||||||
|
bodyUI->outDevCombobox->setCurrentIndex(-1);
|
||||||
|
bodyUI->outDevCombobox->blockSignals(false);
|
||||||
}
|
}
|
||||||
|
bodyUI->outDevCombobox->setCurrentIndex(outDevIndex);
|
||||||
if (!outDevFound)
|
|
||||||
Settings::getInstance().setOutDev(bodyUI->outDevCombobox->itemText(0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AVForm::onInDevChanged(const QString &deviceDescriptor)
|
void AVForm::onInDevChanged(const QString &deviceDescriptor)
|
||||||
|
|
|
@ -47,7 +47,7 @@ private slots:
|
||||||
void on_SaturationSlider_sliderMoved(int position);
|
void on_SaturationSlider_sliderMoved(int position);
|
||||||
void on_BrightnessSlider_sliderMoved(int position);
|
void on_BrightnessSlider_sliderMoved(int position);
|
||||||
void on_HueSlider_sliderMoved(int position);
|
void on_HueSlider_sliderMoved(int position);
|
||||||
void on_videoModescomboBox_activated(int index);
|
void on_videoModescomboBox_currentIndexChanged(int index);
|
||||||
|
|
||||||
// audio
|
// audio
|
||||||
void onInDevChanged(const QString& deviceDescriptor);
|
void onInDevChanged(const QString& deviceDescriptor);
|
||||||
|
@ -59,6 +59,7 @@ private slots:
|
||||||
void onResProbingFinished(QList<QSize> res);
|
void onResProbingFinished(QList<QSize> res);
|
||||||
|
|
||||||
virtual void hideEvent(QHideEvent*);
|
virtual void hideEvent(QHideEvent*);
|
||||||
|
virtual void showEvent(QShowEvent*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AVSettings *bodyUI;
|
Ui::AVSettings *bodyUI;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
VideoSurface::VideoSurface(QWidget* parent)
|
VideoSurface::VideoSurface(QWidget* parent)
|
||||||
: QGLWidget(QGLFormat(QGL::SampleBuffers | QGL::SingleBuffer), parent)
|
: QGLWidget(QGLFormat(QGL::SingleBuffer), parent)
|
||||||
, source(nullptr)
|
, source(nullptr)
|
||||||
, pbo{nullptr, nullptr}
|
, pbo{nullptr, nullptr}
|
||||||
, textureId(0)
|
, textureId(0)
|
||||||
|
@ -30,7 +30,7 @@ VideoSurface::VideoSurface(QWidget* parent)
|
||||||
, hasSubscribed(false)
|
, hasSubscribed(false)
|
||||||
, pboIndex(0)
|
, pboIndex(0)
|
||||||
{
|
{
|
||||||
setAutoBufferSwap(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoSurface::VideoSurface(VideoSource *source, QWidget* parent)
|
VideoSurface::VideoSurface(VideoSource *source, QWidget* parent)
|
||||||
|
@ -65,8 +65,8 @@ void VideoSurface::setSource(VideoSource *src)
|
||||||
|
|
||||||
void VideoSurface::initializeGL()
|
void VideoSurface::initializeGL()
|
||||||
{
|
{
|
||||||
|
QGLWidget::initializeGL();
|
||||||
qDebug() << "VideoSurface: Init";
|
qDebug() << "VideoSurface: Init";
|
||||||
|
|
||||||
// pbo
|
// pbo
|
||||||
pbo[0] = new QOpenGLBuffer(QOpenGLBuffer::PixelUnpackBuffer);
|
pbo[0] = new QOpenGLBuffer(QOpenGLBuffer::PixelUnpackBuffer);
|
||||||
pbo[0]->setUsagePattern(QOpenGLBuffer::StreamDraw);
|
pbo[0]->setUsagePattern(QOpenGLBuffer::StreamDraw);
|
||||||
|
|
10
translations/de.ts
vendored
10
translations/de.ts
vendored
|
@ -251,6 +251,11 @@ Soll der Proxy ignoriert und eine direkte Internetverbindung genutzt werden?</tr
|
||||||
<source>Call duration: </source>
|
<source>Call duration: </source>
|
||||||
<translation>Anrufdauer: </translation>
|
<translation>Anrufdauer: </translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/widget/form/chatform.cpp" line="905"/>
|
||||||
|
<source>is typing...</source>
|
||||||
|
<translation>tippt gerade...</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatTextEdit</name>
|
<name>ChatTextEdit</name>
|
||||||
|
@ -607,6 +612,11 @@ Alias:</translation>
|
||||||
<source>Faux offline messaging</source>
|
<source>Faux offline messaging</source>
|
||||||
<translation>Imitiert Offline Benachrichtigung</translation>
|
<translation>Imitiert Offline Benachrichtigung</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/widget/form/settings/generalsettings.ui" line="196"/>
|
||||||
|
<source>Compact layout</source>
|
||||||
|
<translation>Kompakte Darstellung</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/widget/form/settings/generalsettings.ui" line="198"/>
|
<location filename="../src/widget/form/settings/generalsettings.ui" line="198"/>
|
||||||
<source>Provided in minutes</source>
|
<source>Provided in minutes</source>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user