...
 
Commits (3)
......@@ -38,6 +38,8 @@ find_package(GStreamer 1.1.90 REQUIRED)
find_package(GLIB2 REQUIRED)
find_package(GObject REQUIRED)
find_package(Qofono REQUIRED)
include(CheckIncludeFiles)
plasma_install_package(look-and-feel org.kde.plasma.phone look-and-feel)
......
#=============================================================================
# Copyright (c) 2019 Bhushan Shah <bshah@kde.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
find_package(PkgConfig)
pkg_check_modules(PC_Qofono QUIET qofono-qt5)
find_path(Qofono_INCLUDE_DIR
NAMES qofono.h
PATHS ${PC_Qofono_INCLUDE_DIRS}
PATH_SUFFIXES qofono-qt5
)
find_library(Qofono_LIBRARY
NAMES qofono-qt5
PATHS ${PC_Qofono_LIBRARY_DIRS}
)
set(Qofono_VERSION ${PC_Qofono_VERSION})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Qofono
FOUND_VAR Qofono_FOUND
REQUIRED_VARS
Qofono_LIBRARY
Qofono_INCLUDE_DIR
VERSION_VAR Qofono_VERSION
)
if(Qofono_FOUND)
set(Qofono_LIBRARIES ${Qofono_LIBRARY})
set(Qofono_INCLUDE_DIRS ${Qofono_INCLUDE_DIR})
set(Qofono_DEFINITIONS ${PC_Qofono_CFLAGS_OTHER})
endif()
mark_as_advanced(
Qofono_INCLUDE_DIR
Qofono_LIBRARY
)
......@@ -126,15 +126,14 @@ ContainmentLayoutManager.ItemContainer {
visible: text.length > 0
Layout.fillWidth: true
Layout.preferredHeight: root.reservedSpaceForLabel
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignTop
maximumLineCount: 2
elide: Text.ElideRight
text: model.ApplicationNameRole
font.pixelSize: theme.defaultFont.pixelSize
text: model.ApplicationNameRole.split(" ")[0]
//FIXME: export smallestReadableFont
font.pixelSize: theme.defaultFont.pixelSize * 0.8
color: model.ApplicationLocationRole == ApplicationListModel.Desktop ? "white" : theme.textColor
layer.enabled: model.ApplicationLocationRole == ApplicationListModel.Desktop
......
......@@ -45,7 +45,7 @@ Item {
Controls.Label {
id: metrics
text: "M\nM"
text: "M"
visible: false
}
......
......@@ -32,5 +32,9 @@ QQC2.Control {
background: PlasmaCore.FrameSvgItem {
imagePath: "widgets/background"
// This MouseArea just prevents the Control from eating pure touch event (breaking flickables)
MouseArea {
anchors.fill:parent
}
}
}
install(FILES metadata.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} RENAME org.kde.phone.dialer.desktop)
include_directories(${TELEPATHY_QT5_INCLUDE_DIR})
#
include_directories(${Qofono_INCLUDE_DIRS})
add_subdirectory(src)
......@@ -21,6 +21,7 @@ target_link_libraries(plasmaphonedialer
KF5::DBusAddons
KF5::Notifications
${TELEPATHY_QT5_LIBRARIES}
${Qofono_LIBRARIES}
)
install(TARGETS plasmaphonedialer ${INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -35,6 +35,7 @@
#include <qcommandlineoption.h>
#include <QtQml>
#include <QEventLoop>
#include <QQmlContext>
#include <QQmlEngine>
#include <QQuickWindow>
......@@ -42,6 +43,7 @@
#include <KAboutData>
#include <KDBusService>
#include <qofonomanager.h>
void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
......@@ -137,10 +139,18 @@ int main(int argc, char **argv)
Tp::ClientRegistrarPtr registrar = Tp::ClientRegistrar::create(accountFactory, connectionFactory,
channelFactory, contactFactory);
Tp::AccountPtr simAccount = Tp::Account::create(TP_QT_ACCOUNT_MANAGER_BUS_NAME, QStringLiteral("/org/freedesktop/Telepathy/Account/ofono/ofono/account0"),
// we ask the ofono for the default modem, which is generally first modem
QOfonoManager *ofonoManager = new QOfonoManager;
QEventLoop loop;
QObject::connect(ofonoManager, &QOfonoManager::availableChanged, &loop, &QEventLoop::quit);
loop.exec(QEventLoop::ExcludeUserInputEvents);
const QString accountName = ofonoManager->modems().isEmpty() ? "" : ofonoManager->modems().first();
Tp::AccountPtr simAccount = Tp::Account::create(TP_QT_ACCOUNT_MANAGER_BUS_NAME, QStringLiteral("/org/freedesktop/Telepathy/Account/ofono/ofono") + accountName,
connectionFactory, channelFactory);
const QString packagePath("org.kde.phone.dialer");
//usually we have an ApplicationWindow here, so we do not need to create a window by ourselves
......