diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3c93229..bd72bb3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,61 +1,59 @@
project(plasma-phone-components)
# minimal requirements
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.12.0")
set(KF5_MIN_VERSION "5.66.0")
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 14)
find_package(ECM 5.41.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMOptionalAddSubdirectory)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMMarkNonGuiExecutable)
include(ECMGenerateHeaders)
include(GenerateExportHeader)
include(FeatureSummary)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Gui Widgets Qml Quick Test Sql)
-find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Plasma Service Declarative I18n KIO People)
+find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Plasma Service Declarative I18n KIO)
find_package(KF5 REQUIRED COMPONENTS PlasmaQuick DBusAddons Notifications)
-find_package(TelepathyQt5 REQUIRED)
find_package(KF5Wayland CONFIG)
set_package_properties(KF5Wayland PROPERTIES
TYPE REQUIRED
PURPOSE "Required for interacting with the compositor")
# torch
find_package(GStreamer 1.1.90 REQUIRED)
find_package(GLIB2 REQUIRED)
find_package(GObject REQUIRED)
include(CheckIncludeFiles)
plasma_install_package(look-and-feel org.kde.plasma.phone look-and-feel)
plasma_install_package(shell org.kde.plasma.phone shells)
install(DIRECTORY wallpaper/ DESTINATION "${WALLPAPER_INSTALL_DIR}/org.kde.plasma.phone.lockers")
install( DIRECTORY kwinmultitasking/ DESTINATION ${DATA_INSTALL_DIR}/kwin/scripts/org.kde.phone.multitasking )
install( FILES kwinmultitasking/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME kwin-script-org.kde.phone.multitasking.desktop )
install( DIRECTORY qtvirtualkeyboardplugin/ DESTINATION ${KDE_INSTALL_QMLDIR}/QtQuick/VirtualKeyboard/Styles/Plasma )
add_subdirectory(bin)
add_subdirectory(applets)
add_subdirectory(containments)
-add_subdirectory(dialer)
add_subdirectory(sounds)
#add_subdirectory(touchscreentest)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/dialer/CMakeLists.txt b/dialer/CMakeLists.txt
deleted file mode 100644
index 9662c51..0000000
--- a/dialer/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-install(FILES metadata.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} RENAME org.kde.phone.dialer.desktop)
-install(FILES dialer.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps/)
-
-include_directories(${TELEPATHY_QT5_INCLUDE_DIR})
-#
-
-add_subdirectory(src)
diff --git a/dialer/dialer.svg b/dialer/dialer.svg
deleted file mode 100644
index 47bd3e7..0000000
--- a/dialer/dialer.svg
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
diff --git a/dialer/metadata.desktop b/dialer/metadata.desktop
deleted file mode 100644
index a923152..0000000
--- a/dialer/metadata.desktop
+++ /dev/null
@@ -1,69 +0,0 @@
-[Desktop Entry]
-Comment=Plasma phone dialer
-Comment[ca]=Marcador del telèfon del Plasma
-Comment[ca@valencia]=Marcador del telèfon del Plasma
-Comment[da]=Opkaldstastatur til telefon
-Comment[en_GB]=Plasma phone dialer
-Comment[es]=Marcador del teléfono Plasma
-Comment[et]=Plasma kõnevalija
-Comment[eu]=Plasma telefonoko markatzailea
-Comment[fi]=Plasman numerovalitsin
-Comment[fr]=Centre d'appel Plasma du téléphone
-Comment[gl]=Marcador de números de teléfono de Plasma.
-Comment[hu]=Plasma tárcsázó
-Comment[id]=Pendial ponsel Plasma
-Comment[it]=Combinatore telefonico di Plasma
-Comment[ko]=Plasma 전화 다이얼
-Comment[lt]=Plasma telefono numerio rinkiklis
-Comment[nl]=Telefoonkiezer van Plasma
-Comment[nn]=Telefonringjar for Plasma
-Comment[pl]=Pole wybierania telefonu
-Comment[pt]=Teclado do Plasma
-Comment[pt_BR]=Discador do telefone Plasma
-Comment[ru]=Номеронабиратель Plasma для телефона
-Comment[sk]=Plasma vytáčanie telefónu
-Comment[sv]=Plasma telefonuppringning
-Comment[tr]=Plasma telefon çevirici
-Comment[uk]=Засіб набирання номеру Плазми
-Comment[x-test]=xxPlasma phone dialerxx
-Comment[zh_CN]=Plasma 手机拨号器
-Comment[zh_TW]=Plasma 手機撥號程式
-Encoding=UTF-8
-Keywords=
-Name=Phone
-Name[ca]=Telèfon
-Name[ca@valencia]=Telèfon
-Name[cs]=Telefon
-Name[da]=Telefon
-Name[de]=Telefon
-Name[en_GB]=Phone
-Name[es]=Teléfono
-Name[et]=Telefon
-Name[eu]=Telefonoa
-Name[fi]=Phone
-Name[fr]=Téléphone
-Name[gl]=Teléfono
-Name[hu]=Telefon
-Name[ia]=Telephono
-Name[id]=Ponsel
-Name[it]=Telefono
-Name[ko]=전화
-Name[lt]=Telefonas
-Name[nl]=Telefoon
-Name[nn]=Telefon
-Name[pl]=Telefon
-Name[pt]=Telefone
-Name[pt_BR]=Telefone
-Name[ru]=Телефон
-Name[sk]=Telefón
-Name[sv]=Telefon
-Name[tr]=Telefon
-Name[uk]=Телефон
-Name[x-test]=xxPhonexx
-Name[zh_CN]=手机
-Name[zh_TW]=電話
-Type=Application
-Icon=dialer
-Exec=plasmaphonedialer %u
-
-MimeType=x-scheme-handler/tel
diff --git a/dialer/src/CMakeLists.txt b/dialer/src/CMakeLists.txt
deleted file mode 100644
index ef5aaa5..0000000
--- a/dialer/src/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-set(plasmaphonedialer_SRCS
- main.cpp
- dialerutils.cpp
- call-handler.cpp
- callhistorymodel.cpp
- call-manager.cpp
- resources.qrc
-)
-add_executable(plasmaphonedialer ${plasmaphonedialer_SRCS})
-target_compile_definitions(plasmaphonedialer PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
-
-find_package(PhoneNumber COMPONENTS PhoneNumber REQUIRED)
-
-target_link_libraries(plasmaphonedialer
- PhoneNumber::PhoneNumber
- Qt5::Gui
- Qt5::Quick
- Qt5::Widgets
- Qt5::Sql
- KF5::Declarative
- KF5::I18n
- KF5::QuickAddons
- KF5::DBusAddons
- KF5::Notifications
- ${TELEPATHY_QT5_LIBRARIES}
-)
-
-install(TARGETS plasmaphonedialer ${INSTALL_TARGETS_DEFAULT_ARGS})
-install(FILES plasma_dialer.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR})
-
-configure_file(org.freedesktop.Telepathy.Client.Plasma.Dialer.service.in
- org.freedesktop.Telepathy.Client.Plasma.Dialer.service)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.Plasma.Dialer.service
- DESTINATION ${DBUS_SERVICES_INSTALL_DIR})
-
-install(FILES Plasma.Dialer.client DESTINATION ${SHARE_INSTALL_PREFIX}/telepathy/clients/)
diff --git a/dialer/src/Plasma.Dialer.client b/dialer/src/Plasma.Dialer.client
deleted file mode 100644
index f120283..0000000
--- a/dialer/src/Plasma.Dialer.client
+++ /dev/null
@@ -1,27 +0,0 @@
-[org.freedesktop.Telepathy.Client]
-Interfaces=org.freedesktop.Telepathy.Client.Handler
-
-[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 0]
-org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call1
-org.freedesktop.Telepathy.Channel.TargetHandleType u=1
-
-[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 1]
-org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call1
-org.freedesktop.Telepathy.Channel.TargetHandleType u=1
-org.freedesktop.Telepathy.Channel.Type.Call1.InitialAudio b=true
-
-[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 2]
-org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call1
-org.freedesktop.Telepathy.Channel.TargetHandleType u=1
-org.freedesktop.Telepathy.Channel.Type.Call1.InitialVideo b=true
-
-[org.freedesktop.Telepathy.Client.Handler]
-BypassApproval=true
-
-[org.freedesktop.Telepathy.Client.Handler.Capabilities]
-org.freedesktop.Telepathy.Channel.Type.Call1/audio=true
-org.freedesktop.Telepathy.Channel.Type.Call1/video=false
-org.freedesktop.Telepathy.Channel.Type.Call1/ice=true
-org.freedesktop.Telepathy.Channel.Type.Call1/gtalk-p2p=false
-org.freedesktop.Telepathy.Channel.Type.Call1/shm=true
-org.freedesktop.Telepathy.Channel.Type.Call1/video/h264=false
diff --git a/dialer/src/call-handler.cpp b/dialer/src/call-handler.cpp
deleted file mode 100644
index d4d79b1..0000000
--- a/dialer/src/call-handler.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Copyright (C) 2009-2012 George Kiagiadakis
-
- 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
- the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-*/
-#include "call-handler.h"
-#include "call-manager.h"
-#include "dialerutils.h"
-
-#include
-#include
-
-static inline Tp::ChannelClassSpecList channelClassSpecList()
-{
- return Tp::ChannelClassSpecList() << Tp::ChannelClassSpec::audioCall();
-}
-
-static inline Tp::AbstractClientHandler::Capabilities capabilities()
-{
- Tp::AbstractClientHandler::Capabilities caps;
-
- //we support both audio and video in calls
- caps.setToken(TP_QT_IFACE_CHANNEL_TYPE_CALL + QLatin1String("/audio"));
-
- //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"));
-
- return caps;
-}
-
-CallHandler::CallHandler(DialerUtils *utils)
- : Tp::AbstractClientHandler(channelClassSpecList(), capabilities())
-{
- m_dialerUtils = utils;
- m_dialerUtils->setCallState("idle");
- qDebug() << "Call handler ready";
-}
-
-CallHandler::~CallHandler()
-= default;
-
-bool CallHandler::bypassApproval() const
-{
- return true;
-}
-
-void CallHandler::handleChannels(const Tp::MethodInvocationContextPtr<> & context,
- const Tp::AccountPtr & account,
- const Tp::ConnectionPtr & connection,
- const QList & channels,
- const QList & requestsSatisfied,
- const QDateTime & userActionTime,
- const Tp::AbstractClientHandler::HandlerInfo & handlerInfo)
-{
- Q_UNUSED(account);
- Q_UNUSED(connection);
- Q_UNUSED(requestsSatisfied);
- Q_UNUSED(userActionTime);
- Q_UNUSED(handlerInfo);
-
- Q_FOREACH(const Tp::ChannelPtr & channel, channels) {
- Tp::CallChannelPtr callChannel = Tp::CallChannelPtr::qObjectCast(channel);
- if (!callChannel) {
- qDebug() << "Channel is not a Call channel. Ignoring";
- continue;
- }
- //check if any call manager is already handling this channel
- if (!handledCallChannels.contains(callChannel)) {
- handledCallChannels.append(callChannel);
- new CallManager(callChannel, m_dialerUtils, this);
- }
- }
-
- context->setFinished();
-}
diff --git a/dialer/src/call-handler.h b/dialer/src/call-handler.h
deleted file mode 100644
index ad4d62b..0000000
--- a/dialer/src/call-handler.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- Copyright (C) 2009 George Kiagiadakis
-
- 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
- the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-*/
-#ifndef CALL_HANDLER_H
-#define CALL_HANDLER_H
-
-#include
-
-class DialerUtils;
-
-class CallHandler : public QObject, public Tp::AbstractClientHandler
-{
- Q_OBJECT
-public:
- CallHandler(DialerUtils *utils);
- ~CallHandler() override;
-
- bool bypassApproval() const override;
- void handleChannels(const Tp::MethodInvocationContextPtr<> & context,
- const Tp::AccountPtr & account,
- const Tp::ConnectionPtr & connection,
- const QList & channels,
- const QList & requestsSatisfied,
- const QDateTime & userActionTime,
- const Tp::AbstractClientHandler::HandlerInfo & handlerInfo) override;
-private:
- QList handledCallChannels;
- DialerUtils *m_dialerUtils;
-};
-
-#endif
diff --git a/dialer/src/call-manager.cpp b/dialer/src/call-manager.cpp
deleted file mode 100644
index 9c369a5..0000000
--- a/dialer/src/call-manager.cpp
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- Copyright (C) 2012 George Kiagiadakis
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see .
-*/
-#include "call-manager.h"
-#include "dialerutils.h"
-#include
-
-#include
-#include
-// #include "call-window.h"
-// #include "approver.h"
-// #include "../libktpcall/call-channel-handler.h"
-// #include "ktp_call_ui_debug.h"
-
-// #include
-
-struct CallManager::Private
-{
- Tp::CallChannelPtr callChannel;
-// CallChannelHandler *channelHandler;
-// QPointer callWindow;
-// QPointer approver;
- DialerUtils *dialerUtils;
- KNotification *ringingNotification;
- KNotification *callsNotification;
- uint missedCalls;
- QTimer *callTimer;
-};
-
-CallManager::CallManager(const Tp::CallChannelPtr &callChannel, DialerUtils *dialerUtils, QObject *parent)
- : QObject(parent), d(new Private)
-{
-// KTp::TelepathyHandlerApplication::newJob();
-
- d->dialerUtils = dialerUtils;
- d->callChannel = callChannel;
- connect(callChannel.data(), &Tp::CallChannel::callStateChanged,
- this, &CallManager::onCallStateChanged);
-
- connect(d->dialerUtils, &DialerUtils::acceptCall, this, &CallManager::onCallAccepted);
- connect(d->dialerUtils, &DialerUtils::rejectCall, this, &CallManager::onCallRejected);
- connect(d->dialerUtils, &DialerUtils::hangUp, this, &CallManager::onHangUpRequested);
- connect(d->callChannel.data(), &Tp::CallChannel::invalidated, this, [=]() {
- qDebug() << "Channel invalidated";
- d->dialerUtils->setCallState("idle");
- d->dialerUtils->emitCallEnded();
- deleteLater();
- });
-
- d->ringingNotification = nullptr;
- d->callsNotification = nullptr;
- d->callTimer = nullptr;
-
- //create the channel handler
-// d->channelHandler = new CallChannelHandler(callChannel, this);
-
- //delete the CallManager when the channel has closed
- //and the farstream side has safely shut down.
- //NOTE this MUST be used with Qt::QueuedConnection because of
- // https://bugreports.qt-project.org/browse/QTBUG-24571
-// connect(d->channelHandler, SIGNAL(channelClosed()),
-// this, SLOT(deleteLater()), Qt::QueuedConnection);
-
- //bring us up-to-date with the current call state
- onCallStateChanged(d->callChannel->callState());
-}
-
-CallManager::~CallManager()
-{
- qDebug() << "Deleting CallManager";
-
- //delete the window just in case CallManager was deleted
- //before the channel entered CallStateEnded
-// delete d->callWindow.data();
-// delete d;
-
-// KTp::TelepathyHandlerApplication::jobFinished();
-}
-
-void CallManager::onCallStateChanged(Tp::CallState state)
-{
- qDebug() << "new call state:" << state;
-
- if (d->callChannel->targetContact()) {
- d->dialerUtils->setCallContactAlias(d->callChannel->targetContact()->alias());
- d->dialerUtils->setCallContactNumber(d->callChannel->targetContact()->id());
- }
-
- if (d->callChannel->isValid()) {
- d->dialerUtils->setIsIncomingCall(!d->callChannel->isRequested());
- }
-
- switch (state) {
- case Tp::CallStatePendingInitiator:
- Q_ASSERT(d->callChannel->isRequested());
- (void) d->callChannel->accept();
- break;
- case Tp::CallStateInitialising:
- if (d->callChannel->isRequested()) {
- d->dialerUtils->setCallState("dialing");
-
- //show status that the call is connecting
-// ensureCallWindow();
-// d->callWindow.data()->setStatus(CallWindow::StatusConnecting);
- } else {
- qDebug() << "Call is initialising";
- }
- break;
- case Tp::CallStateInitialised:
- if (d->callChannel->isRequested()) {
- d->dialerUtils->setCallState("dialing");
- //show status that the remote end is ringing
-// ensureCallWindow();
-// d->callWindow.data()->setStatus(CallWindow::StatusRemoteRinging);
- } else {
- d->dialerUtils->setCallState("incoming");
-
- //show approver;
- (void) d->callChannel->setRinging();
- if (!d->ringingNotification) {
- d->ringingNotification = new KNotification("ringing", KNotification::Persistent | KNotification::LoopSound, nullptr);
- d->ringingNotification->setComponentName("plasma_dialer");
- }
- d->ringingNotification->sendEvent();
- }
- break;
- case Tp::CallStateAccepted:
- if (d->callChannel->isRequested()) {
- d->dialerUtils->setCallState("answered");
- //show status that the remote end accepted the call
-// ensureCallWindow();
-// d->callWindow.data()->setStatus(CallWindow::StatusRemoteAccepted);
- } else {
- //hide approver & show call window
- if (d->ringingNotification) {
- d->ringingNotification->close();
- }
-// delete d->approver.data();
-// ensureCallWindow();
-// d->callWindow.data()->setStatus(CallWindow::StatusConnecting);
- }
- break;
- case Tp::CallStateActive:
- //normally the approver is already deleted and the call window
- //already exists at this point, but we just want to be safe
- //in case the CM decides to do a weird state jump
- if (!d->callChannel->isRequested()) {
-// delete d->approver.data();
- }
- d->dialerUtils->setCallState("active");
- d->callTimer = new QTimer(this);
- connect(d->callTimer, &QTimer::timeout, d->callTimer, [=]() {
- d->dialerUtils->setCallDuration(d->dialerUtils->callDuration() + 1);
- });
- d->callTimer->start(1000);
-
-// ensureCallWindow();
-// d->callWindow.data()->setStatus(CallWindow::StatusActive);
- break;
- case Tp::CallStateEnded:
- d->dialerUtils->setCallState("ended");
- if (d->ringingNotification) {
- d->ringingNotification->close();
- }
- //FIXME this is defined in the spec, but try to find a proper enum value for it
- if (d->callChannel->callStateReason().reason == 5) {
- qDebug() << "Adding notification";
- d->missedCalls++;
- if (!d->callsNotification) {
- d->callsNotification = new KNotification("callMissed", KNotification::Persistent, nullptr);
- }
- d->callsNotification->setComponentName("plasma_dialer");
- d->callsNotification->setIconName("call-start");
- if (d->missedCalls == 1) {
- d->callsNotification->setTitle(i18n("Missed call from %1", d->callChannel->targetContact()->alias()));
- d->callsNotification->setText(QTime::currentTime().toString("HH:mm"));
- } else {
- d->callsNotification->setTitle(i18n("%1 calls missed", d->missedCalls));
- d->callsNotification->setText(i18n("Last call: %1", QTime::currentTime().toString("HH:mm")));
- }
-
- if (d->missedCalls == 1) {
- d->callsNotification->sendEvent();
- } else {
- d->callsNotification->update();
- }
- }
-
- if (d->callTimer) {
- d->callTimer->stop();
- d->callTimer->deleteLater();
- d->callTimer = nullptr;
- }
- //if we requested the call, make sure we have a window to show the error (if any)
-// if (d->callChannel->isRequested()) {
-// ensureCallWindow();
-// }
-
-// if (d->callWindow) {
-// Tp::CallStateReason reason = d->callChannel->callStateReason();
-// d->callWindow.data()->setStatus(CallWindow::StatusDisconnected, reason);
-//
-// //kill the call manager when the call window is closed,
-// //after shutting down the channelHandler
-// connect(d->callWindow.data(), SIGNAL(destroyed()), d->channelHandler, SLOT(shutdown()));
-// } else {
-// //missed the call
-// qCDebug(KTP_CALL_UI) << "missed call";
-// delete d->approver.data();
-// d->channelHandler->shutdown();
-// }
- break;
- default:
- Q_ASSERT(false);
- }
-}
-
-void CallManager::onCallAccepted()
-{
- (void) d->callChannel->accept();
-}
-
-void CallManager::onCallRejected()
-{
- (void) d->callChannel->hangup(Tp::CallStateChangeReasonRejected, TP_QT_ERROR_REJECTED);
-}
-
-void CallManager::onHangUpRequested()
-{
- if (d->callChannel && d->callChannel->isValid()) {
- qDebug() << "Hanging up";
- Tp::PendingOperation *op = d->callChannel->hangup();
- connect(op, &Tp::PendingOperation::finished, [=]() {
- if (op->isError()) {
- qWarning() << "Unable to hang up:" << op->errorMessage();
- }
-// d->callChannel->requestClose();
- });
- }
-}
-
-void CallManager::ensureCallWindow()
-{
-// if (!d->callWindow) {
-// d->callWindow = new CallWindow(d->callChannel);
-// d->callWindow.data()->show();
-// d->callWindow.data()->setAttribute(Qt::WA_DeleteOnClose);
-//
-// connect(d->channelHandler, SIGNAL(contentAdded(CallContentHandler*)),
-// d->callWindow.data(), SLOT(onContentAdded(CallContentHandler*)));
-// connect(d->channelHandler, SIGNAL(contentRemoved(CallContentHandler*)),
-// d->callWindow.data(), SLOT(onContentRemoved(CallContentHandler*)));
-//
-// //inform the ui about already existing contents
-// Q_FOREACH(CallContentHandler *content, d->channelHandler->contents()) {
-// d->callWindow.data()->onContentAdded(content);
-// }
-// }
-}
diff --git a/dialer/src/call-manager.h b/dialer/src/call-manager.h
deleted file mode 100644
index df51e01..0000000
--- a/dialer/src/call-manager.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Copyright (C) 2012 George Kiagiadakis
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see .
-*/
-#ifndef CALL_MANAGER_H
-#define CALL_MANAGER_H
-
-#include
-#include
-
-class DialerUtils;
-
-class CallManager : public QObject
-{
- Q_OBJECT
-public:
- explicit CallManager(const Tp::CallChannelPtr &callChannel, DialerUtils *dialerUtils, QObject *parent = nullptr);
- ~CallManager() override;
-
-private Q_SLOTS:
- void onCallStateChanged(Tp::CallState state);
- void onCallAccepted();
- void onCallRejected();
- void onHangUpRequested();
-
-private:
- void ensureCallWindow();
-
-private:
- struct Private;
- Private *const d;
-};
-
-#endif // CALL_MANAGER_H
diff --git a/dialer/src/callhistorymodel.cpp b/dialer/src/callhistorymodel.cpp
deleted file mode 100644
index 97442eb..0000000
--- a/dialer/src/callhistorymodel.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- Copyright (C) 2019 Nicolas Fella
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see .
-*/
-#include "callhistorymodel.h"
-
-#include
-#include
-#include
-#include
-#include
-
-CallHistoryModel::CallHistoryModel(QObject *parent)
- : QAbstractListModel(parent)
- , m_db(QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"), QStringLiteral("calldb")))
-{
- m_db.setDatabaseName(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "plasmaphonedialerdb.sqlite");
- bool open = m_db.open();
-
- if (!open) {
- qWarning() << "Could not open call database" << m_db.lastError();
- }
-
- QSqlQuery createTable(m_db);
- createTable.exec(QStringLiteral("CREATE TABLE IF NOT EXISTS History(id INTEGER PRIMARY KEY AUTOINCREMENT, number TEXT, time DATETIME, duration INTEGER, callType INTEGER)"));
-
- QSqlQuery fetchCalls(m_db);
- fetchCalls.exec(QStringLiteral("SELECT id, number, time, duration, callType FROM History"));
-
- beginResetModel();
- while (fetchCalls.next()) {
- CallData call;
- call.id = fetchCalls.value(0).toString();
- call.number = fetchCalls.value(1).toString();
- call.time = QDateTime::fromMSecsSinceEpoch(fetchCalls.value(2).toInt());
- call.duration = fetchCalls.value(3).toInt();
- call.callType = fetchCalls.value(4).toInt();
-
- m_calls.append(call);
- }
- endResetModel();
-}
-
-void CallHistoryModel::addCall(QString number, int duration, int type)
-{
- beginInsertRows(QModelIndex(), m_calls.size(), m_calls.size());
- QSqlQuery putCall(m_db);
- putCall.prepare(QStringLiteral("INSERT INTO History (number, time, duration, callType) VALUES (:number, :time, :duration, :callType)"));
- putCall.bindValue(":number", number);
- putCall.bindValue(":time", QDateTime::currentDateTime().toMSecsSinceEpoch());
- putCall.bindValue(":duration", duration);
- putCall.bindValue(":callType", type);
- putCall.exec();
-
- CallData data;
- data.id = putCall.lastInsertId().toString();
- data.number = number;
- data.duration = duration;
- data.time = QDateTime::currentDateTime();
- data.callType = type;
-
- m_calls.append(data);
-
- endInsertRows();
-}
-
-void CallHistoryModel::clear()
-{
- beginResetModel();
-
- QSqlQuery clearCalls(m_db);
- clearCalls.exec(QStringLiteral("DELETE FROM History"));
- m_calls.clear();
-
- endResetModel();
-}
-
-QVariant CallHistoryModel::data(const QModelIndex& index, int role) const
-{
- int row = index.row();
-
- switch (role) {
- case Roles::PhoneNumberRole:
- return m_calls[row].number;
- case Roles::CallTypeRole:
- return m_calls[row].callType;
- case Roles::DurationRole:
- return m_calls[row].duration;
- case Roles::TimeRole:
- return m_calls[row].time;
- case Roles::IdRole:
- return m_calls[row].id;
- }
- return {};
-}
-
-int CallHistoryModel::rowCount(const QModelIndex &parent) const
-{
- Q_UNUSED(parent)
- return m_calls.size();
-}
-
-QHash CallHistoryModel::roleNames() const
-{
- QHash roleNames;
- roleNames[PhoneNumberRole] = "number";
- roleNames[CallTypeRole] = "time";
- roleNames[DurationRole] = "duration";
- roleNames[TimeRole] = "callType";
- roleNames[IdRole] = "dbid";
-
- return roleNames;
-}
-
-bool CallHistoryModel::removeRows(int row, int count, const QModelIndex &parent)
-{
- Q_UNUSED(count)
-
- beginRemoveRows(parent, row, row);
- QSqlQuery remove(m_db);
- remove.prepare(QStringLiteral("DELETE FROM History WHERE id=:id"));
- remove.bindValue(":id", m_calls[row].id);
- remove.exec();
-
- endRemoveRows();
- return true;
-}
-
-void CallHistorySortFilterModel::remove(int index)
-{
- QSortFilterProxyModel::removeRow(index);
-}
-
-void CallHistorySortFilterModel::sort(int column, Qt::SortOrder order)
-{
- QSortFilterProxyModel::sort(column, order);
-}
diff --git a/dialer/src/callhistorymodel.h b/dialer/src/callhistorymodel.h
deleted file mode 100644
index 711acce..0000000
--- a/dialer/src/callhistorymodel.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- Copyright (C) 2019 Nicolas Fella
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see .
-*/
-#pragma once
-
-#include
-#include
-#include
-#include
-#include
-
-struct CallData {
- QString id;
- QString number;
- QDateTime time;
- int duration;
- int callType;
-};
-
-class CallHistoryModel : public QAbstractListModel
-{
- Q_OBJECT
-public:
-
- CallHistoryModel(QObject *parent = nullptr);
-
- enum Roles {
- PhoneNumberRole = Qt::UserRole + 1,
- DurationRole,
- TimeRole,
- CallTypeRole,
- IdRole
- };
- Q_ENUM(Roles)
-
- int rowCount(const QModelIndex &parent = QModelIndex()) const override;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
- QHash roleNames() const override;
-
- Q_INVOKABLE void addCall(QString number, int duration, int type);
- Q_INVOKABLE void clear();
-
- bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
-
-private:
- QSqlDatabase m_db;
- QVector m_calls;
-};
-
-class CallHistorySortFilterModel : public QSortFilterProxyModel
-{
- Q_OBJECT
-public:
- Q_INVOKABLE void remove(int index);
- Q_INVOKABLE void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
-};
diff --git a/dialer/src/dialerutils.cpp b/dialer/src/dialerutils.cpp
deleted file mode 100644
index 18de879..0000000
--- a/dialer/src/dialerutils.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright 2015 Marco Martin
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
-
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-**/
-
-#include "dialerutils.h"
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "phonenumbers/phonenumberutil.h"
-#include "phonenumbers/asyoutypeformatter.h"
-
-DialerUtils::DialerUtils(const Tp::AccountPtr &simAccount, QObject *parent)
-: QObject(parent),
- m_missedCalls(0),
- m_simAccount(simAccount),
- 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, [=](){
- if (op->isError()) {
- qWarning() << "SIM card account failed to get ready:" << op->errorMessage();
- } else {
- qDebug() << "SIM Account ready to use";
- }
- });
-}
-
-DialerUtils::~DialerUtils()
-= default;
-
-void DialerUtils::dial(const QString &number)
-{
- // FIXME: this should be replaced by kpeople thing
- qDebug() << "Starting call...";
- 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
-{
- return m_callState;
-}
-
-const QString DialerUtils::formatNumber(const QString& number)
-{
- using namespace ::i18n::phonenumbers;
-
- // Get formatter instance
- QLocale locale;
- QStringList qcountry = locale.name().split('_');
- QString countrycode(qcountry.constLast());
- string country = countrycode.toUtf8().constData();
- PhoneNumberUtil* util = PhoneNumberUtil::GetInstance();
- AsYouTypeFormatter* formatter = util->PhoneNumberUtil::GetAsYouTypeFormatter(country);
-
- // Normalize input
- string stdnumber = number.toUtf8().constData();
- util->NormalizeDiallableCharsOnly(&stdnumber);
-
- // Format
- string formatted;
- formatter->Clear();
- for (char& c : stdnumber) {
- formatter->InputDigit(c, &formatted);
- }
- delete formatter;
-
- return QString::fromStdString(formatted);
-}
-
-void DialerUtils::setCallState(const QString &state)
-{
- if (m_callState != state) {
- m_callState = state;
- Q_EMIT callStateChanged();
- }
-}
-
-uint DialerUtils::callDuration() const
-{
- return m_callDuration;
-}
-
-void DialerUtils::setCallDuration(uint duration)
-{
- m_callDuration = duration;
- Q_EMIT callDurationChanged();
-}
-
-QString DialerUtils::callContactAlias() const
-{
- return m_callContactAlias;
-}
-
-void DialerUtils::setCallContactAlias(const QString &contactAlias)
-{
- if (m_callContactAlias != contactAlias) {
- m_callContactAlias = contactAlias;
- Q_EMIT callContactAliasChanged();
- }
-}
-
-QString DialerUtils::callContactNumber() const
-{
- return m_callContactNumber;
-}
-
-void DialerUtils::setCallContactNumber(const QString &contactNumber)
-{
- if (m_callContactNumber != contactNumber) {
- m_callContactNumber = contactNumber;
- Q_EMIT callContactNumberChanged();
- }
-}
-
-bool DialerUtils::isIncomingCall() const
-{
- return m_isIncomingCall;
-}
-
-void DialerUtils::setIsIncomingCall(bool isIncomingCall)
-{
- if (m_isIncomingCall != isIncomingCall) {
- m_isIncomingCall = isIncomingCall;
- Q_EMIT isIncomingCallChanged();
- }
-}
-
-void DialerUtils::emitCallEnded()
-{
- qDebug() << "Call ended:" << m_callContactNumber << m_callDuration;
- Q_EMIT callEnded(m_callContactNumber, m_callDuration, m_isIncomingCall);
- m_callDuration = 0;
- m_callContactNumber = QString();
- m_callContactAlias = QString();
-}
-
-void DialerUtils::resetMissedCalls()
-{
- m_missedCalls = 0;
- if (m_callsNotification) {
- m_callsNotification->close();
- }
- m_callsNotification.clear();
-}
-
-#include "moc_dialerutils.cpp"
diff --git a/dialer/src/dialerutils.h b/dialer/src/dialerutils.h
deleted file mode 100644
index 6299ba5..0000000
--- a/dialer/src/dialerutils.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2015 Marco Martin
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
-
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-**/
-
-#ifndef DIALERUTILS_H
-#define DIALERUTILS_H
-
-#include
-#include
-#include
-
-#include
-
-class DialerUtils : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString callState READ callState NOTIFY callStateChanged);
- Q_PROPERTY(uint callDuration READ callDuration NOTIFY callDurationChanged);
- Q_PROPERTY(QString callContactAlias READ callContactAlias NOTIFY callContactAliasChanged);
- Q_PROPERTY(QString callContactNumber READ callContactNumber NOTIFY callContactNumberChanged);
- Q_PROPERTY(bool isIncomingCall READ isIncomingCall NOTIFY isIncomingCallChanged);
-
-public:
-
- DialerUtils(const Tp::AccountPtr &simAccount, QObject *parent = nullptr);
- ~DialerUtils() override;
-
- QString callState() const;
- void setCallState(const QString &state);
-
- uint callDuration() const;
- void setCallDuration(uint duration);
-
- QString callContactAlias() const;
- void setCallContactAlias(const QString &contactAlias);
-
- QString callContactNumber() const;
- void setCallContactNumber(const QString &contactNumber);
-
- bool isIncomingCall() const;
- void setIsIncomingCall(bool isIncomingCall);
-
- void emitCallEnded();
-
- Q_INVOKABLE void resetMissedCalls();
- Q_INVOKABLE void dial(const QString &number);
- Q_INVOKABLE const QString formatNumber(const QString& number);
-
-Q_SIGNALS:
- void missedCallsActionTriggered();
- void callStateChanged();
- void callDurationChanged();
- void callContactAliasChanged();
- void callContactNumberChanged();
- void isIncomingCallChanged();
- void acceptCall();
- void rejectCall();
- void hangUp();
- void callEnded(const QString &callContactNumber, uint callDuration, bool isIncomingCall);
-
-private:
- QPointer m_callsNotification;
- QPointer m_ringingNotification;
- int m_missedCalls;
- QString m_callState;
- Tp::AccountPtr m_simAccount;
- QString m_callContactNumber;
- uint m_callDuration;
- QString m_callContactAlias;
- bool m_isIncomingCall;
-};
-
-
-#endif
diff --git a/dialer/src/main.cpp b/dialer/src/main.cpp
deleted file mode 100644
index f21e24a..0000000
--- a/dialer/src/main.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright 2015 Marco Martin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include
-
-#include "dialerutils.h"
-#include "call-handler.h"
-#include "callhistorymodel.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
-{
- QFile file(QDir::homePath() + "/dialer.log");
-
- bool opened = file.open(QIODevice::WriteOnly | QIODevice::Append);
- Q_ASSERT(opened);
-
- QString strout;
- QTextStream out(&strout);
- out << QTime::currentTime().toString("hh:mm:ss.zzz ");
- out << context.function << ":" << context.line << " ";
-
- switch (type) {
- case QtDebugMsg: out << "DBG"; break;
- case QtInfoMsg: out << "NFO"; break;
- case QtWarningMsg: out << "WRN"; break;
- case QtCriticalMsg: out << "CRT"; break;
- case QtFatalMsg: out << "FTL"; break;
- }
-
- out << " " << msg << '\n';
-
- // Write to log file
- QTextStream fileout(&file);
- fileout << strout;
- out.flush();
-
- // Write to stdout
- QTextStream console(stdout);
- console << strout;
- console.flush();
-}
-
-int main(int argc, char **argv)
-{
- qInstallMessageHandler(myMessageOutput);
- QCommandLineParser parser;
- QApplication app(argc, argv);
-
- const QString description = i18n("Plasma Phone Dialer");
- const char version[] = PROJECT_VERSION;
-
-// app.setQuitOnLastWindowClosed(false);
- app.setApplicationVersion(version);
- app.setOrganizationDomain("kde.org");
-
- KDBusService service(KDBusService::Unique);
-
- parser.addVersionOption();
- parser.addHelpOption();
- parser.setApplicationDescription(description);
-
- QCommandLineOption daemonOption(QStringList() << QStringLiteral("d") <<
- QStringLiteral("daemon"),
- i18n("Daemon mode. run without displaying anything."));
-
- parser.addPositionalArgument("number", i18n("Call the given number"));
-
- parser.addOption(daemonOption);
-
- parser.process(app);
-
- qmlRegisterType("org.kde.plasma.dialer", 1, 0, "CallHistoryModel");
- qmlRegisterType("org.kde.plasma.dialer", 1, 0, "CallHistorySortFilterModel");
-
- Tp::registerTypes();
-
- Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
- Tp::Features() << Tp::Account::FeatureCore
- );
-
- Tp::ConnectionFactoryPtr connectionFactory = Tp::ConnectionFactory::create(QDBusConnection::sessionBus(),
- Tp::Features() << Tp::Connection::FeatureCore
- << Tp::Connection::FeatureSelfContact
- << Tp::Connection::FeatureConnected
- );
-
- Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create(QDBusConnection::sessionBus());
- channelFactory->addCommonFeatures(Tp::Channel::FeatureCore);
- channelFactory->addFeaturesForCalls(Tp::Features() << Tp::CallChannel::FeatureContents
- << Tp::CallChannel::FeatureCallState
- << Tp::CallChannel::FeatureCallMembers
- << Tp::CallChannel::FeatureLocalHoldState
- );
-
-// channelFactory->addFeaturesForTextChats(Tp::Features() << Tp::TextChannel::FeatureMessageQueue
-// << Tp::TextChannel::FeatureMessageSentSignal
-// << Tp::TextChannel::FeatureChatState
-// << Tp::TextChannel::FeatureMessageCapabilities);
-
- Tp::ContactFactoryPtr contactFactory = Tp::ContactFactory::create(Tp::Features() << Tp::Contact::FeatureAlias
- << Tp::Contact::FeatureAvatarData
- );
-
- Tp::ClientRegistrarPtr registrar = Tp::ClientRegistrar::create(accountFactory, connectionFactory,
- channelFactory, contactFactory);
- QEventLoop loop;
- Tp::AccountManagerPtr manager = Tp::AccountManager::create();
- Tp::PendingReady *ready = manager->becomeReady();
- QObject::connect(ready, &Tp::PendingReady::finished, &loop, &QEventLoop::quit);
- loop.exec(QEventLoop::ExcludeUserInputEvents);
-
- Tp::AccountPtr simAccount;
- const Tp::AccountSetPtr accountSet = manager->validAccounts();
- for (const Tp::AccountPtr &account : accountSet->accounts()) {
- static const QStringList supportedProtocols = {
- QLatin1String("ofono"),
- QLatin1String("tel"),
- };
- if (supportedProtocols.contains(account->protocolName())) {
- simAccount = account;
- break;
- }
- }
-
- if (simAccount.isNull()) {
- qCritical() << "Unable to get SIM account";
- }
-
- QQmlApplicationEngine engine;
- engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
-
- auto *dialerUtils = new DialerUtils(simAccount);
- engine.rootContext()->setContextProperty("dialerUtils", QVariant::fromValue(dialerUtils));
- engine.rootContext()->setContextProperty("commandlineArguments", parser.positionalArguments());
-
- engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
-
- Tp::SharedPtr callHandler(new CallHandler(dialerUtils));
- registrar->registerClient(Tp::AbstractClientPtr::dynamicCast(callHandler), "Plasma.Dialer");
-
- KAboutData aboutData("dialer", i18n("Dialer"), "0.9", i18n("Plasma phone dialer"), KAboutLicense::GPL);
- aboutData.setDesktopFileName("org.kde.phone.dialer");
-
- KAboutData::setApplicationData(aboutData);
-
- QWindow *window = qobject_cast(engine.rootObjects()[0]);
-
- Q_ASSERT(window);
-
- QObject::connect(&service, &KDBusService::activateRequested, [=](const QStringList &arguments, const QString &workingDirectory) {
- Q_UNUSED(workingDirectory);
- window->show();
- window->requestActivate();
- if (arguments.length() > 0) {
- QString numberArg = arguments[1];
- if (numberArg.startsWith("tel:")) {
- numberArg = numberArg.mid(4);
- }
- dialerUtils->dial(numberArg);
- }
- });
- if (!parser.isSet(daemonOption)) {
- window->show();
- window->requestActivate();
- }
- if (!parser.positionalArguments().isEmpty()) {
- QString numberArg = parser.positionalArguments().first();
- if (numberArg.startsWith("tel:")) {
- numberArg = numberArg.mid(4);
- }
- qWarning() << "Calling" << numberArg;
- dialerUtils->dial(numberArg);
- }
-
- return app.exec();
-}
diff --git a/dialer/src/org.freedesktop.Telepathy.Client.Plasma.Dialer.service.in b/dialer/src/org.freedesktop.Telepathy.Client.Plasma.Dialer.service.in
deleted file mode 100644
index 94dc3e2..0000000
--- a/dialer/src/org.freedesktop.Telepathy.Client.Plasma.Dialer.service.in
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.Telepathy.Client.Plasma.Dialer
-Exec=@CMAKE_INSTALL_PREFIX@/bin/plasmaphonedialer
diff --git a/dialer/src/plasma_dialer.notifyrc b/dialer/src/plasma_dialer.notifyrc
deleted file mode 100644
index 306efda..0000000
--- a/dialer/src/plasma_dialer.notifyrc
+++ /dev/null
@@ -1,168 +0,0 @@
-[Global]
-IconName=call-start
-Comment=Phone
-Comment[ca]=Telèfon
-Comment[ca@valencia]=Telèfon
-Comment[cs]=Telefon
-Comment[da]=Telefon
-Comment[de]=Telefon
-Comment[en_GB]=Phone
-Comment[es]=Teléfono
-Comment[et]=Telefon
-Comment[eu]=Telefonoa
-Comment[fi]=Puhelin
-Comment[fr]=Téléphone
-Comment[gl]=Teléfono
-Comment[hu]=Telefon
-Comment[ia]=Telephono
-Comment[id]=Ponsel
-Comment[it]=Telefono
-Comment[ko]=전화
-Comment[lt]=Telefonas
-Comment[nl]=Telefoon
-Comment[nn]=Telefon
-Comment[pl]=Telefon
-Comment[pt]=Telefone
-Comment[pt_BR]=Telefone
-Comment[ru]=Телефон
-Comment[sk]=Telefón
-Comment[sv]=Telefon
-Comment[tr]=Telefon
-Comment[uk]=Телефон
-Comment[x-test]=xxPhonexx
-Comment[zh_CN]=手机
-Comment[zh_TW]=電話
-
-[Event/callMissed]
-Name=Missed Call
-Name[ca]=Trucada perduda
-Name[ca@valencia]=Trucada perduda
-Name[cs]=Zmeškaný hovor
-Name[da]=Ubesvaret opkald
-Name[de]=Verpasster Anruf
-Name[en_GB]=Missed Call
-Name[es]=Llamada perdida
-Name[et]=Vastamata kõne
-Name[eu]=Dei galdua
-Name[fi]=Vastaamaton puhelu
-Name[fr]=Appel manqué
-Name[gl]=Chamada perdida
-Name[hu]=Nem fogadott hívás
-Name[ia]=Appello perdite
-Name[id]=Miskol
-Name[it]=Chiamata persa
-Name[ko]=부재 중 전화
-Name[lt]=Praleistas skambutis
-Name[nl]=Gemiste oproep
-Name[nn]=Tapt oppringing
-Name[pl]=Połączenie nieodebrane
-Name[pt]=Chamada Não Atendida
-Name[pt_BR]=Chamada não atendida
-Name[ru]=Пропущенный вызов
-Name[sk]=Zmeškaný hovor
-Name[sv]=Missat samtal
-Name[tr]=Cevapsız Çağrı
-Name[uk]=Пропущений дзвінок
-Name[x-test]=xxMissed Callxx
-Name[zh_CN]=错过的呼叫
-Name[zh_TW]=錯過的來電
-Comment=A call has been missed
-Comment[ca]=S'ha perdut una trucada
-Comment[ca@valencia]=S'ha perdut una trucada
-Comment[da]=Et opkald blev mistet
-Comment[de]=Ein Anruf wurde verpasst
-Comment[en_GB]=A call has been missed
-Comment[es]=Se ha perdido una llamada
-Comment[et]=Vastamata jäänud kõne
-Comment[eu]=Dei bat galdu da
-Comment[fi]=Vastaamaton puhelu
-Comment[fr]=Un appel a été manqué
-Comment[gl]=Ten unha chamada perdida.
-Comment[hu]=Egy hívást elmulasztott
-Comment[ia]=Un appello ha essite perdite
-Comment[id]=Sebuah panggilan yang tidak terjawab
-Comment[it]=Una chiamata è stata persa
-Comment[ko]=부재 중 전화가 있음
-Comment[lt]=Buvo praleistas skambutis
-Comment[nl]=Er is een gemiste oproep
-Comment[nn]=Du mista ei oppringing
-Comment[pl]=Nie odebrano połączenia
-Comment[pt]=Uma chamada não foi atendida
-Comment[pt_BR]=Uma chamada foi perdida
-Comment[ru]=Оповещение о пропущенном вызове
-Comment[sk]=Máte zmeškaný hovor
-Comment[sv]=Ett samtal har missats
-Comment[tr]=Cevaplanmamış bir çağrı var
-Comment[uk]=Було пропущено дзвінок
-Comment[x-test]=xxA call has been missedxx
-Comment[zh_CN]=错过了一个呼叫
-Comment[zh_TW]=錯過一次來電
-Action=Popup
-
-[Event/ringing]
-Name=Ringing
-Name[ca]=Sonant
-Name[ca@valencia]=Sonant...
-Name[cs]=Zvoní
-Name[da]=Ringer
-Name[de]=Es klingelt
-Name[en_GB]=Ringing
-Name[es]=Sonando
-Name[et]=Helistamine
-Name[eu]=Jotzen ari da
-Name[fi]=Soi
-Name[fr]=Sonnerie en cours
-Name[gl]=Chámano
-Name[hu]=Kicseng
-Name[ia]=Sonante
-Name[id]=Berdering
-Name[it]=Sta squillando
-Name[ko]=전화 오는 중
-Name[lt]=Skambina
-Name[nl]=Bel gaat over
-Name[nn]=Ringjer
-Name[pl]=Dzwonienie
-Name[pt]=A tocar
-Name[pt_BR]=Chamando
-Name[ru]=Оповещение о вызове
-Name[sk]=Zvoní
-Name[sv]=Ringer
-Name[tr]=Çalıyor
-Name[uk]=Дзвінок
-Name[x-test]=xxRingingxx
-Name[zh_CN]=响铃中
-Name[zh_TW]=響鈴中
-Comment=The phone is ringing
-Comment[ca]=El telèfon està sonant
-Comment[ca@valencia]=El telèfon està sonant
-Comment[cs]=Telefon zvoní
-Comment[da]=Telefonen ringer
-Comment[de]=Das Telefon klingelt
-Comment[en_GB]=The phone is ringing
-Comment[es]=El teléfono está sonando
-Comment[et]=Telefon heliseb
-Comment[eu]=Telefonoa jotzen ari da
-Comment[fi]=Puhelin soi
-Comment[fr]=Le téléphone est en train de sonner
-Comment[gl]=Está a recibir unha chamada.
-Comment[hu]=A telefon kicseng
-Comment[id]=Ponsel berdering
-Comment[it]=Il telefono sta squillando
-Comment[ko]=수신 전화가 있음
-Comment[lt]=Telefonas skambina
-Comment[nl]=De telefoon gaat over
-Comment[nn]=Telefonen ringjer
-Comment[pl]=Telefon dzwoni
-Comment[pt]=O telefone está a tocar
-Comment[pt_BR]=O telefone está tocando
-Comment[ru]=Оповещение о вызове
-Comment[sk]=Telefón zvoní
-Comment[sv]=Telefonen ringer
-Comment[tr]=Telefon çalıyor
-Comment[uk]=Телефон дзвонить
-Comment[x-test]=xxThe phone is ringingxx
-Comment[zh_CN]=手机正在响铃
-Comment[zh_TW]=電話正在響鈴中
-Action=Sound
-Sound=Oxygen-Im-Phone-Ring.ogg
-
diff --git a/dialer/src/qml/Call/AnswerSwipe.qml b/dialer/src/qml/Call/AnswerSwipe.qml
deleted file mode 100644
index d2f1fbe..0000000
--- a/dialer/src/qml/Call/AnswerSwipe.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2015 Marco Martin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import QtQuick 2.4
-import QtQuick.Layouts 1.1
-import org.kde.plasma.core 2.0 as PlasmaCore
-import org.kde.plasma.components 2.0 as PlasmaComponents
-
-MouseArea {
- id: root
-
- signal accepted
- signal rejected
-
- Layout.minimumHeight: units.gridUnit * 5
- Layout.fillWidth: true
- property int handlePosition: (answerHandle.x + answerHandle.width/2)
- drag {
- target: answerHandle
- axis: Drag.XAxis
- minimumX: 0
- maximumX: width - answerHandle.width
- }
- Rectangle {
- anchors.fill: parent
- radius: height
- color: Qt.rgba((handlePosition > root.width/2 ? 0.6 : 0)+0.2, (handlePosition < root.width/2 ? 0.6 : 0)+0.2, 0.2, Math.abs(handlePosition - (root.width/2)) / answerHandle.width/2);
-
- PlasmaCore.IconItem {
- source: "call-start"
- width: icon.width
- height: width
- anchors {
- verticalCenter: parent.verticalCenter
- left: parent.left
- leftMargin: units.largeSpacing
- }
- }
- PlasmaCore.IconItem {
- source: "call-stop"
- width: icon.width
- height: width
- anchors {
- verticalCenter: parent.verticalCenter
- right: parent.right
- leftMargin: units.largeSpacing
- }
- }
-
- Rectangle {
- id: answerHandle
- x: parent.width/2 - width/2
- height: parent.height
- width: height
- radius: width
- color: Qt.rgba(0.2, 0.8, 0.2, 1)
- PlasmaCore.IconItem {
- id: icon
- source: "call-start"
- width: parent.width * 0.7
- height: width
- anchors.centerIn: parent
- }
- Behavior on x {
- enabled: root.pressed
- XAnimator {
- duration: units.longDuration
- easing.type: Easing.InOutQuad
- }
- }
- }
- }
- onReleased: {
- if (answerHandle.x <= answerHandle.width) {
- root.accepted();
- } else if (answerHandle.x + answerHandle.width >= root.width - answerHandle.width) {
- root.rejected();
- }
-
- answerHandle.x = width/2 - answerHandle.width/2
- }
-}
diff --git a/dialer/src/qml/Call/Avatar.qml b/dialer/src/qml/Call/Avatar.qml
deleted file mode 100644
index 1c13860..0000000
--- a/dialer/src/qml/Call/Avatar.qml
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2015 Marco Martin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import QtQuick 2.0
-import QtQuick.Layouts 1.1
-import org.kde.plasma.core 2.0 as PlasmaCore
-import org.kde.plasma.components 2.0 as PlasmaComponents
-
-
-Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
- Layout.minimumHeight: parent.height/2
- Rectangle {
- height: Math.min(parent.width, parent.height)
- width: height
- radius: 5
- anchors.centerIn: parent
- PlasmaCore.IconItem {
- anchors {
- fill: parent
- centerIn: parent
- margins: 20
- }
- source: "im-user"
- }
- }
-}
diff --git a/dialer/src/qml/Call/CallPage.qml b/dialer/src/qml/Call/CallPage.qml
deleted file mode 100644
index 981ca19..0000000
--- a/dialer/src/qml/Call/CallPage.qml
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright 2014 Aaron Seigo
- * Copyright 2015 Marco Martin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import QtQuick 2.0
-import QtQuick.Layouts 1.1
-import org.kde.plasma.core 2.0 as PlasmaCore
-import org.kde.plasma.components 2.0 as PlasmaComponents
-import org.kde.kirigami 2.5 as Kirigami
-
-import "../Dialpad"
-
-Kirigami.Page {
- id: callPage
-
- property string status: dialerUtils.callState
-
- function secondsToTimeString(seconds) {
- var h = Math.floor(seconds / 3600);
- var m = Math.floor((seconds - (h * 3600)) / 60);
- var s = seconds - h * 3600 - m * 60;
- if(h < 10) h = '0' + h;
- if(m < 10) m = '0' + m;
- if(s < 10) s = '0' + s;
- return '' + h + ':' + m + ':' + s;
- }
-
- onStatusChanged: {
- if (status != "active") {
- dialerButton.checked = false;
- }
- }
-
- ColumnLayout {
- id: activeCallUi
- spacing: 10
-
- anchors {
- fill: parent
- margins: 20
- }
-
- Flickable {
- id: topFlickable
- Layout.fillWidth: true
- Layout.fillHeight: true
- Layout.minimumHeight: parent.height/2
-
- contentWidth: topContents.width
- contentHeight: topContents.height
- interactive: status == "active";
- Row {
- id: topContents
- Avatar {
- width: topFlickable.width
- height: topFlickable.height
- }
- Dialpad {
- width: topFlickable.width
- height: topFlickable.height
- }
- }
-
- onMovingChanged: {
- var checked = contentX > topFlickable.width/2;
-
- if (checked) {
- topSlideAnim.to = topFlickable.width;
- } else {
- topSlideAnim.to = 0;
- }
- dialerButton.checked = checked;
- topSlideAnim.running = true;
- }
- PropertyAnimation {
- id: topSlideAnim
- target: topFlickable
- properties: "contentX"
- duration: units.longDuration
- easing.type: Easing.InOutQuad
- }
- }
-
- PlasmaComponents.Label {
- Layout.fillWidth: true
- Layout.minimumHeight: implicitHeight
- horizontalAlignment: Qt.AlignHCenter
- verticalAlignment: Qt.AlignVCenter
- font.pointSize: theme.defaultFont.pointSize * 2
- text: dialerUtils.callContactAlias
- }
- PlasmaComponents.Label {
- Layout.fillWidth: true
- Layout.minimumHeight: implicitHeight
- horizontalAlignment: Qt.AlignHCenter
- verticalAlignment: Qt.AlignVCenter
- text: {
- if (dialerUtils.callState == "dialing") {
- return i18n("Calling...");
- } else if (dialerUtils.callDuration > 0) {
- return secondsToTimeString(dialerUtils.callDuration);
- } else {
- return '';
- }
- }
- }
- PlasmaComponents.ButtonRow {
- opacity: status == "active" ? 1 : 0
- exclusive: false
- spacing: 0
- Layout.alignment: Qt.AlignHCenter
- PlasmaComponents.ToolButton {
- id: muteButton
- flat: false
- iconSource: "audio-volume-high"
- //TODO
-// iconSource: ofonoWrapper.isMicrophoneMuted ? "audio-volume-muted" : "audio-volume-high"
- onClicked: {
- //TODO
-// ofonoWrapper.isMicrophoneMuted = !ofonoWrapper.isMicrophoneMuted;
- }
- }
- PlasmaComponents.ToolButton {
- id: dialerButton
- flat: false
- iconSource: "input-keyboard"
- checkable: true
- onCheckedChanged: {
- if (checked) {
- topSlideAnim.to = topFlickable.width;
- } else {
- topSlideAnim.to = 0;
- }
- topSlideAnim.running = true;
- }
- }
- }
-
-
- Item {
- Layout.minimumHeight: units.gridUnit * 5
- Layout.fillWidth: true
-
- AnswerSwipe {
- anchors.fill: parent
- //STATUS_INCOMING
- visible: status == "incoming"
- onAccepted: {
- dialerUtils.acceptCall();
- }
- onRejected: {
- dialerUtils.rejectCall();
- }
- }
-
- PlasmaComponents.Button {
- anchors.fill: parent
- //STATUS_INCOMING
- visible: status != "incoming"
- iconSource: "call-stop"
- Layout.fillWidth: true
- text: i18n("End Call")
- onClicked: {
- dialerUtils.hangUp();
- }
- }
- }
- }
-}
diff --git a/dialer/src/qml/ContactsPage.qml b/dialer/src/qml/ContactsPage.qml
deleted file mode 100644
index 19e510a..0000000
--- a/dialer/src/qml/ContactsPage.qml
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2015 Martin Klapetek
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import QtQuick 2.7
-import QtQuick.Controls 2.2 as Controls
-import QtQuick.Layouts 1.1
-import org.kde.kirigami 2.10 as Kirigami
-import org.kde.people 1.0 as KPeople
-
-Kirigami.Page {
-
- title: i18n("Contacts")
-
- header: Kirigami.SearchField {
- id: searchField
- onTextChanged: contactsProxyModel.setFilterFixedString(text)
- }
-
- Controls.Label {
- anchors.centerIn: parent
- text: i18n("No contacts")
- visible: contactsList.count === 0
- }
-
- ListView {
- id: contactsList
-
- anchors.fill: parent
-
- section.property: "display"
- section.criteria: ViewSection.FirstCharacter
- section.delegate: Kirigami.ListSectionHeader {text: section}
- clip: true
-
- model: KPeople.PersonsSortFilterProxyModel {
- id: contactsProxyModel
- sourceModel: KPeople.PersonsModel {
- id: contactsModel
- }
- requiredProperties: "phoneNumber"
- filterRole: Qt.DisplayRole
- sortRole: Qt.DisplayRole
- filterCaseSensitivity: Qt.CaseInsensitive
- Component.onCompleted: sort(0)
- }
-
- boundsBehavior: Flickable.StopAtBounds
-
- Component {
- id: contactListDelegate
-
- Kirigami.BasicListItem {
- icon: model.decoration
- label: model.display
-// onClicked: dialerUtils.dial(model.phoneNumber)
- }
- }
-
- delegate: Kirigami.DelegateRecycler {
- width: parent.width
- sourceComponent: contactListDelegate
- }
- }
-}
diff --git a/dialer/src/qml/DialerPage.qml b/dialer/src/qml/DialerPage.qml
deleted file mode 100644
index 34f2f4f..0000000
--- a/dialer/src/qml/DialerPage.qml
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2014 Aaron Seigo
- * Copyright 2014 Marco Martin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import QtQuick 2.0
-import QtQuick.Layouts 1.1
-import QtQuick.Controls 2.5 as QQC2
-import org.kde.plasma.core 2.0 as PlasmaCore
-import org.kde.plasma.components 2.0 as PlasmaComponents
-import org.kde.kirigami 2.9 as Kirigami
-import "Dialpad"
-
-Kirigami.Page {
- id: dialer
-
- property alias numberEntryText: status.text
-
- title: i18n("Dialer")
- header: Kirigami.InlineMessage {
- type: Kirigami.MessageType.Error
- text: i18n("Unable to make a call at this moment")
- visible: dialerUtils.callState == "failed"
- }
-
- ColumnLayout {
- id: dialPadArea
- anchors.fill: parent
-
- QQC2.Label {
- id: status
-
- horizontalAlignment: Qt.AlignHCenter
- verticalAlignment: Qt.AlignBottom
-
- Layout.fillWidth: true
- Layout.topMargin: units.largeSpacing * 2
- Layout.bottomMargin: units.largeSpacing
- Layout.minimumHeight: units.gridUnit * 3
- Layout.maximumHeight: Layout.minimumHeight
- font.pixelSize: units.gridUnit * 2.3
-
- text: dialerUtils.formatNumber(dialPad.number)
- }
-
- Dialpad {
- id: dialPad
- Layout.fillWidth: true
- Layout.fillHeight: true
- }
- }
-}
diff --git a/dialer/src/qml/Dialpad/DialerButton.qml b/dialer/src/qml/Dialpad/DialerButton.qml
deleted file mode 100644
index 200fd26..0000000
--- a/dialer/src/qml/Dialpad/DialerButton.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2014 Aaron Seigo
- * Copyright 2014 Marco Martin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import QtQuick 2.4
-import QtQuick.Layouts 1.1
-import QtQuick.Controls 2.2 as Controls
-
-import org.kde.kirigami 2.2 as Kirigami
-
-
-Item {
- id: root
- Layout.fillWidth: true
- Layout.fillHeight: true
-
- signal clicked(string text)
-
- property string text
- property string sub
- property string display
- property string subdisplay
- property bool special: false
-
- Rectangle {
- anchors.fill: parent
- z: -1
- color: Kirigami.Theme.highlightColor
- radius: units.smallSpacing
- opacity: mouse.pressed ? 0.4 : 0
- Behavior on opacity {
- OpacityAnimator {
- duration: Kirigami.Units.longDuration
- easing.type: Easing.InOutQuad
- }
- }
- }
-
- MouseArea {
- id: mouse
- anchors.fill: parent
-
- onClicked: root.clicked(parent.text)
-
- onPressAndHold: {
- var text = parent.sub.length > 0 ? parent.sub : parent.text
- if (text.length === 1) {
- root.clicked(text);
- }
- }
- }
-
- ColumnLayout {
- spacing: -5
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
-
- Controls.Label {
- id: main
-
- font.pixelSize: units.gridUnit * 2
- text: root.display || root.text
- opacity: special ? 0.4 : 1.0
- Layout.minimumWidth: parent.width
- horizontalAlignment: Text.AlignHCenter
- }
-
- Controls.Label {
- id: longHold
-
- text: root.subdisplay || root.sub
- opacity: 0.4
- Layout.minimumWidth: parent.width
- horizontalAlignment: Text.AlignHCenter
- }
- }
-}
diff --git a/dialer/src/qml/Dialpad/DialerIconButton.qml b/dialer/src/qml/Dialpad/DialerIconButton.qml
deleted file mode 100644
index 726618c..0000000
--- a/dialer/src/qml/Dialpad/DialerIconButton.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2014 Aaron Seigo
- * Copyright 2014 Marco Martin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import QtQuick 2.4
-import QtQuick.Layouts 1.1
-import QtQuick.Controls 2.2 as Controls
-
-import org.kde.kirigami 2.2 as Kirigami
-
-
-Item {
- id: buttonRoot
-
- Layout.fillWidth: true
- Layout.fillHeight: true
-
- signal pressed()
-
- property var callback
- property string sub
- property alias source: icon.source
- property alias text: label.text
- property int size
-
- Rectangle {
- anchors.fill: parent
- z: -1
- color: Kirigami.Theme.highlightColor
- radius: units.smallSpacing
- opacity: mouse.pressed ? 0.4 : 0
- Behavior on opacity {
- OpacityAnimator {
- duration: units.longDuration
- easing.type: Easing.InOutQuad
- }
- }
- }
-
- Row {
- anchors.centerIn: parent
- Kirigami.Icon {
- id: icon
- anchors.verticalCenter: parent.verticalCenter
- width: height
- height: buttonRoot.size || buttonRoot.height * 0.6
- }
- Controls.Label {
- id: label
- height: buttonRoot.height
- anchors.verticalCenter: parent.verticalCenter
- fontSizeMode: Text.VerticalFit
- }
- }
-
- MouseArea {
- id: mouse
- anchors.fill: parent
- onClicked: buttonRoot.pressed()
- }
-}
diff --git a/dialer/src/qml/Dialpad/Dialpad.qml b/dialer/src/qml/Dialpad/Dialpad.qml
deleted file mode 100644
index 06d98a0..0000000
--- a/dialer/src/qml/Dialpad/Dialpad.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2014 Aaron Seigo
- * Copyright 2014 Marco Martin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import QtQuick 2.0
-import QtQuick.Layouts 1.2
-
-import org.kde.kirigami 2.5 as Kirigami
-
-GridLayout {
- id: pad
- columns: 3
- rowSpacing: 10
- columnSpacing: 10
- Layout.leftMargin: Kirigami.Units.largeSpacing * 2
- Layout.rightMargin: Kirigami.Units.largeSpacing * 2
-
- property string number
-
- DialerButton { id: one; text: "1"; onClicked: pad.number += text }
- DialerButton { text: "2"; sub: "ABC"; onClicked: pad.number += text }
- DialerButton { text: "3"; sub: "DEF"; onClicked: pad.number += text }
-
- DialerButton { text: "4"; sub: "GHI"; onClicked: pad.number += text }
- DialerButton { text: "5"; sub: "JKL"; onClicked: pad.number += text }
- DialerButton { text: "6"; sub: "MNO"; onClicked: pad.number += text }
-
- DialerButton { text: "7"; sub: "PQRS"; onClicked: pad.number += text }
- DialerButton { text: "8"; sub: "TUV"; onClicked: pad.number += text }
- DialerButton { text: "9"; sub: "WXYZ"; onClicked: pad.number += text }
-
- DialerButton { display: "*"; text: "*"; special: true; onClicked: pad.number += text }
- DialerButton { text: "0"; subdisplay: "+"; sub: "+"; onClicked: pad.number += text }
- DialerButton { display: "#"; text: "#"; special: true; onClicked: pad.number += text }
-
- Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
- }
-
- DialerIconButton {
- id: callButton
- Layout.fillWidth: true
- Layout.fillHeight: true
-
- enabled: status.text.length > 0
- opacity: enabled ? 1 : 0.5
- source: "call-start"
- size: Kirigami.Units.gridUnit * 3
- onPressed: call(status.text)
- }
- DialerIconButton {
- id: delButton
- Layout.fillWidth: true
- Layout.fillHeight: true
-
- enabled: status.text.length > 0
- opacity: enabled ? 1 : 0.5
- source: "edit-clear"
- size: Kirigami.Units.gridUnit * 2
- onPressed: {
- pad.number = pad.number.slice(0, -1)
- }
- }
-}
diff --git a/dialer/src/qml/HistoryDelegate.qml b/dialer/src/qml/HistoryDelegate.qml
deleted file mode 100644
index 876fdc5..0000000
--- a/dialer/src/qml/HistoryDelegate.qml
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright 2015 Marco Martin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import QtQuick 2.4
-import QtQuick.Layouts 1.1
-import QtQuick.Controls 2.2 as Controls
-
-import org.kde.kirigami 2.2 as Kirigami
-import org.kde.plasma.components 2.0 as PlasmaComponents
-
-Item {
- id: delegateParent
- width: view.width
- height: childrenRect.height
-
- Behavior on height {
- SpringAnimation { spring: 5; damping: 0.3 }
- }
- SequentialAnimation {
- id: removeAnim
- XAnimator {
- target: delegate
- from: delegate.x
- to: delegate.x > 0 ? width : -width
- duration: units.longDuration
- easing.type: Easing.InOutQuad
- }
- PropertyAnimation {
- target: delegateParent
- properties: "height"
- to: 0
- duration: units.longDuration
- easing.type: Easing.InOutQuad
- }
- ScriptAction {
- script: filterModel.remove(model.index)
- }
- }
-
- XAnimator {
- id: resetAnim
- target: delegate
- from: delegate.x
- to: 0
- duration: units.longDuration
- easing.type: Easing.InOutQuad
- }
-
- PlasmaComponents.ListItem {
- id: delegate
-
- MouseArea {
- width: parent.width
- height: childrenRect.height
- onClicked: call(model.number);
- drag.axis: Drag.XAxis
- drag.target: delegate
- onReleased: {
- if (drag.active) {
- if (delegate.x > delegate.width / 3 || delegate.x < width / -3) {
- removeAnim.running = true;
- } else {
- resetAnim.running = true;
- }
- }
- }
-
- RowLayout {
- width: parent.width
- //FIXME: ad hoc icons
- Kirigami.Icon {
- width: units.iconSizes.medium
- height: width
- source: {
- switch (model.callType) {
- case 0:
- return "list-remove";
- case 1:
- return "go-down";
- case 2:
- return "go-up";
- }
- }
- }
- ColumnLayout {
- Controls.Label {
- text: "Name (todo)"
- }
- Controls.Label {
- text: model.number
- Layout.fillWidth: true
- }
- }
- ColumnLayout {
- Controls.Label {
- Layout.alignment: Qt.AlignRight
- text: Qt.formatTime(model.time, Qt.locale().timeFormat(Locale.ShortFormat));
- }
- Controls.Label {
- Layout.alignment: Qt.AlignRight
- text: i18n("Duration: %1", secondsToTimeString(model.duration));
- visible: model.duration > 0
- }
- }
- }
- }
- }
-}
diff --git a/dialer/src/qml/HistoryPage.qml b/dialer/src/qml/HistoryPage.qml
deleted file mode 100644
index d3c48c3..0000000
--- a/dialer/src/qml/HistoryPage.qml
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2015 Marco Martin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-import QtQuick 2.3
-import QtQuick.Controls 2.3
-import QtQuick.Layouts 1.1
-
-import org.kde.plasma.extras 2.0 as PlasmaExtras
-import org.kde.plasma.core 2.0 as PlasmaCore
-import org.kde.kirigami 2.0 as Kirigami
-import org.kde.plasma.components 2.0 as PlasmaComponents
-
-import org.kde.plasma.dialer 1.0
-
-Kirigami.Page {
-
- title: i18n("History")
-
- function secondsToTimeString(seconds) {
- var h = Math.floor(seconds / 3600);
- var m = Math.floor((seconds - (h * 3600)) / 60);
- var s = seconds - h * 3600 - m * 60;
- if(h < 10) h = '0' + h;
- if(m < 10) m = '0' + m;
- if(s < 10) s = '0' + s;
- return '' + h + ':' + m + ':' + s;
- }
-
- Label {
- anchors.centerIn: parent
- text: i18n("No recent calls")
- visible: view.count == 0
- }
-
- ColumnLayout {
- anchors.fill: parent
- visible: view.count > 0
- PlasmaComponents.ToolBar {
- Layout.fillWidth: true
- tools: RowLayout {
- id: toolBarLayout
- PlasmaComponents.TabBar {
- tabPosition: Qt.TopEdge
- PlasmaComponents.TabButton {
- iconSource: "call-start"
- text: i18n("All")
- onCheckedChanged: {
- if (checked) {
- filterModel.setFilterFixedString("")
- }
- }
- }
- PlasmaComponents.TabButton {
- iconSource: "list-remove"
- text: i18n("Missed")
- onCheckedChanged: {
- if (checked) {
- filterModel.setFilterFixedString("0")
- }
- }
- }
- }
- Item {
- Layout.fillWidth: true
- }
- PlasmaComponents.Button {
- text: i18n("Clear")
- onClicked: historyModel.clear()
- }
- }
- }
- PlasmaExtras.ScrollArea {
- Layout.fillWidth: true
- Layout.fillHeight: true
- ListView {
- id: view
- model: CallHistorySortFilterModel {
- id: filterModel
- sourceModel: historyModel
- filterRole: CallHistoryModel.CallTypeRole
- sortRole: CallHistoryModel.TimeRole
- Component.onCompleted: sort(0, Qt.DescendingOrder)
- }
- section {
- property: "date"
- delegate: PlasmaComponents.ListItem {
- id: sectionItem
- sectionDelegate: true
- PlasmaComponents.Label {
- text: Qt.formatDate(section, Qt.locale().dateFormat(Locale.LongFormat));
- }
- }
- }
- delegate: HistoryDelegate {}
- }
- }
- }
-}
diff --git a/dialer/src/qml/main.qml b/dialer/src/qml/main.qml
deleted file mode 100644
index 71836f8..0000000
--- a/dialer/src/qml/main.qml
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Copyright 2014 Aaron Seigo
- * Copyright 2014 Marco Martin
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import QtQuick 2.3
-import QtQuick.Controls 2.3
-import QtQuick.Layouts 1.1
-import QtQuick.LocalStorage 2.0
-
-import org.kde.plasma.extras 2.0 as PlasmaExtras
-import org.kde.kirigami 2.0 as Kirigami
-
-import org.kde.plasma.dialer 1.0
-
-Kirigami.ApplicationWindow {
- id: root
-
-//BEGIN PROPERTIES
- width: 1080
- height: 800
-
- visible: false
-
- //keep track if we were visible when ringing
- property bool wasVisible
- //was the last call an incoming one?
- property bool isIncoming
-
- pageStack.globalToolBar.style:Kirigami.ApplicationHeaderStyle.Titles
-//END PROPERTIES
-
-//BEGIN SIGNAL HANDLERS
- Connections {
- target: dialerUtils
- onMissedCallsActionTriggered: {
- root.visible = true;
- }
- onCallEnded: {
- var callType;
- if (isIncomingCall && callDuration == 0) {
- callType = 0;
- } else if (isIncomingCall && callDuration > 0) {
- callType = 1;
- } else {
- callType = 2;
- }
- historyModel.addCall(callContactNumber, callDuration, callType)
- }
- }
-
- onVisibleChanged: {
- //TODO
- //reset missed calls if the status is not STATUS_INCOMING when got visible
- }
-//END SIGNAL HANDLERS
-
-//BEGIN FUNCTIONS
- function call(number) {
- dialerUtils.dial(number);
- }
-//END FUNCTIONS
-
-//BEGIN MODELS
- CallHistoryModel {
- id: historyModel
- }
-
-//END MODELS
-
- pageStack.initialPage: dialerUtils.callState == "idle" || dialerUtils.callState == "failed" ? [Qt.resolvedUrl("HistoryPage.qml"), Qt.resolvedUrl("ContactsPage.qml"), Qt.resolvedUrl("DialerPage.qml")] : Qt.resolvedUrl("Call/CallPage.qml")
-
- footer: TabBar {
- height: 50
-
- currentIndex: pageStack.currentIndex
-
- TabButton {
- text: i18n("History")
- icon.name: "view-pim-contacts"
- onClicked: pageStack.currentIndex = 0
- }
- TabButton {
- text: i18n("Contacts")
- icon.name: "view-pim-contacts"
- onClicked: pageStack.currentIndex = 1
- }
- TabButton {
- text: i18n("Dialer")
- icon.name: "view-pim-contacts"
- onClicked: pageStack.currentIndex = 2
- }
- }
-}
diff --git a/dialer/src/resources.qrc b/dialer/src/resources.qrc
deleted file mode 100644
index 46287ec..0000000
--- a/dialer/src/resources.qrc
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- qml/main.qml
- qml/DialerPage.qml
- qml/ContactsPage.qml
- qml/HistoryPage.qml
- qml/Call/AnswerSwipe.qml
- qml/Call/CallPage.qml
- qml/Call/Avatar.qml
- qml/HistoryDelegate.qml
- qml/Dialpad/Dialpad.qml
- qml/Dialpad/DialerButton.qml
- qml/Dialpad/DialerIconButton.qml
-
-