diff --git a/kde/CMakeLists.txt b/kde/CMakeLists.txt index f341f560706db11238e62d5b8bac3b2523cf3872..0f85738c13fd503c3ffdd3a6e7560f7f3055f524 100755 --- a/kde/CMakeLists.txt +++ b/kde/CMakeLists.txt @@ -5,13 +5,15 @@ PROJECT(sflphone-client-kde) SET(LOCAL_CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ) SET(CMAKE_MODULE_PATH "${LOCAL_CMAKE_MODULE_PATH}" ) +SET(QT_USE_QT*) + # --- custom targets: --- INCLUDE( ${LOCAL_CMAKE_MODULE_PATH}/TargetDistclean.cmake REQUIRED) FIND_PACKAGE ( Kabc REQUIRED ) FIND_PACKAGE ( KdepimLibs REQUIRED ) FIND_PACKAGE ( KDE4 REQUIRED ) -FIND_PACKAGE ( Qt4 REQUIRED QT_USE_QT* ) +FIND_PACKAGE ( Qt4 REQUIRED QtCore QtGui QtXml QtDBus QtTest QtSVG QT_USE_QT* ) set(AKONADI_MIN_VERSION 1.0) find_package(Akonadi QUIET NO_MODULE ${AKONADI_MIN_VERSION}) diff --git a/kde/po/fr/sflphone-client-kde.po b/kde/po/fr/sflphone-client-kde.po index 1fc88c3a4cfce51a48d5e860397776d8551acd65..51f56c8374548f56c1194f247ceb33855fc907ab 100755 --- a/kde/po/fr/sflphone-client-kde.po +++ b/kde/po/fr/sflphone-client-kde.po @@ -1558,6 +1558,11 @@ msgstr ", le numero de votre interlocuteur est %1" msgid " and you have been talking since %1 seconds" msgstr " et vous parlez depuis %1 seconde" +msgid "Please enter a transfer number and press enter, press escape to cancel" +msgstr "Veuillez entrer un numero pour vers lequel transferrer et appuiyez sur entrer, appuiyez sur echape pour annuler" + +msgid "You call have been transferred to " +msgstr "Votre appel à été transferré au numéro " #: rc.cpp:467 msgctxt "NAME OF TRANSLATORS" diff --git a/kde/src/CMakeLists.txt b/kde/src/CMakeLists.txt index c2cd1e36ed75f77b7b9463b1560afe9542ebd81f..85ddef58bec6c83ecde86e511f42cc792cff577e 100755 --- a/kde/src/CMakeLists.txt +++ b/kde/src/CMakeLists.txt @@ -44,6 +44,7 @@ SET( conf/dlgaudio.cpp conf/dlgaddressbook.cpp conf/dlghooks.cpp + conf/dlgaccessibility.cpp conf/ConfigAccountList.cpp widgets/Dialpad.cpp widgets/ContactItemWidget.cpp @@ -75,6 +76,7 @@ SET( conf/dlgaudiobase.ui conf/dlgaddressbookbase.ui conf/dlghooksbase.ui + conf/dlgaccessibility.ui ) KDE4_ADD_UI_FILES(sflphone_client_kde_SRCS ui/SFLPhoneView_base.ui ${config_ui_files} ) diff --git a/kde/src/CallView.cpp b/kde/src/CallView.cpp index 7c2045451e128e3829d42293771fa48cd8595a95..59a7d68a5d7172d1657062ca415dae8d0958149b 100644 --- a/kde/src/CallView.cpp +++ b/kde/src/CallView.cpp @@ -45,6 +45,8 @@ #include "SFLPhone.h" #include "SFLPhoneView.h" #include "klib/AkonadiBackend.h" +#include "klib/ConfigurationSkeleton.h" +#include "SFLPhoneAccessibility.h" ///Retrieve current and older calls from the daemon, fill history and the calls TreeView and enable drag n' drop @@ -69,6 +71,7 @@ CallView::CallView(QWidget* parent) : QTreeWidget(parent),m_pActiveOverlay(0),m_ m_pTransferOverlay->setVisible(false); m_pTransferOverlay->resize(size()); m_pTransferOverlay->setCornerWidget(lblImg); + m_pTransferOverlay->setAccessMessage(i18n("Please enter a transfer number and press enter, press escape to cancel")); m_pTransferB->setText(i18n("Transfer")); m_pTransferB->setMaximumSize(70,9000); @@ -368,8 +371,11 @@ void CallView::transfer() { if (m_pCallPendingTransfer && !m_pTransferLE->text().isEmpty()) { SFLPhone::model()->transfer(m_pCallPendingTransfer,m_pTransferLE->text()); + if (ConfigurationSkeleton::enableVoiceFeedback()) { + SFLPhoneAccessibility::getInstance()->say(i18n("You call have been transferred to ")+m_pTransferLE->text()); + } } - + m_pCallPendingTransfer = 0; m_pTransferLE->clear(); m_pTransferOverlay->setVisible(false); @@ -412,7 +418,7 @@ void CallView::hideOverlay() } m_pCallPendingTransfer = 0; - m_pTransferLE->clear(); + //m_pTransferLE->clear(); } //hideOverlay ///Be sure the size of the overlay stay the same @@ -589,6 +595,11 @@ void CallView::itemClicked(QTreeWidgetItem* item, int column) { Q_UNUSED(column) Call* call = SFLPhone::model()->getCall(item); call->setSelected(true); + + if (ConfigurationSkeleton::enableReadDetails()) { + SFLPhoneAccessibility::getInstance()->currentCallDetails(); + } + emit itemChanged(call); kDebug() << "Item clicked"; } @@ -727,6 +738,9 @@ void CallViewOverlay::setVisible(bool enabled) { } m_enabled = enabled; QWidget::setVisible(enabled); + if (!m_accessMessage.isEmpty() && enabled == true && ConfigurationSkeleton::enableReadLabel()) { + SFLPhoneAccessibility::getInstance()->say(m_accessMessage); + } } //setVisible ///How to paint the overlay @@ -752,4 +766,10 @@ void CallViewOverlay::changeVisibility() { repaint(); if (m_step >= 35) m_pTimer->stop(); +} + +///Set accessibility message +void CallViewOverlay::setAccessMessage(QString message) +{ + m_accessMessage = message; } \ No newline at end of file diff --git a/kde/src/CallView.h b/kde/src/CallView.h index e5e8f121b1e1a388c5270bfd4dac6ce01b94bb6c..2f3799d783c3aba6a4567d49a2b1eb64a9bc637a 100644 --- a/kde/src/CallView.h +++ b/kde/src/CallView.h @@ -62,17 +62,19 @@ public: //Setters void setCornerWidget(QWidget* wdg); void setVisible(bool enabled); + void setAccessMessage(QString message); protected: virtual void paintEvent (QPaintEvent* event ); virtual void resizeEvent (QResizeEvent* e ); private: - QWidget* m_pIcon ; - uint m_step ; - QTimer* m_pTimer ; - bool m_enabled; - QColor m_black ; + QWidget* m_pIcon ; + uint m_step ; + QTimer* m_pTimer ; + bool m_enabled ; + QColor m_black ; + QString m_accessMessage; private slots: void changeVisibility(); diff --git a/kde/src/SFLPhoneAccessibility.cpp b/kde/src/SFLPhoneAccessibility.cpp index 9e53dbd016a9b13fbbf58a58054b172e6ff592e5..033ff986b0eeae4eedd4b71502b0d0af042d2196 100644 --- a/kde/src/SFLPhoneAccessibility.cpp +++ b/kde/src/SFLPhoneAccessibility.cpp @@ -97,4 +97,9 @@ void SFLPhoneAccessibility::currentCallDetails() KSpeechInterfaceSingleton::getInstance()->say(toSay, KSpeech::soPlainText); } } +} + +void SFLPhoneAccessibility::say(QString message) +{ + KSpeechInterfaceSingleton::getInstance()->say(message, KSpeech::soPlainText); } \ No newline at end of file diff --git a/kde/src/SFLPhoneAccessibility.h b/kde/src/SFLPhoneAccessibility.h index 09a7443a42dae54288dcd37eb156aa55b40d4cb7..c9442dbaeff43d70d23ab32c8f1da39e2bab1bb0 100644 --- a/kde/src/SFLPhoneAccessibility.h +++ b/kde/src/SFLPhoneAccessibility.h @@ -33,9 +33,10 @@ private: QString numberToDigit(QString number); static SFLPhoneAccessibility* m_pInstance; -private slots: +public slots: void listCall(); void currentCallDetails(); + void say(QString message); }; #endif \ No newline at end of file diff --git a/kde/src/conf/ConfigurationDialog.cpp b/kde/src/conf/ConfigurationDialog.cpp index 134a785f16c02f0e95b7f34d833632aabe59627d..dcc7713a9098baa3b02c8279b2418a3249d2af5b 100755 --- a/kde/src/conf/ConfigurationDialog.cpp +++ b/kde/src/conf/ConfigurationDialog.cpp @@ -31,6 +31,7 @@ #include "dlgaudio.h" #include "dlgaddressbook.h" #include "dlghooks.h" +#include "dlgaccessibility.h" #include "lib/sflphone_const.h" @@ -39,19 +40,21 @@ ConfigurationDialog::ConfigurationDialog(SFLPhoneView *parent) { this->setWindowIcon(QIcon(ICON_SFLPHONE)); - dlgGeneral = new DlgGeneral (this); - dlgDisplay = new DlgDisplay (this); - dlgAccounts = new DlgAccounts (this); - dlgAudio = new DlgAudio (this); - dlgAddressBook = new DlgAddressBook (this); - dlgHooks = new DlgHooks (this); - - addPage( dlgGeneral , i18n("General") , "sflphone-client-kde" ); - addPage( dlgDisplay , i18n("Display") , "applications-graphics" ); - addPage( dlgAccounts , i18n("Accounts") , "user-identity" ); - addPage( dlgAudio , i18n("Audio") , "audio-headset" ); - addPage( dlgAddressBook , i18n("Address Book") , "x-office-address-book" ); - addPage( dlgHooks , i18n("Hooks") , "insert-link" ); + dlgGeneral = new DlgGeneral (this); + dlgDisplay = new DlgDisplay (this); + dlgAccounts = new DlgAccounts (this); + dlgAudio = new DlgAudio (this); + dlgAddressBook = new DlgAddressBook (this); + dlgHooks = new DlgHooks (this); + dlgAccessibility = new DlgAccessibility (this); + + addPage( dlgGeneral , i18n("General") , "sflphone-client-kde" ); + addPage( dlgDisplay , i18n("Display") , "applications-graphics" ); + addPage( dlgAccounts , i18n("Accounts") , "user-identity" ); + addPage( dlgAudio , i18n("Audio") , "audio-headset" ); + addPage( dlgAddressBook , i18n("Address Book") , "x-office-address-book" ); + addPage( dlgHooks , i18n("Hooks") , "insert-link" ); + addPage( dlgAccessibility , i18n("Accessibility") , "preferences-desktop-accessibility" ); connect(this, SIGNAL(applyClicked()), this, SLOT(applyCustomSettings())); connect(this, SIGNAL(okClicked()), this, SLOT(applyCustomSettings())); @@ -66,18 +69,20 @@ ConfigurationDialog::~ConfigurationDialog() void ConfigurationDialog::updateWidgets() { - dlgAudio->updateWidgets(); - dlgAccounts->updateWidgets(); - dlgGeneral->updateWidgets(); - dlgAddressBook->updateWidgets(); + dlgAudio->updateWidgets (); + dlgAccounts->updateWidgets (); + dlgGeneral->updateWidgets (); + dlgAddressBook->updateWidgets (); + dlgAccessibility->updateWidgets(); } void ConfigurationDialog::updateSettings() { - dlgAudio->updateSettings(); - dlgAccounts->updateSettings(); - dlgGeneral->updateSettings(); - dlgAddressBook->updateSettings(); + dlgAudio->updateSettings (); + dlgAccounts->updateSettings (); + dlgGeneral->updateSettings (); + dlgAddressBook->updateSettings (); + dlgAccessibility->updateSettings(); } bool ConfigurationDialog::hasChanged() @@ -100,8 +105,8 @@ void ConfigurationDialog::applyCustomSettings() ConfigurationSkeleton::self()->writeConfig(); } updateSettings(); - updateWidgets(); - updateButtons(); + updateWidgets (); + updateButtons (); emit changesApplied(); } diff --git a/kde/src/conf/ConfigurationDialog.h b/kde/src/conf/ConfigurationDialog.h index 5be091ad3e6ae082336e7177b1fac16900cf805f..ac5755e78419e7c51f7474f37a1953cc60512a2d 100755 --- a/kde/src/conf/ConfigurationDialog.h +++ b/kde/src/conf/ConfigurationDialog.h @@ -37,6 +37,7 @@ class DlgAudio; class DlgAddressBook; class DlgRecord; class DlgHooks; +class DlgAccessibility; class SFLPhoneView; @@ -55,18 +56,16 @@ class ConfigurationDialog : public KConfigDialog { Q_OBJECT private: - - - DlgGeneral * dlgGeneral; - DlgDisplay * dlgDisplay; - DlgAccounts * dlgAccounts; - DlgAudio * dlgAudio; - DlgAddressBook * dlgAddressBook; - DlgHooks * dlgHooks; + DlgGeneral* dlgGeneral ; + DlgDisplay* dlgDisplay ; + DlgAccounts* dlgAccounts ; + DlgAudio* dlgAudio ; + DlgAddressBook* dlgAddressBook ; + DlgHooks* dlgHooks ; + DlgAccessibility* dlgAccessibility; public: ConfigurationDialog(SFLPhoneView *parent = 0); - ~ConfigurationDialog(); diff --git a/kde/src/conf/dlgaccessibility.cpp b/kde/src/conf/dlgaccessibility.cpp new file mode 100644 index 0000000000000000000000000000000000000000..364a71f48dd145c6138d175c3d7c0a0d66e6f97f --- /dev/null +++ b/kde/src/conf/dlgaccessibility.cpp @@ -0,0 +1,47 @@ +/************************************************************************************ + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> * + * Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> * + * * + * 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 "dlgaccessibility.h" +#include "klib/ConfigurationSkeleton.h" + +///Constructor +DlgAccessibility::DlgAccessibility(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); +} + +///Destructor +DlgAccessibility::~DlgAccessibility() +{ + +} + +///Save +void DlgAccessibility::updateSettings() +{ + +} + +///Load +void DlgAccessibility::updateWidgets() +{ + +} \ No newline at end of file diff --git a/kde/src/conf/dlgaccessibility.h b/kde/src/conf/dlgaccessibility.h new file mode 100644 index 0000000000000000000000000000000000000000..bdac8495e31095ec122232bf437a3b57ef0565f9 --- /dev/null +++ b/kde/src/conf/dlgaccessibility.h @@ -0,0 +1,43 @@ +/************************************************************************************ + * Copyright (C) 2012 by Savoir-Faire Linux * + * Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> * + * * + * 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 DLGACCESSIBILITY_H +#define DLGACCESSIBILITY_H + +#include <QWidget> + +#include "ui_dlgaccessibility.h" + +///@class DlgAccessibility Display option for the visually impaired +class DlgAccessibility : public QWidget, public Ui_DlgAccessibility +{ +Q_OBJECT +public: + //Constructor + DlgAccessibility(QWidget *parent = 0); + + //Destructor + ~DlgAccessibility(); + +public slots: +void updateSettings(); +void updateWidgets(); +}; + +#endif diff --git a/kde/src/conf/dlgaccessibility.ui b/kde/src/conf/dlgaccessibility.ui new file mode 100644 index 0000000000000000000000000000000000000000..64c35e45dcc564ddc3379cedbf5d75a1f32f8377 --- /dev/null +++ b/kde/src/conf/dlgaccessibility.ui @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgAccessibility</class> + <widget class="QWidget" name="DlgAccessibility"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>409</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="m_pT2SBG"> + <property name="title"> + <string>Text to speech</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QCheckBox" name="kcfg_enableVoiceFeedback"> + <property name="text"> + <string>Enable audio feedback from common actions</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_enableReadLabel"> + <property name="text"> + <string>Automatically read label when an overlay is being displayed</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_enableReadDetails"> + <property name="text"> + <string>Automattically read the call details when it is selected</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/kde/src/conf/dlgaccounts.cpp b/kde/src/conf/dlgaccounts.cpp index d04e80067fd975086facf8c73db0cb051984e227..8979db5552f261e1832cb273816aadb91252e4ea 100755 --- a/kde/src/conf/dlgaccounts.cpp +++ b/kde/src/conf/dlgaccounts.cpp @@ -372,7 +372,7 @@ void DlgAccounts::loadAccount(QListWidgetItem * item) /**/combo_security_STRP->setCurrentIndex ( account->getAccountDetail( TLS_METHOD ).toInt() ); /* */ - if (account->getAccountDetail(ACCOUNT_USERNAME).isEmpty()) { + if (account->getAccountDetail(ACCOUNT_ALIAS) == "IP2IP") { frame2_editAccounts->setTabEnabled(0,false); frame2_editAccounts->setTabEnabled(1,false); frame2_editAccounts->setTabEnabled(3,false); diff --git a/kde/src/conf/dlgaccountsbase.ui b/kde/src/conf/dlgaccountsbase.ui index 8359b8f4f91c2ea1d459d7b48db5a22284d16110..54eb0b208073bc254cfc652d4b766b3cb794cda2 100755 --- a/kde/src/conf/dlgaccountsbase.ui +++ b/kde/src/conf/dlgaccountsbase.ui @@ -1181,12 +1181,12 @@ <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel"> - <x>320</x> - <y>415</y> + <x>390</x> + <y>400</y> </hint> <hint type="destinationlabel"> - <x>448</x> - <y>419</y> + <x>838</x> + <y>401</y> </hint> </hints> </connection> @@ -1197,12 +1197,12 @@ <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel"> - <x>307</x> - <y>412</y> + <x>390</x> + <y>400</y> </hint> <hint type="destinationlabel"> - <x>372</x> - <y>248</y> + <x>622</x> + <y>239</y> </hint> </hints> </connection> @@ -1213,12 +1213,12 @@ <slot>setDisabled(bool)</slot> <hints> <hint type="sourcelabel"> - <x>300</x> - <y>412</y> + <x>390</x> + <y>400</y> </hint> <hint type="destinationlabel"> - <x>341</x> - <y>278</y> + <x>622</x> + <y>264</y> </hint> </hints> </connection> diff --git a/kde/src/klib/sflphone-client-kde.kcfg b/kde/src/klib/sflphone-client-kde.kcfg index 4e9685f0d39ea3899c36820ffcc9f9f9a6c0dd37..20800f4ce1ab389102ffc13412ab9ab23cbf7d7f 100755 --- a/kde/src/klib/sflphone-client-kde.kcfg +++ b/kde/src/klib/sflphone-client-kde.kcfg @@ -136,5 +136,19 @@ <entry name="prepend" type="String"> <label>Defines the prefix to add.</label> </entry> + + <!-- Accessibility Settings --> + <entry name="enableVoiceFeedback" type="bool"> + <label>Enable audio feedback from common actions</label> + <default> false </default> + </entry> + <entry name="enableReadLabel" type="bool"> + <label>Automatically read label when an overlay is being displayed</label> + <default> false </default> + </entry> + <entry name="enableReadDetails" type="bool"> + <label>Automattically read the call details when it is selected</label> + <default> false </default> + </entry> </group> </kcfg>