...
 
Commits (4)
......@@ -54,4 +54,4 @@ QColor ColourAverage::averageColour(QImage img) {
color.setHsv(color.hue(), color.saturation() / 4, color.value());
return color;
}
\ No newline at end of file
}
/***************************************************************************
* Copyright (C) 2019 Carson Black *
* Copyright (C) 2019 Carson Black <uhhadd@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -16,6 +16,7 @@
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#pragma once
#include <QObject>
#include <QColor>
......@@ -27,4 +28,4 @@ class ColourAverage : public QObject
public:
explicit ColourAverage(QObject* parent = nullptr);
Q_INVOKABLE QColor averageColour(QImage img);
};
\ No newline at end of file
};
......@@ -55,6 +55,11 @@ Item {
settingsModel.get(1).enabled = !enabledConnections.wirelessEnabled
}
function toggleWwan() {
nmHandler.enableWwan(!enabledConnections.wwanEnabled)
settingsModel.get(2).enabled = !enabledConnections.wwanEnabled
}
function requestShutdown() {
print("Shutdown requested, depends on ksmserver running");
var service = pmSource.serviceForSource("PowerDevil");
......@@ -145,11 +150,10 @@ Item {
settingsModel.append({
"text": i18n("Mobile Data"),
"icon": "network-modem",
"enabled": false,
"settingsCommand": "plasma-settings -m kcm_mobile_broadband",
"toggleFunction": "",
"settingsCommand": "",
"toggleFunction": "toggleWwan",
"delegate": "",
"enabled": false,
"enabled": enabledConnections.wwanEnabled,
"applet": null
});
settingsModel.append({
......
......@@ -32,16 +32,12 @@ static inline Tp::AbstractClientHandler::Capabilities capabilities()
//we support both audio and video in calls
caps.setToken(TP_QT_IFACE_CHANNEL_TYPE_CALL + QLatin1String("/audio"));
// caps.setToken(TP_QT_IFACE_CHANNEL_TYPE_CALL + QLatin1String("/video"));
//transport methods - farstream supports them all
caps.setToken(TP_QT_IFACE_CHANNEL_TYPE_CALL + QLatin1String("/ice"));
caps.setToken(TP_QT_IFACE_CHANNEL_TYPE_CALL + QLatin1String("/gtalk-p2p"));
caps.setToken(TP_QT_IFACE_CHANNEL_TYPE_CALL + QLatin1String("/shm"));
//significant codecs
caps.setToken(TP_QT_IFACE_CHANNEL_TYPE_CALL + QLatin1String("/video/h264"));
return caps;
}
......
......@@ -38,6 +38,10 @@ DialerUtils::DialerUtils(const Tp::AccountPtr &simAccount, QObject *parent)
m_callDuration(0),
m_callContactAlias(QString())
{
if (!m_simAccount) {
return;
}
Tp::PendingReady *op = m_simAccount->becomeReady(Tp::Features() << Tp::Account::FeatureCore);
connect(op, &Tp::PendingOperation::finished, [=](){
......@@ -56,13 +60,17 @@ void DialerUtils::dial(const QString &number)
{
// FIXME: this should be replaced by kpeople thing
qDebug() << "Starting call...";
Tp::PendingChannelRequest *pendingChannel = m_simAccount->ensureAudioCall(number);
connect(pendingChannel, &Tp::PendingChannelRequest::finished, pendingChannel, [=](){
if (pendingChannel->isError()) {
qWarning() << "Error when requesting channel" << pendingChannel->errorMessage();
setCallState("failed");
}
});
if (m_simAccount) {
Tp::PendingChannelRequest *pendingChannel = m_simAccount->ensureAudioCall(number);
connect(pendingChannel, &Tp::PendingChannelRequest::finished, pendingChannel, [=](){
if (pendingChannel->isError()) {
qWarning() << "Error when requesting channel" << pendingChannel->errorMessage();
setCallState("failed");
}
});
} else {
setCallState("failed");
}
}
QString DialerUtils::callState() const
......
......@@ -165,7 +165,6 @@ int main(int argc, char **argv)
if (simAccount.isNull()) {
qCritical() << "Unable to get SIM account";
return -1;
}
QQmlApplicationEngine engine;
......