diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dd219b4f..4a88630c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,370 +1,363 @@
IF(POLICY CMP0017)
CMAKE_POLICY(SET CMP0017 NEW)
ENDIF(POLICY CMP0017)
IF(POLICY CMP0022)
CMAKE_POLICY(SET CMP0022 NEW)
ENDIF(POLICY CMP0022)
IF(POLICY CMP0063)
CMAKE_POLICY(SET CMP0063 NEW)
ENDIF(POLICY CMP0063)
SET(QT_MIN_VERSION "5.2.0")
ADD_DEFINITIONS(
${KF5_DEFINITIONS}
${QT_DEFINITIONS}
-fexceptions
-Wno-error
-Wno-reorder
-Wno-error=deprecated-declarations
)
# It doesn't work in sandboxes
IF (NOT ENABLE_SINGLE_INSTANCE)
ADD_DEFINITIONS(-DDISABLE_KDBUS_SERVICE=1)
ENDIF()
# Enable some useful warnings
ADD_DEFINITIONS(
-Wall
-Wextra
-Wmissing-declarations
-Wmissing-noreturn
-Wpointer-arith
-Wcast-align
-Wwrite-strings
-Wformat-nonliteral
-Wformat-security
-Wswitch-enum
-Winit-self
-Wmissing-include-dirs
-Wundef
-Wmissing-format-attribute
-Wno-reorder
-Wunused
-Wuninitialized
-Woverloaded-virtual
-Wunused-value
-pedantic
-Wnonnull
-Wsequence-point
#-Wsystem-headers
-Wsizeof-pointer-memaccess
#-Wuseless-cast
-Wvarargs
)
#Add more warnings for compilers that support it. I used this command:
#curl https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Warning-Options.html | \
#grep -E "^[\t ]+
-W[a-zA-Z=-]*" -o | grep -E "\-W[a-zA-Z=-]*" -o >
#cat /tmp/48 /tmp/49 | sort | uniq -u
# IF (CMAKE_COMPILER_IS_GNUCC)
IF (CMAKE_COMPILER_IS_GNUCC)
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.9)
ADD_DEFINITIONS(
-Wunused-but-set-parameter
-Wconditionally-supported
-Wno-cpp
# -Wdouble-promotion
-Wdate-time
-Wdelete-incomplete
# -Wfloat-conversion
)
ENDIF()
IF (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.9)
ADD_DEFINITIONS(
-Wno-pragmas
)
ENDIF()
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.0)
ADD_DEFINITIONS(
-Wsuggest-override
-Wsuggest-final-types
-Wsuggest-final-methods
-Wbool-compare
-Wformat-signedness
-Wlogical-not-parentheses
-Wnormalized
-Wshift-count-negative
-Wshift-count-overflow
-Wsized-deallocation
-Wsizeof-array-argument
)
ENDIF()
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.0)
ADD_DEFINITIONS(
-Wnull-dereference
-Wtautological-compare
-Wduplicated-cond
-Wmisleading-indentation
)
ENDIF()
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.0)
ADD_DEFINITIONS(
-Wimplicit-fallthrough
-Wduplicated-branches
-Wswitch-unreachable
-Wformat-overflow
-Wformat-truncation
-Wnonnull
)
ENDIF()
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 8.0)
ADD_DEFINITIONS(
-Wmultistatement-macros
-Wstringop-truncation
-Wif-not-aligned
-Wmissing-attributes
)
ENDIF()
ENDIF()
IF (CMAKE_COMPILER_IS_GNUCC)
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION)
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6.9 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.6)
#GCC 4.6 version of those warnings does detect valid C++0x/C++11 as invalid.
ADD_DEFINITIONS(
-Wno-error=pragmas
-Wno-pragmas
-Wno-error
)
ENDIF()
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.7 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.7)
ADD_DEFINITIONS(
-Wmaybe-uninitialized
-Wunused-local-typedefs
-pedantic
)
ENDIF()
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.8)
# ADD_DEFINITIONS("-Wzero-as-null-pointer-constant")
# ADD_DEFINITIONS( -DENABLE_IGNORE_NULL=true )
ENDIF()
ELSE()
ADD_DEFINITIONS(-Wno-unknown-pragmas -Wno-unknown-warning-option)
ENDIF()
ADD_DEFINITIONS("-std=c++0x")
#Make sure it can access DBUS autogenerated files
INCLUDE_DIRECTORIES(SYSTEM
${KF5_INCLUDES}
${Qt5Widgets_INCLUDES}
${Qt5PrintSupport_INCLUDES}
${Qt5Core_INCLUDES}
${CMAKE_BINARY_DIR}
${ringqt_INCLUDE_DIR}
${LIB_TIP_INCLUDE}
${LIB_CONFIG_INCLUDE}
${LIB_CONFIG_WIDGETS}
)
# Shared C++ QML components
ADD_SUBDIRECTORY( qmlwidgets )
# Pack the icons shared by various components
ADD_SUBDIRECTORY( sharedassets )
#Build KDE specific files
ADD_SUBDIRECTORY( klib )
# Build the QML based first run Wizard
ADD_SUBDIRECTORY( wizard )
# Build the QML based interactive video canvas
ADD_SUBDIRECTORY( callview )
# Build the advanced phone dialer
ADD_SUBDIRECTORY( dialview )
# Build the views and widgets related to the social timeline feature
ADD_SUBDIRECTORY( timeline )
# Build the contact and profile photo editor dialog
ADD_SUBDIRECTORY( photoselector )
# Build the elements used to notify the users of events
ADD_SUBDIRECTORY( canvasindicators )
# Build the contact manager subsystem
ADD_SUBDIRECTORY( contactview )
# Build the account manager subsystem
ADD_SUBDIRECTORY( accountview )
# Build the main desktop component
ADD_SUBDIRECTORY( desktopview )
IF(${CMAKE_BUILD_TYPE} MATCHES Release)
MESSAGE("NO DEBUG OUTPUT")
ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT)
ELSE()
ENDIF(${CMAKE_BUILD_TYPE} MATCHES Release)
# Delegates
SET(
ring_kde_PROXIES
delegates/kdepixmapmanipulation.cpp
proxies/simplerotateproxy.cpp
proxies/deduplicateproxy.cpp
proxies/filtertoplevelproxy.cpp
proxies/roletransformationproxy.cpp
proxies/flagsfilterproxy.cpp
proxies/pollingproxy.cpp
)
SET(
ring_kde_SRCS
main.cpp
cmd.cpp
notification.cpp
ringapplication.cpp
errormessage.cpp
actioncollection.cpp
implementation.cpp
model/extendedprotocolmodel.cpp
${ring_kde_PROXIES}
widgets/systray.cpp
- configurator/localhistoryconfigurator.cpp
- configurator/peerprofileconfigurator.cpp
- configurator/bookmarkconfigurator.cpp
- configurator/audiorecordingconfigurator.cpp
- configurator/fallbackpersonconfigurator.cpp
- conf/dlggeneral.cpp
- widgets/filterlineedit.cpp
)
IF (Qt5TextToSpeech_FOUND)
SET(
ring_kde_SRCS
${ring_kde_SRCS}
accessibility.cpp
)
ENDIF()
# generate rules for building source files from the resources
SET(QtApp_RCCS
qrc/resources.qrc
# conf/confresources.qrc
../data/appicon.qrc
)
QT5_ADD_RESOURCES(QtApp_RCC_SRCS ${QtApp_RCCS})
# add_subdirectory( test ) #Enable again some day, it cause compile problems for some users
IF(NOT (${ENABLE_VIDEO} MATCHES false))
SET(ENABLE_VIDEO 1 CACHE BOOLEAN "Enable video")
ADD_DEFINITIONS( -DENABLE_VIDEO=true )
SET (
config_ui_files
${config_ui_files}
conf/dlgvideobase.ui
)
ENDIF(NOT (${ENABLE_VIDEO} MATCHES false))
IF(${DISABLE_UNIQUE_APPLICATION} MATCHES true)
MESSAGE("KUniqueApplication disabled")
SET(DISABLE_UNIQUE_APPLICATION 1 CACHE BOOLEAN "Disable KUniqueApplication")
ADD_DEFINITIONS( -DDISABLE_UNIQUE_APPLICATION=true )
ENDIF(${DISABLE_UNIQUE_APPLICATION} MATCHES true)
ki18n_wrap_ui(ring_kde_SRCS ${config_ui_files} )
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
ADD_EXECUTABLE(ring-kde MACOSX_BUNDLE ${ring_kde_SRCS} ${QtApp_RCC_SRCS})
set_source_files_properties( ../data/ring-kdeui.rc PROPERTIES MACOSX_PACKAGE_LOCATION Resources )
file( COPY ../data/ring-kdeui.rc DESTINATION "ring-kde.app/Contents/Resources/" )
ELSE()
ADD_EXECUTABLE(ring-kde ${ring_kde_SRCS} ${QtApp_RCC_SRCS})
ENDIF()
IF(NOT ${ENABLE_STATIC} MATCHES false)
FIND_PACKAGE(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED DBus)
INCLUDE_DIRECTORIES(SYSTEM ${Qt5DBus_INCLUDE_DIRS} )
LINK_DIRECTORIES(${Qt5DBus_LIBRARY_DIRS} )
ADD_DEFINITIONS(${Qt5DBus_CFLAGS})
IF(NOT DEFINED OS_ANDROID)
TARGET_LINK_LIBRARIES(ring-kde
-lpthread
)
ENDIF()
TARGET_LINK_LIBRARIES(ring-kde
${ringqt_LIBRARY_STATIC}
)
IF(NOT ${ENABLE_LIBWRAP})
TARGET_LINK_LIBRARIES(ring-kde
${Qt5DBus_LIBRARIES}
)
ENDIF()
ELSE()
TARGET_LINK_LIBRARIES(ring-kde ${ringqt_LIBRARY_DYNAMIC})
ENDIF()
QT5_ADD_DBUS_ADAPTOR(ring_kde_SRCS ../data/org.kde.kuiserver.xml cmd.h Cmd )
TARGET_LINK_LIBRARIES(ring-kde
libkring
libwizard
libcallview
dialview
libtimeline
libphotoselector
libcanvasindicator
desktopview
contactview
accountview
libqmlwidgets
kquickitemviews
# RingQt
ringqtquick
# Qt5
Qt5::Widgets
Qt5::Core
Qt5::Gui
Qt5::Svg
Qt5::PrintSupport
# KF5
KF5::I18n
KF5::WidgetsAddons
KF5::ConfigCore
KF5::ConfigGui
KF5::DBusAddons
KF5::XmlGui
KF5::Notifications
KF5::IconThemes
KF5::Crash
KF5::NotifyConfig
KF5::GlobalAccel
KF5::Declarative
KF5::Kirigami2
)
IF (Qt5TextToSpeech_FOUND)
TARGET_LINK_LIBRARIES(ring-kde
Qt5::TextToSpeech
)
ENDIF()
########### install files ###############
INSTALL( TARGETS ring-kde DESTINATION ${BIN_INSTALL_DIR} )
INSTALL( FILES wizard/assets/beta_logo.svg DESTINATION ${DATA_INSTALL_DIR}/ring-kde )
diff --git a/src/callview/qml/devicesetting.qml b/src/callview/qml/devicesetting.qml
index 829356db..4a435cea 100644
--- a/src/callview/qml/devicesetting.qml
+++ b/src/callview/qml/devicesetting.qml
@@ -1,76 +1,77 @@
/***************************************************************************
* Copyright (C) 2017 by Bluesystems *
* Author : Emmanuel Lepage Vallee *
* *
* 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 3 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 . *
**************************************************************************/
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import RingQmlWidgets 1.0
import Ring 1.0
import org.kde.playground.kquickitemviews 1.0 as KQuickItemViews
+import net.lvindustries.ringqtquick 1.0 as RingQtQuick
GridLayout {
property alias deviceSelectionModel : device.selectionModel
property alias channelSelectionModel : channel.selectionModel
property alias resolutionSelectionModel: resolution.selectionModel
property alias rateSelectionModel : rate.selectionModel
columns: 2
Text {
color: "white"
text: i18n("Device")
}
KQuickItemViews.ComboBoxView {
id: device
Layout.fillWidth: true
- selectionModel: VideoDeviceSelectionModel
+ selectionModel: RingSession.deviceModel.configurationProxy.deviceSelectionModel
}
Text {
color: "white"
text: i18n("Channel")
}
KQuickItemViews.ComboBoxView {
id: channel
- selectionModel: VideoChannelSelectionModel
+ selectionModel: RingSession.deviceModel.configurationProxy.channelSelectionModel
Layout.fillWidth: true
}
Text {
color: "white"
text: i18n("Resolution")
}
KQuickItemViews.ComboBoxView {
id: resolution
- selectionModel: VideoResolutionSelectionModel
+ selectionModel: RingSession.deviceModel.configurationProxy.resolutionSelectionModel
Layout.fillWidth: true
}
Text {
color: "white"
text: i18n("Frame rate")
}
KQuickItemViews.ComboBoxView {
id: rate
- selectionModel: VideoRateSelectionModel
+ selectionModel: RingSession.deviceModel.configurationProxy.rateSelectionModel
Layout.fillWidth: true
}
//I got no idea why. If there is no extra row, the column width is wrong
Item {
Layout.fillHeight: true
}
}
diff --git a/src/cmd.cpp b/src/cmd.cpp
index dff49b3c..3775301f 100644
--- a/src/cmd.cpp
+++ b/src/cmd.cpp
@@ -1,225 +1,221 @@
/***************************************************************************
* Copyright (C) 2013-2015 by Savoir-Faire Linux *
* Author : Emmanuel Lepage Vallee *
* *
* 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 3 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 "cmd.h"
//Qt
#include
#include
#include
#include
//KDE
#include
#include
//Ring
#include
#include
#include
#include
#include "ringapplication.h"
#include "klib/kcfg_settings.h"
//Static definition
Cmd* Cmd::m_spSelf = nullptr;
///(Private) constructor
Cmd::Cmd(QObject* parent) : QObject(parent)
{
}
///Signleton
Cmd* Cmd::instance() {
if (!m_spSelf) {
m_spSelf = new Cmd();
}
return m_spSelf;
}
///Setup command line options before passing them to the KUniqueApplication
bool Cmd::parseCmd(int argc, char **argv, KAboutData& about)
{
Q_UNUSED(argc)
Q_UNUSED(argv)
QCoreApplication* app = QCoreApplication::instance();
QCommandLineOption call (QStringList { "place-call" }, i18n("Place a call to a given number" ), QStringLiteral("number" ), QLatin1String(""));
QCommandLineOption text (QStringList { "send-text" }, i18n("Send a text to <number>, use --message to set the content, then hangup"), QStringLiteral("number" ), QLatin1String(""));
QCommandLineOption message (QStringList { "message" }, i18n("Used in combination with --send-text" ), QStringLiteral("content"), QLatin1String(""));
QCommandLineOption icon (QStringList { "iconify" }, i18n("Start in the system tray" ) );
QCommandLineOption showPhone (QStringList { "phone" }, i18n("Start with the phone interface" ) );
QCommandLineOption showTimeL (QStringList { "timeline" }, i18n("Start with the timeline interface" ) );
QCommandLineParser parser;
parser.addOptions({call,text,message,icon,showPhone,showTimeL});
about.setupCommandLine(&parser);
parser.process(*app);
about.processCommandLine(&parser);
const auto versionOption = parser.addVersionOption();
const auto helpOption = parser.addHelpOption ();
if (parser.isSet(versionOption) || parser.isSet(helpOption))
return false;
RingApplication::instance()->init();
if (parser.isSet(call))
placeCall(parser.value(call));
if (parser.isSet(icon))
iconify();
if (parser.isSet(showPhone))
phoneInterface();
if (parser.isSet(showTimeL))
timelineInterface();
if (parser.isSet(text) && parser.isSet(message))
sendText(parser.value(text),parser.value(message));
return true;
}
///Place a call (from the command line)
void Cmd::placeCall(const QString& number)
{
if (number.isEmpty()) {
qWarning() << "Example: --place-call 123@example.com";
return;
}
//Wait until the initialization is done
QTimer::singleShot(0,[number] {
Call* call = Session::instance()->callModel()->dialingCall();
call->reset();
call->appendText(number);
call->performAction(Call::Action::ACCEPT);
});
}
///Send a text ans hang up (from the command line)
void Cmd::sendText(const QString& number, const QString& text)
{
Q_UNUSED(number)
Q_UNUSED(text)
QTimer::singleShot(0,[number,text] {
Call* call = Session::instance()->callModel()->dialingCall();
call->reset();
call->appendText(number);
call->setProperty("message",text);
QObject::connect(call,&Call::lifeCycleStateChanged,[text,call](const Call::LifeCycleState st) {
if (st == Call::LifeCycleState::PROGRESS) {
call->addOutgoingMedia()->send({{"text/plain",call->property("message").toString()}});
call->performAction(Call::Action::REFUSE); //HangUp
}
});
call->performAction(Call::Action::ACCEPT);
});
}
void Cmd::iconify()
{
if (RingApplication::instance()) {
RingApplication::instance()->setIconify(true);
}
}
void Cmd::phoneInterface()
{
- if (RingApplication::instance()) {
- RingApplication::instance()->setStartPhone(true);
- }
+ //FIXME
}
void Cmd::timelineInterface()
{
- if (RingApplication::instance()) {
- RingApplication::instance()->setStartTimeline(true);
- }
+ //FIXME
}
void Cmd::slotActivateActionRequested (const QString&, const QVariant&)
{
}
/**
* This function is called when a new client try to open. It will stop but this
* process need to take care of its arguments.
*/
void Cmd::slotActivateRequested (const QStringList& args, const QString& cwd)
{
Q_UNUSED(cwd)
enum class Current {
NONE , /* No args */
PLACE_CALL, /* One arg */
SEND_TEXT , /* One arg */
MESSAGE , /* One arg */
MINIMIZED /* No args */
};
Current current = Current::NONE;
bool sendMessage = false;
QStringList messages;
QString sendTextTo;
for(const QString& arg : args) {
if (current != Current::NONE) {
switch(current) {
case Current::NONE :
case Current::MINIMIZED :
//Iconify do nothing when the executable is already started
break;
case Current::SEND_TEXT :
sendTextTo = arg;
break;
case Current::PLACE_CALL:
placeCall(arg);
break;
case Current::MESSAGE :
messages << arg;
break;
}
}
else {
if (arg == QLatin1String("--place-call"))
current = Current::PLACE_CALL;
else if (arg == QLatin1String("--send-text"))
sendMessage = true;
else if (arg == QLatin1String("--message"))
current = Current::MESSAGE;
else if (arg == QLatin1String("--iconify"))
{}//TODO
}
}
if (sendMessage && sendTextTo.size() && messages.size()) {
foreach (const QString& msg, messages)
sendText(sendTextTo, msg);
}
}
void Cmd::slotOpenRequested (const QList&)
{
}
// kate: space-indent on; indent-width 3; replace-tabs on;
diff --git a/src/configurator/audiorecordingconfigurator.cpp b/src/configurator/audiorecordingconfigurator.cpp
deleted file mode 100644
index 8f95d213..00000000
--- a/src/configurator/audiorecordingconfigurator.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2017 by Bluesystems *
- * Author : Emmanuel Lepage Vallee *
- * *
- * 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 3 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 "audiorecordingconfigurator.h"
-
-#include
-#include
-#include
-#include
-
-#include
-
-// #include "ui_recording.h"
-
-AudioRecordingConfigurator::AudioRecordingConfigurator(QObject* parent, AudioRecordingConfigurator::Mode mode)
- : CollectionConfigurationInterface(parent), m_Mode(mode)
-{
-}
-
-QByteArray AudioRecordingConfigurator::id() const
-{
- return "peerProfileConfigurator";
-}
-
-QString AudioRecordingConfigurator::name() const
-{
- return i18n("Peer profile configurator");
-}
-
-QVariant AudioRecordingConfigurator::icon() const
-{
- return QVariant();
-}
-
-void AudioRecordingConfigurator::slotSelectionChanged(const QModelIndex& idx)
-{
- auto date = idx.data((int)Ring::Role::FormattedLastUsed);
-
- if (date.isNull())
- date = idx.data((int)Call::Role::FormattedDate);
-
-// m_pLastUpdated->setText(date.toString());
-// m_pLength->setText(idx.data((int)Ring::Role::Length).toString());
-}
-
-void AudioRecordingConfigurator::loadCollection(CollectionInterface* col, QObject* parent)
-{
- Q_UNUSED(col)
-
- if (m_Init)
- return;
-
- if (auto w = qobject_cast(parent)) {
-// Ui_Recording ui;
-// ui.setupUi(w);
-// m_pLastUpdated = ui.lastUpdated;
-// m_pLength = ui.length;
-//
-// QAbstractItemModel* m = nullptr;
-//
-// if (m_Mode == Mode::AUDIO)
-// m = Media::Session::instance()->recordingModel()->audioRecordingModel();
-// else
-// m = Media::Session::instance()->recordingModel()->textRecordingModel();
-//
-// auto p = new QSortFilterProxyModel(this);
-// connect(ui.lineEdit ,SIGNAL(filterStringChanged(QString)), p, SLOT(setFilterRegExp(QString)));
-// p->setSourceModel(m);
-// p->setFilterRole(Qt::DisplayRole);
-// p->setFilterCaseSensitivity( Qt::CaseInsensitive );
-// p->setSortCaseSensitivity ( Qt::CaseInsensitive );
-//
-// ui.tableView->setModel(p);
-// connect(ui.tableView->selectionModel(), &QItemSelectionModel::currentChanged,
-// this, &AudioRecordingConfigurator::slotSelectionChanged);
-//
-// if (p->rowCount())
-// ui.tableView->selectionModel()->setCurrentIndex(
-// p->index(0,0),
-// QItemSelectionModel::ClearAndSelect
-// );
- }
-
- m_Init = true;
-}
-
-// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/configurator/audiorecordingconfigurator.h b/src/configurator/audiorecordingconfigurator.h
deleted file mode 100644
index d1580488..00000000
--- a/src/configurator/audiorecordingconfigurator.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2017 by Bluesystems *
- * Author : Emmanuel Lepage Vallee *
- * *
- * 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 3 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 . *
- **************************************************************************/
-#pragma once
-
-#include
-
-class QLabel;
-
-class AudioRecordingConfigurator : public CollectionConfigurationInterface
-{
- Q_OBJECT
-public:
- enum class Mode {
- AUDIO,
- TEXT,
- };
-
- explicit AudioRecordingConfigurator(QObject* parent, Mode mode);
-
- //Getter
- virtual QByteArray id () const override;
- virtual QString name() const override;
- virtual QVariant icon() const override;
-
- //Mutator
-
- virtual void loadCollection(CollectionInterface* col, QObject* parent = nullptr) override;
-
-private Q_SLOTS:
- void slotSelectionChanged(const QModelIndex& idx);
-
-private:
- bool m_Init {false};
- Mode m_Mode;
-// QLabel* m_pLastUpdated {nullptr};
-// QLabel* m_pLength {nullptr};
-};
-
-// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/configurator/bookmark.ui b/src/configurator/bookmark.ui
deleted file mode 100644
index 0a579248..00000000
--- a/src/configurator/bookmark.ui
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
- Bookmark
-
-
-
- 0
- 0
- 400
- 300
-
-
-
- -
-
-
- Display the most popular contacts as bookmarks
-
-
-
- -
-
-
- Clear
-
-
-
- . .
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 295
- 20
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 247
-
-
-
-
-
-
-
-
-
diff --git a/src/configurator/bookmarkconfigurator.cpp b/src/configurator/bookmarkconfigurator.cpp
deleted file mode 100644
index 19738e60..00000000
--- a/src/configurator/bookmarkconfigurator.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2017 by Bluesystems *
- * Author : Emmanuel Lepage Vallee *
- * *
- * 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 3 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 "bookmarkconfigurator.h"
-
-#include
-
-#include
-#include
-
-// #include "ui_bookmark.h"
-#include
-
-BookmarkConfigurator::BookmarkConfigurator(QObject* parent) : CollectionConfigurationInterface(parent)
-{
-}
-
-BookmarkConfigurator::~BookmarkConfigurator()
-{
-// delete m_pUi;
-}
-
-QByteArray BookmarkConfigurator::id() const
-{
- return "peerProfileConfigurator";
-}
-
-QString BookmarkConfigurator::name() const
-{
- return i18n("Peer profile configurator");
-}
-
-QVariant BookmarkConfigurator::icon() const
-{
- return QVariant();
-}
-
-void BookmarkConfigurator::loadCollection(CollectionInterface* col, QObject* parent)
-{
- Q_UNUSED(col)
-
- if (m_Init)
- return;
-
- if (auto w = qobject_cast(parent)) {
-// m_pUi = new Ui_Bookmark();
-// m_pUi->setupUi(w);
-// connect(m_pUi->pushButton, &QPushButton::clicked, Session::instance()->bookmarkModel(), &CategorizedBookmarkModel::clear);
-// connect(m_pUi->pushButton, &QPushButton::clicked, this, [this]() {
-// m_HasChanged = true;
-// });
-// connect(m_pUi->kcfg_displayPopularAsBookmark, &QPushButton::toggled, this, [this]() {
-// m_HasChanged = true;
-// });
- }
-
- m_Init = true;
-}
-
-bool BookmarkConfigurator::hasChanged()
-{
- return m_HasChanged;
-}
-
-void BookmarkConfigurator::save()
-{
-// if (!m_pUi)
-// return;
-//
-// Session::instance()->bookmarkModel()->setDisplayPopular(
-// m_pUi->kcfg_displayPopularAsBookmark->isChecked()
-// );
-
- m_HasChanged = false;
-}
-
-// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/configurator/bookmarkconfigurator.h b/src/configurator/bookmarkconfigurator.h
deleted file mode 100644
index 06891d9d..00000000
--- a/src/configurator/bookmarkconfigurator.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2017 by Bluesystems *
- * Author : Emmanuel Lepage Vallee *
- * *
- * 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 3 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 . *
- **************************************************************************/
-#pragma once
-
-#include
-
-class Ui_Bookmark;
-
-class BookmarkConfigurator : public CollectionConfigurationInterface
-{
- Q_OBJECT
-public:
- explicit BookmarkConfigurator(QObject* parent = nullptr);
- virtual ~BookmarkConfigurator();
-
- //Getter
- virtual QByteArray id () const override;
- virtual QString name() const override;
- virtual QVariant icon() const override;
-
- virtual void save() override;
- virtual bool hasChanged() override;
-
- virtual void loadCollection(CollectionInterface* col, QObject* parent = nullptr) override;
-
-private:
- bool m_Init {false};
- bool m_HasChanged {false};
- Ui_Bookmark* m_pUi {nullptr};
-
-};
-
-// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/configurator/fallbackpersonconfigurator.cpp b/src/configurator/fallbackpersonconfigurator.cpp
deleted file mode 100644
index 02248bbf..00000000
--- a/src/configurator/fallbackpersonconfigurator.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2015 by Savoir-Faire Linux *
- * Author : Emmanuel Lepage Vallee *
- * *
- * 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 3 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 "fallbackpersonconfigurator.h"
-// #include "ui_dlgfallbackperson.h"
-
-#include
-#include
-
-FallbackPersonConfigurator::FallbackPersonConfigurator(QObject* parent) : CollectionConfigurationInterface(parent),m_pDialog(nullptr)
-{
-
-}
-
-QByteArray FallbackPersonConfigurator::id() const
-{
- return "fallbackPersonConfigurator";
-}
-
-QString FallbackPersonConfigurator::name() const
-{
- return i18n("Fallback person configurator");
-}
-
-QVariant FallbackPersonConfigurator::icon() const
-{
- return QVariant();
-}
-
-void FallbackPersonConfigurator::loadCollection(CollectionInterface* col, QObject* parent)
-{
- Q_UNUSED(col)
- if (parent && qobject_cast(parent)) {
-// QWidget* w = qobject_cast(parent);
-// if (!m_pDialog) {
-// m_pDialog = new QWidget();
-// Ui_DlgFallbackPerson ui;
-// ui.setupUi(m_pDialog);
-// QHBoxLayout* l = new QHBoxLayout(w);
-// l->addWidget(m_pDialog);
-// }
- }
-}
-
-// kate: space-indent on; indent-width 3; replace-tabs on;
diff --git a/src/configurator/fallbackpersonconfigurator.h b/src/configurator/fallbackpersonconfigurator.h
deleted file mode 100644
index 1145bd62..00000000
--- a/src/configurator/fallbackpersonconfigurator.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2015 by Savoir-Faire Linux *
- * Author : Emmanuel Lepage Vallee *
- * *
- * 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 3 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 FALLBACKPERSONCONFIGURATOR_H
-#define FALLBACKPERSONCONFIGURATOR_H
-
-#include
-
-class QWidget;
-
-class FallbackPersonConfigurator : public CollectionConfigurationInterface
-{
- Q_OBJECT
-public:
- explicit FallbackPersonConfigurator(QObject* parent = nullptr);
-
- //Getter
- virtual QByteArray id () const override;
- virtual QString name() const override;
- virtual QVariant icon() const override;
-
- //Mutator
-
- /**
- * This function will be called when a collection request to be configured
- *
- * @param col The collection to be edited. It can casted
- * @param parent can be used for layout information.
- */
- virtual void loadCollection(CollectionInterface* col, QObject* parent = nullptr) override;
-
-private:
- QWidget* m_pDialog;
-
-};
-
-#endif
-
-// kate: space-indent on; indent-width 3; replace-tabs on;
diff --git a/src/configurator/localhistoryconfigurator.cpp b/src/configurator/localhistoryconfigurator.cpp
deleted file mode 100644
index f8a36831..00000000
--- a/src/configurator/localhistoryconfigurator.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2015 by Savoir-Faire Linux *
- * Author : Emmanuel Lepage Vallee *
- * *
- * 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 3 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 "localhistoryconfigurator.h"
-#include "conf/dlggeneral.h"
-
-#include
-#include
-
-#include
-
-#include
-
-LocalHistoryConfigurator::LocalHistoryConfigurator(QObject* parent) : CollectionConfigurationInterface(parent),m_pDialog(nullptr)
-{
-}
-
-QByteArray LocalHistoryConfigurator::id() const
-{
- return "localHistoryConfigurator";
-}
-
-QString LocalHistoryConfigurator::name() const
-{
- return i18n("Local history configurator");
-}
-
-QVariant LocalHistoryConfigurator::icon() const
-{
- return QVariant();
-}
-
-void LocalHistoryConfigurator::loadCollection(CollectionInterface* col, QObject* parent)
-{
-// Q_UNUSED(col)
-// if (parent && qobject_cast(parent)) {
-// QWidget* w = qobject_cast(parent);
-// if (!m_pDialog) {
-// m_pDialog = new DlgGeneral(nullptr);
-// QHBoxLayout* l = new QHBoxLayout(w);
-// l->addWidget(m_pDialog);
-//
-// m_pDialog->m_pKeepHistory->setChecked(Session::instance()->historyModel()->isHistoryLimited());
-// m_pDialog->m_pHistoryMax->setValue(Session::instance()->historyModel()->historyLimit());
-//
-// connect(m_pDialog->m_pKeepHistory, &QCheckBox::toggled, Session::instance()->historyModel(), &CategorizedHistoryModel::setHistoryLimited);
-// connect(m_pDialog->m_pHistoryMax , SIGNAL(valueChanged(int)), Session::instance()->historyModel(), SLOT(setHistoryLimit(int)));
-// connect(m_pDialog, &DlgGeneral::updateButtons, this, [this]() {
-// emit this->changed();
-// });
-// }
-// }
-}
-
-// kate: space-indent on; indent-width 3; replace-tabs on;
diff --git a/src/configurator/localhistoryconfigurator.h b/src/configurator/localhistoryconfigurator.h
deleted file mode 100644
index 38ecaff9..00000000
--- a/src/configurator/localhistoryconfigurator.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2015 by Savoir-Faire Linux *
- * Author : Emmanuel Lepage Vallee *
- * *
- * 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 3 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 LOCALHISTORYCONFIGURATOR_H
-#define LOCALHISTORYCONFIGURATOR_H
-
-#include
-
-class DlgGeneral;
-
-class LocalHistoryConfigurator : public CollectionConfigurationInterface
-{
- Q_OBJECT
-public:
- explicit LocalHistoryConfigurator(QObject* parent = nullptr);
-
- //Getter
- virtual QByteArray id () const override;
- virtual QString name() const override;
- virtual QVariant icon() const override;
-
- //Mutator
-
- /**
- * This function will be called when a collection request to be configured
- *
- * @param col The collection to be edited. It can casted
- * @param parent can be used for layout information.
- */
- virtual void loadCollection(CollectionInterface* col, QObject* parent = nullptr) override;
-
-private:
- DlgGeneral* m_pDialog;
-
-};
-
-#endif
-
-// kate: space-indent on; indent-width 3; replace-tabs on;
diff --git a/src/configurator/peerprofile.ui b/src/configurator/peerprofile.ui
deleted file mode 100644
index 68490c91..00000000
--- a/src/configurator/peerprofile.ui
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
- PeerProfile
-
-
-
- 0
- 0
- 676
- 577
-
-
-
- -
-
-
- This entry holds all the contact information sent to you by your peers during calls or contact requests. If a contact already exists for a person, the options below will help merge entries.
-
-
- true
-
-
-
- -
-
-
- Mode
-
-
- -
-
-
- Create a new contact
-
-
-
- -
-
-
- Ignore the new contact information
-
-
-
- -
-
-
- Onl&y add the missing information fields
-
-
-
- -
-
-
- Always as&k
-
-
-
- -
-
-
- Overwrite some fields
-
-
-
-
-
-
- -
-
-
- false
-
-
- Contact fields to overwrite
-
-
- -
-
-
- Formatted name
-
-
-
- -
-
-
- Nickname
-
-
-
- -
-
-
- Primary name
-
-
-
- -
-
-
- Last name
-
-
-
- -
-
-
- eMail
-
-
-
- -
-
-
- Organization
-
-
-
- -
-
-
- Addresses
-
-
-
- -
-
-
- Phone numbers
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 169
-
-
-
-
-
-
-
-
-
- m_pCustom
- toggled(bool)
- groupBox_2
- setEnabled(bool)
-
-
- 108
- 134
-
-
- 127
- 159
-
-
-
-
-
diff --git a/src/configurator/peerprofileconfigurator.cpp b/src/configurator/peerprofileconfigurator.cpp
deleted file mode 100644
index eab54438..00000000
--- a/src/configurator/peerprofileconfigurator.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2017 by Bluesystems *
- * Author : Emmanuel Lepage Vallee *
- * *
- * 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 3 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 "peerprofileconfigurator.h"
-
-#include
-
-// #include
-
-// #include "ui_peerprofile.h"
-
-#include
-
-#include "klib/kcfg_settings.h"
-
-#include
-#include
-
-
-#define TO_OPTION(b) b? PeerProfileCollection2::MergeOption::MERGE : PeerProfileCollection2::MergeOption::IGNORE
-
-PeerProfileConfigurator::PeerProfileConfigurator(QObject* parent) : CollectionConfigurationInterface(parent)
-{
- m_pCol->setMergeOption( Person::Role::FormattedName , TO_OPTION(ConfigurationSkeleton::formattedName()));
- m_pCol->setMergeOption( Person::Role::NickName , TO_OPTION(ConfigurationSkeleton::nickname ()));
- m_pCol->setMergeOption( Person::Role::PrimaryName , TO_OPTION(ConfigurationSkeleton::primaryName ()));
- m_pCol->setMergeOption( Person::Role::LastName , TO_OPTION(ConfigurationSkeleton::lastName ()));
- m_pCol->setMergeOption( Person::Role::PreferredEmail , TO_OPTION(ConfigurationSkeleton::email ()));
- m_pCol->setMergeOption( Person::Role::Organization , TO_OPTION(ConfigurationSkeleton::org ()));
-}
-
-PeerProfileConfigurator::~PeerProfileConfigurator()
-{
- if (m_pUi)
- delete m_pUi;
-}
-
-QByteArray PeerProfileConfigurator::id() const
-{
- return "peerProfileConfigurator";
-}
-
-QString PeerProfileConfigurator::name() const
-{
- return i18n("Peer profile configurator");
-}
-
-QVariant PeerProfileConfigurator::icon() const
-{
- return QVariant();
-}
-
-void PeerProfileConfigurator::loadCollection(CollectionInterface* col, QObject* parent)
-{
- Q_UNUSED(col)
-
- if (m_Init)
- return;
-
- if (auto w = qobject_cast(parent)) {
- m_pCol = static_cast(col);
-// m_pUi = new Ui_PeerProfile;
-// m_pUi->setupUi(w);
-
-// switch(m_pCol->defaultMode()) {
-// case PeerProfileCollection2::DefaultMode::NEW_CONTACT:
-// m_pUi->m_pNewContact->setChecked(true);
-// break;
-// case PeerProfileCollection2::DefaultMode::IGNORE_DUPLICATE:
-// m_pUi->m_pIgnore->setChecked(true);
-// break;
-// case PeerProfileCollection2::DefaultMode::QUICK_MERGE:
-// m_pUi->m_pAddMissing->setChecked(true);
-// break;
-// case PeerProfileCollection2::DefaultMode::ALWAYS_ASK:
-// m_pUi->m_pAlwaysAsk->setChecked(true);
-// break;
-// case PeerProfileCollection2::DefaultMode::CUSTOM:
-// m_pUi->m_pCustom->setChecked(true);
-// break;
-// }
-
- auto l = [this]() {
- ConfigurationSkeleton::setDefaultPeerProfileMode((int)m_pCol->defaultMode());
- emit this->changed();
- };
-
-// connect(m_pUi->m_pNewContact , &QRadioButton::toggled, this, [this, l](bool c) { if (c) m_pCol->setDefaultMode(PeerProfileCollection2::DefaultMode::NEW_CONTACT ); l(); });
-// connect(m_pUi->m_pIgnore , &QRadioButton::toggled, this, [this, l](bool c) { if (c) m_pCol->setDefaultMode(PeerProfileCollection2::DefaultMode::IGNORE_DUPLICATE ); l(); });
-// connect(m_pUi->m_pAddMissing , &QRadioButton::toggled, this, [this, l](bool c) { if (c) m_pCol->setDefaultMode(PeerProfileCollection2::DefaultMode::QUICK_MERGE ); l(); });
-// connect(m_pUi->m_pAlwaysAsk , &QRadioButton::toggled, this, [this, l](bool c) { if (c) m_pCol->setDefaultMode(PeerProfileCollection2::DefaultMode::ALWAYS_ASK ); l(); });
-// connect(m_pUi->m_pCustom , &QRadioButton::toggled, this, [this, l](bool c) { if (c) m_pCol->setDefaultMode(PeerProfileCollection2::DefaultMode::CUSTOM ); l(); });
-//
-// for (auto w : {m_pUi->kcfg_formattedName, m_pUi->kcfg_nickname, m_pUi->kcfg_primaryName, m_pUi->kcfg_lastName,
-// m_pUi->kcfg_email, m_pUi->kcfg_org, m_pUi->kcfg_addresses, m_pUi->kcfg_phoneNumbers}) {
-// connect(w, &QCheckBox::toggled, this, &PeerProfileConfigurator::slotCheckboxChecked);
-// }
- }
-
- m_Init = true;
-}
-
-void PeerProfileConfigurator::slotCheckboxChecked()
-{
- emit this->changed();
-// m_pCol->setMergeOption( Person::Role::FormattedName , TO_OPTION(m_pUi->kcfg_formattedName->isChecked()));
-// m_pCol->setMergeOption( Person::Role::NickName , TO_OPTION(m_pUi->kcfg_nickname ->isChecked()));
-// m_pCol->setMergeOption( Person::Role::PrimaryName , TO_OPTION(m_pUi->kcfg_primaryName ->isChecked()));
-// m_pCol->setMergeOption( Person::Role::LastName , TO_OPTION(m_pUi->kcfg_lastName ->isChecked()));
-// m_pCol->setMergeOption( Person::Role::PreferredEmail , TO_OPTION(m_pUi->kcfg_email ->isChecked()));
-// m_pCol->setMergeOption( Person::Role::Organization , TO_OPTION(m_pUi->kcfg_org ->isChecked()));
-
-// m_pCol->setMergeOption( Person::Role:: , kcfg_addresses ->isChecked());
-// m_pCol->setMergeOption( Person::Role:: , kcfg_phoneNumbers ->isChecked());
-}
-
-#undef TO_OPTION
-
-// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/configurator/peerprofileconfigurator.h b/src/configurator/peerprofileconfigurator.h
deleted file mode 100644
index eda66dfd..00000000
--- a/src/configurator/peerprofileconfigurator.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2017 by Bluesystems *
- * Author : Emmanuel Lepage Vallee *
- * *
- * 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 3 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 . *
- **************************************************************************/
-#pragma once
-
-#include
-
-class PeerProfileCollection2;
-class Ui_PeerProfile;
-
-class PeerProfileConfigurator : public CollectionConfigurationInterface
-{
- Q_OBJECT
-public:
- explicit PeerProfileConfigurator(QObject* parent = nullptr);
- virtual ~PeerProfileConfigurator();
-
- //Getter
- virtual QByteArray id () const override;
- virtual QString name() const override;
- virtual QVariant icon() const override;
-
- virtual void loadCollection(CollectionInterface* col, QObject* parent = nullptr) override;
-
-private:
- bool m_Init {false};
- PeerProfileCollection2* m_pCol {nullptr};
- Ui_PeerProfile* m_pUi {nullptr};
-
-private Q_SLOTS:
- void slotCheckboxChecked();
-
-};
-
-// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/configurator/recording.ui b/src/configurator/recording.ui
deleted file mode 100644
index ad8ec622..00000000
--- a/src/configurator/recording.ui
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
- Recording
-
-
-
- 0
- 0
- 399
- 303
-
-
-
- -
-
-
- QAbstractItemView::SingleSelection
-
-
- QAbstractItemView::SelectRows
-
-
- false
-
-
- true
-
-
- false
-
-
-
- -
-
-
- Length:
-
-
-
- -
-
-
-
-
-
-
- -
-
- -
-
-
- Qt::Horizontal
-
-
-
- 208
- 20
-
-
-
-
- -
-
-
- Delete
-
-
-
-
-
-
-
-
- -
-
-
- Last updated:
-
-
-
- -
-
-
-
-
-
-
- -
-
-
- Search
-
-
-
-
-
-
-
- FilterLineEdit
- QLineEdit
- widgets/filterlineedit.h
-
-
-
-
-
diff --git a/src/implementation.cpp b/src/implementation.cpp
index cba7162d..7c6eeb38 100644
--- a/src/implementation.cpp
+++ b/src/implementation.cpp
@@ -1,229 +1,230 @@
/***************************************************************************
* Copyright (C) 2013-2015 by Savoir-Faire Linux *
* Author : Emmanuel Lepage Vallee *
* *
* 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 3 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 "implementation.h"
//Qt
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//KDE
#include
#include
//Ring
#include
#include
#include
#include
#include
#include
#include
#include
#include "klib/kcfg_settings.h"
#include
#include "icons/icons.h"
#include
ColorDelegate::ColorDelegate() : m_Pal(QGuiApplication::palette()) {
m_Green = QColor(m_Pal.color(QPalette::Base));
if (m_Green.green()+20 >= 255) {
m_Green.setRed ( ((int)m_Green.red() -20));
m_Green.setBlue( ((int)m_Green.blue() -20));
}
else
m_Green.setGreen(((int)m_Green.green()+20));
m_Red = QColor(m_Pal.color(QPalette::Base));
if (m_Red.red()+20 >= 255) {
m_Red.setGreen( ((int)m_Red.green() -20));
m_Red.setBlue( ((int)m_Red.blue() -20));
}
else
m_Red.setRed( ((int)m_Red.red() +20));
m_Yellow = QColor(m_Pal.color(QPalette::Base));
if (m_Yellow.red()+20 >= 255 || m_Green.green()+20 >= 255) {
m_Yellow.setBlue(((int)m_Yellow.blue() -20));
}
else {
m_Yellow.setGreen(((int)m_Yellow.green()+20));
m_Yellow.setRed( ((int)m_Yellow.red() +20));
}
}
QVariant ColorDelegate::color(const Account* a)
{
switch(a->registrationState()) {
case Account::RegistrationState::READY:
return m_Green;
case Account::RegistrationState::UNREGISTERED:
return m_Pal.color(QPalette::Base);
case Account::RegistrationState::TRYING:
case Account::RegistrationState::INITIALIZING:
return m_Yellow;
case Account::RegistrationState::ERROR:
return m_Red;
case Account::RegistrationState::COUNT__:
break;
};
return QVariant();
}
QVariant ColorDelegate::icon(const Account* a) {
if (a->editState() == Account::EditState::MODIFIED_COMPLETE)
return QIcon::fromTheme(QStringLiteral("document-save"));
if (a->editState() == Account::EditState::MODIFIED_INCOMPLETE)
return QIcon::fromTheme(QStringLiteral("dialog-warning"));
else if (a->editState() == Account::EditState::OUTDATED) {
return QIcon::fromTheme(QStringLiteral("view-refresh"));
}
return QVariant();
}
QVariant KDEShortcutDelegate::createAction(Macro* macro)
{
Q_UNUSED(macro)
return {};
}
void KDEActionExtender::editPerson(Person* p)
{
QPointer d = new QQuickView( RingApplication::engine(), nullptr );
d->setSource(QUrl(QStringLiteral("qrc:/ContactDialog.qml")));
d->setResizeMode(QQuickView::SizeRootObjectToView);
auto item = d->rootObject();
item->setProperty("currentPerson", QVariant::fromValue(p));
item->setProperty("showStat" , false );
item->setProperty("showImage" , true );
item->setProperty("forcedState", "profile" );
d->resize(800, 600);
d->show();
}
void KDEActionExtender::viewChatHistory(ContactMethod* cm)
{
if (!cm)
return;
// Get a real contact method when necessary
if (cm->type() == ContactMethod::Type::TEMPORARY) {
cm = Session::instance()->individualDirectory()->getExistingNumberIf(
cm->uri(),
[](const ContactMethod* cm) -> bool {
return cm->textRecording() && !cm->textRecording()->isEmpty();
});
}
if (!cm)
return;
//FIXME open the timeline
}
void KDEActionExtender::viewChatHistory(Person* p)
{
if (!p)
return;
foreach(ContactMethod* cm, p->individual()->phoneNumbers())
viewChatHistory(cm);
}
void KDEActionExtender::copyInformation(QMimeData* data)
{
QClipboard* clipboard = QGuiApplication::clipboard();
clipboard->setMimeData(data);
}
bool KDEActionExtender::warnDeletePerson(Person* p)
{
const int ret = KMessageBox::questionYesNo(nullptr,
i18n("Are you sure you want to permanently delete %1?",
p->formattedName()), i18n("Delete contact")
);
return ret == KMessageBox::Yes;
}
bool KDEActionExtender::warnDeleteCall(Call* c)
{
Q_UNUSED(c)
const int ret = KMessageBox::questionYesNo(nullptr,
i18n("Are you sure you wish to remove this call?"), i18n("Delete call")
);
return ret == KMessageBox::Yes;
}
Person* KDEActionExtender::selectPerson(FlagPack hints, const QVariant& hintVar) const
{
Q_UNUSED(hints)
Q_UNUSED(hintVar)
return nullptr;
}
ContactMethod* KDEActionExtender::selectContactMethod(FlagPack hints, const QVariant& hintVar) const
{
Q_UNUSED(hints)
Q_UNUSED(hintVar)
return nullptr;
}
QUrl KDEDesktopFileProvider::getAnyFile(const QStringList& extensions) const
{
+ Q_UNUSED(extensions)
return QFileDialog::getOpenFileName(
nullptr,
QStringLiteral("Open File"),
QDir::currentPath(),
QStringLiteral("Media Files (*.png *.jpg *.gif *.mp4 *.mkv *.webm *.txt *.avi *.mpg)")
);
}
QList KDEDesktopFileProvider::recentFiles() const
{
const QStringList files = ConfigurationSkeleton::recentStreamedFiles();
QList ret;
for (const auto& f : qAsConst(files))
ret << f;
return ret;
}
void KDEDesktopFileProvider::addRecentFile(const QUrl& path) const
{
QStringList files = ConfigurationSkeleton::recentStreamedFiles();
files << path.path();
ConfigurationSkeleton::setRecentStreamedFiles(files);
}
// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/ringapplication.cpp b/src/ringapplication.cpp
index fe29e9f2..75652948 100644
--- a/src/ringapplication.cpp
+++ b/src/ringapplication.cpp
@@ -1,577 +1,492 @@
/***************************************************************************
* Copyright (C) 2009-2015 by Savoir-Faire Linux *
* Author : Emmanuel Lepage Valle *
* *
* 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 3 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 . *
**************************************************************************/
//Parent
#include "ringapplication.h"
//Qt
-#include
#include
-#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//KDE
#include
#include
#include
#include
//LRC
#include
#include
#include
-#include
#include
#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
#include
-#include
-#include
-#include
-#include