diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index 7f039ee6bab14ab3466b7eb355df140a0773c70f..490840e1aa0fb0d7e29bdc9ba1cde19f72198a6a 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -50,7 +50,6 @@ #include "config/yamlparser.h" #include "config/yamlemitter.h" #include "audio/alsa/alsalayer.h" -#include "audio/pulseaudio/pulselayer.h" #include "audio/sound/tonelist.h" #include "audio/sound/audiofile.h" #include "audio/sound/dtmf.h" @@ -346,6 +345,7 @@ void ManagerImpl::hangupCall(const std::string& callId) Call * call = SIPVoIPLink::instance()->getCall(callId); history_.addCall(call, preferences.getHistoryLimit()); SIPVoIPLink::instance()->hangup(callId); + saveHistory(); } catch (const VoipLinkException &e) { ERROR("%s", e.what()); } @@ -356,6 +356,7 @@ void ManagerImpl::hangupCall(const std::string& callId) history_.addCall(call, preferences.getHistoryLimit()); link->hangup(callId); removeCallAccount(callId); + saveHistory(); } getMainBuffer()->stateInfo(); @@ -1539,6 +1540,7 @@ void ManagerImpl::peerHungupCall(const std::string& call_id) Call * call = SIPVoIPLink::instance()->getCall(call_id); history_.addCall(call, preferences.getHistoryLimit()); SIPVoIPLink::instance()->hangup(call_id); + saveHistory(); } else { const std::string account_id(getAccountFromCall(call_id)); @@ -1546,6 +1548,7 @@ void ManagerImpl::peerHungupCall(const std::string& call_id) Call * call = link->getCall(call_id); history_.addCall(call, preferences.getHistoryLimit()); link->peerHungup(call_id); + saveHistory(); } /* Broadcast a signal over DBus */ diff --git a/kde/data/sflphone-client-kdeui.rc b/kde/data/sflphone-client-kdeui.rc index c91fd23094c0203c46ec6d287136dfd297983f12..ca0c824b3215b4c7aa3261b4c4ccaf3ee8d50b30 100755 --- a/kde/data/sflphone-client-kdeui.rc +++ b/kde/data/sflphone-client-kdeui.rc @@ -1,44 +1,45 @@ <?xml version="1.0" encoding="UTF-8"?> -<!--<gui name="tutorial3" - version="1" - xmlns="http://www.kde.org/standards/kxmlgui/1.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 - http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" > - --> + <!--<gui name="tutorial3" + version="1" + xmlns="http://www.kde.org/standards/kxmlgui/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 + http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" > + --> <gui name="sflphone-client-kde" version="1"> - <MenuBar> - <Menu name="Actions" > - <text>Actions</text> - <Action name="action_accept" /> - <Action name="action_refuse" /> - <Action name="action_hold" /> - <Action name="action_transfer" /> - <Action name="action_record" /> - <Action name="action_mailBox" /> - <Separator /> - <Action name="action_close" /> - <Separator /> - <Action name="action_quit" /> - </Menu> - <Menu name="Settings" > - <text>Settings</text> - <Action name="action_displayVolumeControls" /> - <Action name="action_displayDialpad" /> - <Separator /> - <Action name="action_configureShortcut" /> - <Action name="action_configureSflPhone" /> - <Separator /> - <Action name="action_accountCreationWizard" /> - </Menu> - </MenuBar> - - <ToolBar name="mainToolBar" iconText="icononly" position="Top" noMerge="1" fullWidth="false" newline="true" > - <Action name="action_accept" /> - <Action name="action_mailBox" /> - <Action name="action_refuse" /> - <Action name="action_hold" /> - <Action name="action_transfer" /> - <Action name="action_record" /> - </ToolBar> + <MenuBar> + <Menu name="Actions" > + <text>Actions</text> + <Action name="action_accept" /> + <Action name="action_refuse" /> + <Action name="action_hold" /> + <Action name="action_transfer" /> + <Action name="action_record" /> + <Action name="action_mailBox" /> + <Separator /> + <Action name="action_close" /> + <Separator /> + <Action name="action_quit" /> + </Menu> + <Menu name="Settings" > + <text>Settings</text> + <Action name="action_displayVolumeControls" /> + <Action name="action_displayDialpad" /> + <Action name="action_displayMessageBox" /> + <Separator /> + <Action name="action_configureShortcut" /> + <Action name="action_configureSflPhone" /> + <Separator /> + <Action name="action_accountCreationWizard" /> + </Menu> + </MenuBar> + + <ToolBar name="mainToolBar" iconText="icononly" position="Top" noMerge="1" fullWidth="false" newline="true" > + <Action name="action_accept" /> + <Action name="action_mailBox" /> + <Action name="action_refuse" /> + <Action name="action_hold" /> + <Action name="action_transfer" /> + <Action name="action_record" /> + </ToolBar> </gui> diff --git a/kde/plasma/plasmoid/MainWidget.cpp b/kde/plasma/plasmoid/MainWidget.cpp index ff3a9567c57950ff54d3a236312257faba64f090..305bf42a2c1ce4fed17d15324d7eae563d5a0dbc 100644 --- a/kde/plasma/plasmoid/MainWidget.cpp +++ b/kde/plasma/plasmoid/MainWidget.cpp @@ -71,14 +71,14 @@ void MainWidget::dataUpdated(const QString& source, const Plasma::DataEngine::Da { if ((source == "calls") && (frmCalls)) { QHash<QString, QVariant> value = data; - bool modified = false; + //bool modified = false; foreach(QVariant call, value) { if (!callWidgetList[value.key(call)]) { callWidgetList[ value.key(call) ] = new CallItem(); callWidgetList[ value.key(call) ]->setCallId(value.key(call)); callLayout->insertItem(0,callWidgetList[value.key(call)]); mainTabs->setCurrentIndex(CALL); - modified = true; + //modified = true; } callWidgetList[value.key(call)]->setCallerName(call.toHash() [ "Name" ].toString()); callWidgetList[value.key(call)]->setCallerNumber(call.toHash()[ "Number" ].toString()); diff --git a/kde/src/CMakeLists.txt b/kde/src/CMakeLists.txt index 043b4032d5abbe35b37d7778f3e1a1979a430658..41338d80f92adf0b2a415e8c1ae3ef0e8a4fe6d8 100755 --- a/kde/src/CMakeLists.txt +++ b/kde/src/CMakeLists.txt @@ -11,6 +11,8 @@ ADD_DEFINITIONS("-std=c++0x") add_subdirectory(lib) +find_package(Phonon) + MESSAGE("CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") IF(${CMAKE_BUILD_TYPE} MATCHES Release) @@ -21,39 +23,39 @@ ENDIF(${CMAKE_BUILD_TYPE} MATCHES Release) SET ( KDE4_KABC_LIBS -lkabc ) SET( sflphone_client_kde_SRCS - SFLPhoneView.cpp - SFLPhone.cpp - SFLPhoneapplication.cpp - widgets/SFLPhoneTray.cpp - main.cpp - AccountWizard.cpp - widgets/AccountItemWidget.cpp - widgets/CallTreeItem.cpp - widgets/HistoryTreeItem.cpp - ActionSetAccountFirst.cpp - conf/ConfigurationDialog.cpp - conf/dlggeneral.cpp - conf/dlgdisplay.cpp - conf/dlgaccounts.cpp - conf/dlgaudio.cpp - conf/dlgaddressbook.cpp - conf/dlghooks.cpp - conf/ConfigurationSkeleton.cpp - conf/ConfigAccountList.cpp - widgets/Dialpad.cpp - widgets/ContactItemWidget.cpp - widgets/ContactDock.cpp - widgets/HistoryDock.cpp - widgets/BookmarkDock.cpp - widgets/TranslucentButtons.cpp + SFLPhoneView.cpp + SFLPhone.cpp + SFLPhoneapplication.cpp + widgets/SFLPhoneTray.cpp + main.cpp + AccountWizard.cpp + widgets/AccountItemWidget.cpp + widgets/CallTreeItem.cpp + widgets/HistoryTreeItem.cpp + ActionSetAccountFirst.cpp + conf/ConfigurationDialog.cpp + conf/dlggeneral.cpp + conf/dlgdisplay.cpp + conf/dlgaccounts.cpp + conf/dlgaudio.cpp + conf/dlgaddressbook.cpp + conf/dlghooks.cpp + conf/ConfigurationSkeleton.cpp + conf/ConfigAccountList.cpp + widgets/Dialpad.cpp + widgets/ContactItemWidget.cpp + widgets/ContactDock.cpp + widgets/HistoryDock.cpp + widgets/BookmarkDock.cpp + widgets/TranslucentButtons.cpp widgets/CategoryDrawer.cpp widgets/CategorizedTreeWidget.cpp widgets/SortableDockCommon.cpp - Codec.cpp - AccountListModel.cpp - AkonadiBackend.cpp - CallView.cpp - AccountView.cpp + Codec.cpp + AccountListModel.cpp + AkonadiBackend.cpp + CallView.cpp + AccountView.cpp ) diff --git a/kde/src/CallView.cpp b/kde/src/CallView.cpp index 81212cca4bc98d4b438b41c5f5e34f50c0773009..d44d330229b66f36026c5243e0e7bcab8fab389e 100644 --- a/kde/src/CallView.cpp +++ b/kde/src/CallView.cpp @@ -258,7 +258,7 @@ bool CallView::contactToCall(QTreeWidgetItem *parent, int index, const QMimeData if (!QString(encodedContact).isEmpty()) { Contact* contact = AkonadiBackend::getInstance()->getContactByUid(encodedContact); if (contact) { - Call* call2; + Call* call2 = NULL; if (!SFLPhone::app()->view()->selectCallPhoneNumber(call2,contact)) return false; if (!parent) { @@ -619,6 +619,7 @@ Call* CallView::addConference(Call* conf) ///Executed when the daemon signal a modification in an existing conference. Update the call list and update the TreeView bool CallView::conferenceChanged(Call* conf) { + if (!dynamic_cast<Call*>(conf)) return false; kDebug() << "Conference changed"; //if (!SFLPhone::model()->conferenceChanged(confId, state)) // return false; diff --git a/kde/src/SFLPhone.cpp b/kde/src/SFLPhone.cpp index ea853869ecc8a61ac354045440ad4ef718c399e1..c2a60787f5a3b56bf7cd5b8c9b32307cc8f5876b 100755 --- a/kde/src/SFLPhone.cpp +++ b/kde/src/SFLPhone.cpp @@ -187,6 +187,11 @@ void SFLPhone::setupActions() action_displayDialpad = new KAction(KIcon(QIcon(ICON_DISPLAY_DIALPAD)), i18n("Display dialpad"), this); action_displayDialpad->setCheckable( true ); action_displayDialpad->setChecked ( ConfigurationSkeleton::displayDialpad() ); + action_configureSflPhone->setText(i18n("Configure SFLphone")); + + action_displayMessageBox = new KAction(KIcon("mail-message-new"), i18n("Display text message box"), this); + action_displayMessageBox->setCheckable( true ); + action_displayMessageBox->setChecked ( ConfigurationSkeleton::displayMessageBox() ); action_displayVolumeControls = new KAction(KIcon(QIcon(ICON_DISPLAY_VOLUME_CONSTROLS)), i18n("Display volume controls"), this); action_displayVolumeControls->setCheckable( true ); @@ -205,6 +210,7 @@ void SFLPhone::setupActions() /**/connect(action_mailBox, SIGNAL(triggered()), m_pView , SLOT(mailBox() )); /**/connect(action_displayVolumeControls, SIGNAL(toggled(bool)), m_pView , SLOT(displayVolumeControls(bool) )); /**/connect(action_displayDialpad, SIGNAL(toggled(bool)), m_pView , SLOT(displayDialpad(bool) )); + /**/connect(action_displayMessageBox, SIGNAL(toggled(bool)), m_pView , SLOT(displayMessageBox(bool) )); /**/connect(action_accountCreationWizard, SIGNAL(triggered()), m_pView , SLOT(accountCreationWizard() )); /**/connect(action_configureShortcut, SIGNAL(triggered()), this , SLOT(showShortCutEditor() )); /* */ @@ -220,6 +226,7 @@ void SFLPhone::setupActions() actionCollection()->addAction("action_quit" , action_quit ); actionCollection()->addAction("action_displayVolumeControls" , action_displayVolumeControls ); actionCollection()->addAction("action_displayDialpad" , action_displayDialpad ); + actionCollection()->addAction("action_displayMessageBox" , action_displayMessageBox ); actionCollection()->addAction("action_configureSflPhone" , action_configureSflPhone ); actionCollection()->addAction("action_accountCreationWizard" , action_accountCreationWizard ); actionCollection()->addAction("action_configureShortcut" , action_configureShortcut ); diff --git a/kde/src/SFLPhone.h b/kde/src/SFLPhone.h index 030a2292433b591696ce50770ef6f4b6667c0a01..40d38d08b68e601014d450ef723339dc23c5960d 100755 --- a/kde/src/SFLPhone.h +++ b/kde/src/SFLPhone.h @@ -87,6 +87,7 @@ private: KAction* action_quit ; KAction* action_displayVolumeControls ; KAction* action_displayDialpad ; + KAction* action_displayMessageBox ; KAction* action_configureSflPhone ; KAction* action_configureShortcut ; KAction* action_accountCreationWizard ; diff --git a/kde/src/SFLPhoneView.cpp b/kde/src/SFLPhoneView.cpp index b66ac4210654547247fbf422b0ae621186bd70ff..1eabaacf8fbfc4b50d1a687f782e3829ac55de21 100755 --- a/kde/src/SFLPhoneView.cpp +++ b/kde/src/SFLPhoneView.cpp @@ -69,6 +69,8 @@ SFLPhoneView::SFLPhoneView(QWidget *parent) pal.setColor(QPalette::AlternateBase, Qt::lightGray); setPalette(pal); + m_pMessageBoxW->setVisible(ConfigurationSkeleton::displayMessageBox()); + // SENDER SIGNAL RECEIVER SLOT / /**/connect(SFLPhone::model() , SIGNAL(incomingCall(Call*)) , this , SLOT(on1_incomingCall(Call*) )); /**/connect(SFLPhone::model() , SIGNAL(voiceMailNotify(const QString &, int)) , this , SLOT(on1_voiceMailNotify(const QString &, int) )); @@ -78,6 +80,8 @@ SFLPhoneView::SFLPhoneView(QWidget *parent) /**/connect(TreeWidgetCallModel::getAccountList() , SIGNAL(accountListUpdated()) , this , SLOT(updateStatusMessage() )); /**/connect(TreeWidgetCallModel::getAccountList() , SIGNAL(accountListUpdated()) , this , SLOT(updateWindowCallState() )); /**/connect(&configurationManager , SIGNAL(accountsChanged()) , TreeWidgetCallModel::getAccountList() , SLOT(updateAccounts() )); + /**/connect(m_pSendMessageLE , SIGNAL(returnPressed()) , this , SLOT(sendMessage() )); + /**/connect(m_pSendMessagePB , SIGNAL(clicked()) , this , SLOT(sendMessage() )); /* */ TreeWidgetCallModel::getAccountList()->updateAccounts(); @@ -301,6 +305,7 @@ void SFLPhoneView::updateWindowCallState() enabledActions[ SFLPhone::Hold ] = false; enabledActions[ SFLPhone::Transfer ] = false; enabledActions[ SFLPhone::Record ] = false; + m_pMessageBoxW->setVisible(false); } else { call_state state = call->getState(); @@ -321,6 +326,7 @@ void SFLPhoneView::updateWindowCallState() break; case CALL_STATE_CURRENT: buttonIconFiles [ SFLPhone::Record ] = ICON_REC_DEL_ON ; + m_pMessageBoxW->setVisible(true); break; case CALL_STATE_DIALING: enabledActions [ SFLPhone::Hold ] = false ; @@ -332,6 +338,7 @@ void SFLPhoneView::updateWindowCallState() case CALL_STATE_HOLD: buttonIconFiles [ SFLPhone::Hold ] = ICON_UNHOLD ; actionTexts [ SFLPhone::Hold ] = ACTION_LABEL_UNHOLD ; + m_pMessageBoxW->setVisible(true); break; case CALL_STATE_FAILURE: enabledActions [ SFLPhone::Accept ] = false ; @@ -527,6 +534,12 @@ void SFLPhoneView::displayDialpad(bool checked) updateDialpad(); } +void SFLPhoneView::displayMessageBox(bool checked) +{ + ConfigurationSkeleton::setDisplayMessageBox(checked); + m_pMessageBoxW->setVisible(checked); +} + ///Input grabber void SFLPhoneView::on_widget_dialpad_typed(QString text) { @@ -787,4 +800,12 @@ void SFLPhoneView::on1_volumeChanged(const QString & /*device*/, double value) updateVolumeBar(value); } +void SFLPhoneView::sendMessage() +{ + Call* call = callTreeModel->getCurrentItem(); + if (dynamic_cast<Call*>(call) && !m_pSendMessageLE->text().isEmpty()) { + call->sendTextMessage(m_pSendMessageLE->text()); + } +} + #include "SFLPhoneView.moc" diff --git a/kde/src/SFLPhoneView.h b/kde/src/SFLPhoneView.h index 9f63db7a23fa411dfaab24a072095ff790266c5c..73191b9582fe31f9d10b5396fa192480c2ae01a8 100755 --- a/kde/src/SFLPhoneView.h +++ b/kde/src/SFLPhoneView.h @@ -164,7 +164,7 @@ private slots: void updateVolumeBar (double _value = -1); void updateVolumeControls (); void updateDialpad (); - + void sendMessage(); @@ -206,6 +206,7 @@ public slots: void displayVolumeControls(bool checked = true); void displayDialpad(bool checked = true); + void displayMessageBox(bool checked = true); void configureSflPhone(); void accountCreationWizard(); void accept (); diff --git a/kde/src/conf/ConfigurationDialog.cpp b/kde/src/conf/ConfigurationDialog.cpp index c24fd3433d74c05e3a34ddf89d0b39afd564cbb0..0cc5f16e3a7ec4149c7054088f45e185a972a21b 100755 --- a/kde/src/conf/ConfigurationDialog.cpp +++ b/kde/src/conf/ConfigurationDialog.cpp @@ -69,12 +69,16 @@ void ConfigurationDialog::updateWidgets() { dlgAudio->updateWidgets(); dlgAccounts->updateWidgets(); + dlgGeneral->updateWidgets(); + dlgAddressBook->updateWidgets(); } void ConfigurationDialog::updateSettings() { dlgAudio->updateSettings(); dlgAccounts->updateSettings(); + dlgGeneral->updateSettings(); + dlgAddressBook->updateSettings(); } bool ConfigurationDialog::hasChanged() diff --git a/kde/src/conf/ConfigurationSkeleton.cpp b/kde/src/conf/ConfigurationSkeleton.cpp index 3fadaea56a68bc8417ba73df0ce67027d86d4c1d..2efa9721a8c9b73c71e6a4f865c3be18729045aa 100755 --- a/kde/src/conf/ConfigurationSkeleton.cpp +++ b/kde/src/conf/ConfigurationSkeleton.cpp @@ -66,19 +66,19 @@ void ConfigurationSkeleton::readConfig() //Call history settings //setEnableHistory(true); - setHistoryMax(1000);//configurationManager.getHistoryLimit()); + setHistoryMax(configurationManager.getHistoryLimit()); //////////////////////// ////Display settings//// //////////////////////// //Notification settings - setNotifOnCalls(true); - setNotifOnMessages(true);//configurationManager.getMailNotify()); + //setNotifOnCalls(true); + setNotifOnMessages(configurationManager.getMailNotify()); //Window display settings - setDisplayOnStart(true); - setDisplayOnCalls(true); + //setDisplayOnStart(true); + //setDisplayOnCalls(true); ///////////////////////// ////Accounts settings//// @@ -98,12 +98,9 @@ void ConfigurationSkeleton::readConfig() //ringtones settings setEnableRingtones(true); - QString ringtone = ""; - if(ringtone.isEmpty()) { - setRingtone(QString(SHARE_INSTALL_PREFIX) + "sflphone/ringtones/konga.ul"); - } - else { - setRingtone(ringtone); + //QString ringtone = ""; + if(ringtone().isEmpty()) { + setRingtone(QString(SHARE_INSTALL_PREFIX) + "/sflphone/ringtones/konga.ul"); } //codecs settings @@ -131,31 +128,17 @@ void ConfigurationSkeleton::readConfig() //if(!ok) kDebug() << "outputDevice is not a number"; //setAlsaOutputDevice(outputDevice); - /////////////////////// - ////Record settings//// - /////////////////////// - - QString recordPath = configurationManager.getRecordPath(); - if(! recordPath.isEmpty()) { - setDestinationFolder(recordPath); - } - else { - setDestinationFolder(QDir::home().path()); - } - - - ///////////////////////////// ////Address book settings//// ///////////////////////////// MapStringInt addressBookSettings = configurationManager.getAddressbookSettings().value(); setEnableAddressBook(addressBookSettings[ADDRESSBOOK_ENABLE]); - setMaxResults(addressBookSettings[ADDRESSBOOK_MAX_RESULTS]); - setDisplayPhoto(addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO]); - setBusiness(addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS]); - setMobile(addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE]); - setHome(addressBookSettings[ADDRESSBOOK_DISPLAY_HOME]); +// setMaxResults(addressBookSettings[ADDRESSBOOK_MAX_RESULTS]); +// setDisplayPhoto(addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO]); +// setBusiness(addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS]); +// setMobile(addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE]); +// setHome(addressBookSettings[ADDRESSBOOK_DISPLAY_HOME]); ///////////////////////////// ///////Hooks settings//////// @@ -176,7 +159,7 @@ void ConfigurationSkeleton::writeConfig() { //ConfigurationSkeleton::writeConfig(); kDebug() << "Writing config"; - /*ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); //////////////////////// @@ -200,7 +183,8 @@ void ConfigurationSkeleton::writeConfig() //Notification settings //if(notifOnCalls() != configurationManager.getNotify()) configurationManager.setNotify(); - //if(notifOnMessages() != configurationManager.getMailNotify()) configurationManager.setMailNotify(); +// if(notifOnMessages() != configurationManager.getMailNotify()) configurationManager.setMailNotify(); + //configurationManager.setMailNotify(notifOnMessages()); //Window display settings //WARNING états inversés @@ -222,15 +206,15 @@ void ConfigurationSkeleton::writeConfig() kDebug() << "Writing Audio settings"; //Audio Interface settings - int prevManager = configurationManager.getAudioManager(); - int newManager = interface(); - if(prevManager != newManager) { - configurationManager.setAudioManager(newManager); - } +// int prevManager = configurationManager.getAudioManager(); +// int newManager = interface(); +// if(prevManager != newManager) { +// configurationManager.setAudioManager(newManager); +// } //ringtones settings - if(enableRingtones() != configurationManager.isRingtoneEnabled()) configurationManager.ringtoneEnabled(); - configurationManager.setRingtoneChoice(ringtone()); +// if(enableRingtones() != configurationManager.isRingtoneEnabled()) configurationManager.ringtoneEnabled(); +// configurationManager.setRingtoneChoice(ringtone()); //codecs settings //kDebug() << "activeCodecList = " << activeCodecList(); @@ -238,12 +222,12 @@ void ConfigurationSkeleton::writeConfig() //alsa settings - if(prevManager == CONST_ALSA && newManager == EnumInterface::ALSA) { - kDebug() << "setting alsa settings"; - configurationManager.setOutputAudioPlugin(alsaPlugin()); - configurationManager.setAudioInputDevice(alsaInputDevice()); - configurationManager.setAudioOutputDevice(alsaOutputDevice()); - } +// if(prevManager == CONST_ALSA && newManager == EnumInterface::ALSA) { +// kDebug() << "setting alsa settings"; +// configurationManager.setOutputAudioPlugin(alsaPlugin()); +// configurationManager.setAudioInputDevice(alsaInputDevice()); +// configurationManager.setAudioOutputDevice(alsaOutputDevice()); +// } /////////////////////// @@ -252,8 +236,8 @@ void ConfigurationSkeleton::writeConfig() kDebug() << "Writing Record settings"; - QString destination = destinationFolder(); - configurationManager.setRecordPath(destination); +// QString destination = destinationFolder(); +// configurationManager.setRecordPath(destination); ///////////////////////////// @@ -264,11 +248,11 @@ void ConfigurationSkeleton::writeConfig() MapStringInt addressBookSettings = MapStringInt(); addressBookSettings[ADDRESSBOOK_ENABLE] = enableAddressBook(); - addressBookSettings[ADDRESSBOOK_MAX_RESULTS] = maxResults(); - addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO] = displayPhoto(); - addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS] = business(); - addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE] = mobile(); - addressBookSettings[ADDRESSBOOK_DISPLAY_HOME] = home(); +// addressBookSettings[ADDRESSBOOK_MAX_RESULTS] = maxResults(); +// addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO] = displayPhoto(); +// addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS] = business(); +// addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE] = mobile(); +// addressBookSettings[ADDRESSBOOK_DISPLAY_HOME] = home(); configurationManager.setAddressbookSettings(addressBookSettings); ///////////////////////////// @@ -286,7 +270,7 @@ void ConfigurationSkeleton::writeConfig() hooksSettings[HOOKS_COMMAND] = hooksCommand(); configurationManager.setHookSettings(hooksSettings); - kDebug() << "Finished to write config\n";*/ + kDebug() << "Finished to write config\n"; ConfigurationSkeletonBase::writeConfig(); } diff --git a/kde/src/conf/dlgaccounts.cpp b/kde/src/conf/dlgaccounts.cpp index 7d2835c6c7b5dd5d8c2c17a3a95ecd94a3a60a65..0b1876a525cea409afe6f60d54ece59f36d13617 100755 --- a/kde/src/conf/dlgaccounts.cpp +++ b/kde/src/conf/dlgaccounts.cpp @@ -81,10 +81,13 @@ DlgAccounts::DlgAccounts(KConfigDialog* parent) setupUi(this); disconnect(keditlistbox_codec->addButton(),SIGNAL(clicked())); ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - button_accountUp->setIcon ( KIcon( "go-up" ) ); - button_accountDown->setIcon ( KIcon( "go-down" ) ); - button_accountAdd->setIcon ( KIcon( "list-add" ) ); - button_accountRemove->setIcon ( KIcon( "list-remove" ) ); + button_accountUp->setIcon ( KIcon( "go-up" ) ); + button_accountDown->setIcon ( KIcon( "go-down" ) ); + button_accountAdd->setIcon ( KIcon( "list-add" ) ); + button_accountRemove->setIcon ( KIcon( "list-remove" ) ); + button_add_credential->setIcon ( KIcon( "list-add" ) ); + button_remove_credential->setIcon ( KIcon( "list-remove" ) ); + accountList = new ConfigAccountList(false); loadAccountList(); loadCodecList(); @@ -101,7 +104,6 @@ DlgAccounts::DlgAccounts(KConfigDialog* parent) /**/connect(edit6_mailbox, SIGNAL(textEdited(const QString &)) , this , SLOT(changedAccountList() )); /**/connect(spinbox_regExpire, SIGNAL(editingFinished()) , this , SLOT(changedAccountList() )); /**/connect(comboBox_ni_local_address, SIGNAL(currentIndexChanged (int)) , this , SLOT(changedAccountList() )); - /**/connect(checkBox_conformRFC, SIGNAL(clicked(bool)) , this , SLOT(changedAccountList() )); /**/connect(button_accountUp, SIGNAL(clicked()) , this , SLOT(changedAccountList() )); /**/connect(button_accountDown, SIGNAL(clicked()) , this , SLOT(changedAccountList() )); /**/connect(button_accountAdd, SIGNAL(clicked()) , this , SLOT(changedAccountList() )); @@ -225,6 +227,7 @@ void DlgAccounts::saveAccount(QListWidgetItem * item) /**/account->setAccountDetail( ACCOUNT_PASSWORD , edit5_password->text() ); /**/account->setAccountDetail( ACCOUNT_MAILBOX , edit6_mailbox->text() ); /**/account->setAccountDetail( ACCOUNT_ENABLED , account->isChecked()?REGISTRATION_ENABLED_TRUE:REGISTRATION_ENABLED_FALSE); + /**/account->setAccountDetail( ACCOUNT_REGISTRATION_EXPIRE , QString::number(spinbox_regExpire->value()) ); /**/ /**/ /* Security */ /**/account->setAccountDetail( TLS_PASSWORD , edit_tls_private_key_password->text() ); @@ -301,9 +304,9 @@ void DlgAccounts::loadAccount(QListWidgetItem * item) loadCredentails(account->getAccountDetail(ACCOUNT_ID)); - bool ok; - int val = account->getAccountDetail(ACCOUNT_REGISTRATION_STATUS).toInt(&ok); - spinbox_regExpire->setValue(ok ? val : REGISTRATION_EXPIRE_DEFAULT); +// bool ok; +// int val = account->getAccountDetail(ACCOUNT_REGISTRATION_STATUS).toInt(&ok); +// spinbox_regExpire->setValue(ok ? val : REGISTRATION_EXPIRE_DEFAULT); foreach(CredentialData data,credentialList) { if (data.name == account->getAccountDetail(ACCOUNT_USERNAME)) { @@ -340,7 +343,6 @@ void DlgAccounts::loadAccount(QListWidgetItem * item) /**/edit3_server->setText ( account->getAccountDetail( ACCOUNT_HOSTNAME ) ); /**/edit4_user->setText ( account->getAccountDetail( ACCOUNT_USERNAME ) ); /**/edit6_mailbox->setText ( account->getAccountDetail( ACCOUNT_MAILBOX ) ); - // /**/checkBox_conformRFC->setChecked ( account->getAccountDetail( ACCOUNT_RESOLVE_ONCE ) != "TRUE" ); /**/checkbox_ZRTP_Ask_user->setChecked ( (account->getAccountDetail( ACCOUNT_DISPLAY_SAS_ONCE ) == "true")?1:0 ); /**/checkbox_SDES_fallback_rtp->setChecked ( (account->getAccountDetail( ACCOUNT_SRTP_RTP_FALLBACK ) == "true")?1:0 ); /**/checkbox_ZRTP_display_SAS->setChecked ( (account->getAccountDetail( ACCOUNT_ZRTP_DISPLAY_SAS ) == "true")?1:0 ); @@ -348,6 +350,7 @@ void DlgAccounts::loadAccount(QListWidgetItem * item) /**/checkbox_ZTRP_send_hello->setChecked ( (account->getAccountDetail( ACCOUNT_ZRTP_HELLO_HASH ) == "true")?1:0 ); /**/checkbox_stun->setChecked ( (account->getAccountDetail( ACCOUNT_SIP_STUN_ENABLED ) == "true")?1:0 ); /**/line_stun->setText ( account->getAccountDetail( ACCOUNT_SIP_STUN_SERVER ) ); + /**/spinbox_regExpire->setValue ( account->getAccountDetail( ACCOUNT_REGISTRATION_EXPIRE ).toInt() ); /**/radioButton_pa_same_as_local->setChecked ( (account->getAccountDetail( PUBLISHED_SAMEAS_LOCAL ) == "true")?1:0 ); /**/radioButton_pa_custom->setChecked ( !(account->getAccountDetail( PUBLISHED_SAMEAS_LOCAL ) == "true")?1:0 ); /**/lineEdit_pa_published_address->setText ( account->getAccountDetail( PUBLISHED_ADDRESS ) ); @@ -386,6 +389,7 @@ void DlgAccounts::loadAccount(QListWidgetItem * item) combo_tls_method->setCurrentIndex ( combo_tls_method->findText(account->getAccountDetail(TLS_METHOD ))); ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + comboBox_ni_local_address->clear(); QStringList interfaceList = configurationManager.getAllIpInterfaceByName(); comboBox_ni_local_address->addItems(interfaceList); diff --git a/kde/src/conf/dlgaccountsbase.ui b/kde/src/conf/dlgaccountsbase.ui index 552ffe177ddc21c407a3fce6b9f5e36c6747dd20..8359b8f4f91c2ea1d459d7b48db5a22284d16110 100755 --- a/kde/src/conf/dlgaccountsbase.ui +++ b/kde/src/conf/dlgaccountsbase.ui @@ -392,15 +392,18 @@ <string>Resgistration</string> </property> <layout class="QGridLayout" name="gridLayout_8"> - <item row="0" column="0"> - <widget class="QLabel" name="label_regExpire"> - <property name="text"> - <string>Registration expire</string> + <item row="0" column="2"> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - <property name="buddy"> - <cstring>spinbox_regExpire</cstring> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> </property> - </widget> + </spacer> </item> <item row="0" column="1"> <widget class="KIntSpinBox" name="spinbox_regExpire"> @@ -409,25 +412,15 @@ </property> </widget> </item> - <item row="1" column="0" colspan="2"> - <widget class="QCheckBox" name="checkBox_conformRFC"> + <item row="0" column="0"> + <widget class="QLabel" name="label_regExpire"> <property name="text"> - <string>Conform to RFC 3263</string> - </property> - </widget> - </item> - <item row="0" column="2"> - <spacer name="horizontalSpacer_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <string>Registration expire</string> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <property name="buddy"> + <cstring>spinbox_regExpire</cstring> </property> - </spacer> + </widget> </item> </layout> </widget> diff --git a/kde/src/conf/dlgaddressbook.cpp b/kde/src/conf/dlgaddressbook.cpp index 0766769b28ed417db1d76052112fa9546fca4452..8145b7cc337d9be0f68920a3159923f4fbb26d94 100755 --- a/kde/src/conf/dlgaddressbook.cpp +++ b/kde/src/conf/dlgaddressbook.cpp @@ -20,15 +20,52 @@ ***************************************************************************/ #include "dlgaddressbook.h" +#include "conf/ConfigurationSkeleton.h" + DlgAddressBook::DlgAddressBook(QWidget *parent) : QWidget(parent) { setupUi(this); -} + + m_pPhoneTypeList->addItem( m_mNumbertype["Work"] = new QListWidgetItem("Work" )); + m_pPhoneTypeList->addItem( m_mNumbertype["Home"] = new QListWidgetItem("Home" )); + m_pPhoneTypeList->addItem( m_mNumbertype["Messenger"] = new QListWidgetItem("Messenger" )); + m_pPhoneTypeList->addItem( m_mNumbertype["Prefered number"] = new QListWidgetItem("Prefered number" )); + m_pPhoneTypeList->addItem( m_mNumbertype["Voice"] = new QListWidgetItem("Voice" )); +// m_pPhoneTypeList->addItem( m_mNumbertype["Fax"] = new QListWidgetItem("Fax" )); + m_pPhoneTypeList->addItem( m_mNumbertype["Mobile"] = new QListWidgetItem("Mobile" )); + m_pPhoneTypeList->addItem( m_mNumbertype["Video"] = new QListWidgetItem("Video" )); + m_pPhoneTypeList->addItem( m_mNumbertype["Mailbox"] = new QListWidgetItem("Mailbox" )); + m_pPhoneTypeList->addItem( m_mNumbertype["Modem"] = new QListWidgetItem("Modem" )); + m_pPhoneTypeList->addItem( m_mNumbertype["Car"] = new QListWidgetItem("Car" )); + m_pPhoneTypeList->addItem( m_mNumbertype["ISDN"] = new QListWidgetItem("ISDN" )); + m_pPhoneTypeList->addItem( m_mNumbertype["PCS"] = new QListWidgetItem("PCS" )); + m_pPhoneTypeList->addItem( m_mNumbertype["Pager"] = new QListWidgetItem("Pager" )); + m_pPhoneTypeList->addItem( m_mNumbertype["Other..."] = new QListWidgetItem("Other..." )); + QStringList list = ConfigurationSkeleton::phoneTypeList(); + foreach(QListWidgetItem* i,m_mNumbertype) { + i->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); + i->setCheckState((list.indexOf(m_mNumbertype.key(i)) != -1)?Qt::Checked:Qt::Unchecked); + } +} DlgAddressBook::~DlgAddressBook() { } +void DlgAddressBook::updateWidgets() +{ + +} + +void DlgAddressBook::updateSettings() +{ + QStringList list; + foreach(QListWidgetItem* i,m_mNumbertype) { + if (i->checkState() == Qt::Checked) + list << m_mNumbertype.key(i); + } + ConfigurationSkeleton::setPhoneTypeList(list); +} diff --git a/kde/src/conf/dlgaddressbook.h b/kde/src/conf/dlgaddressbook.h index 94ec8a671e161434fb5a841342c39fd959feb70a..f46dee3bd0dc61cf4a700b3c8642420a567f5d0d 100755 --- a/kde/src/conf/dlgaddressbook.h +++ b/kde/src/conf/dlgaddressbook.h @@ -21,7 +21,10 @@ #ifndef DLGADDRESSBOOK_H #define DLGADDRESSBOOK_H -#include <QWidget> +#include <QtCore/QHash> +#include <QtCore/QString> +#include <QtGui/QWidget> +#include <QtGui/QListWidgetItem> #include "ui_dlgaddressbookbase.h" @@ -36,6 +39,14 @@ public: ~DlgAddressBook(); +private: + QHash<QString,QListWidgetItem*> m_mNumbertype; + +public slots: + void updateWidgets(); + void updateSettings(); + + }; #endif diff --git a/kde/src/conf/dlgaddressbookbase.ui b/kde/src/conf/dlgaddressbookbase.ui index e7f4964bf3500761158f832f10a800c4d9d4ba7e..245f8a17132ff4aae99b7c382f2f3af426052020 100755 --- a/kde/src/conf/dlgaddressbookbase.ui +++ b/kde/src/conf/dlgaddressbookbase.ui @@ -22,178 +22,27 @@ </widget> </item> <item> - <widget class="QWidget" name="widget_configAddressBookGeneral" native="true"> - <property name="enabled"> - <bool>false</bool> + <widget class="QLabel" name="m_pPhonetypeL"> + <property name="text"> + <string>Use contact from the following phone number category:</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <property name="leftMargin"> - <number>0</number> - </property> - <item> - <widget class="QWidget" name="widget_maxResults" native="true"> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <property name="spacing"> - <number>-1</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>5</number> - </property> - <property name="rightMargin"> - <number>5</number> - </property> - <property name="bottomMargin"> - <number>5</number> - </property> - <item> - <widget class="QLabel" name="label_maxResults"> - <property name="text"> - <string>Maximum results</string> - </property> - <property name="buddy"> - <cstring>horizontalSlider_maxResults</cstring> - </property> - </widget> - </item> - <item> - <widget class="QSlider" name="horizontalSlider_maxResults"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimum"> - <number>25</number> - </property> - <property name="maximum"> - <number>50</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="KIntSpinBox" name="kcfg_maxResults"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QCheckBox" name="kcfg_displayPhoto"> - <property name="text"> - <string>Display photo if available</string> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_displayTypes"> - <property name="title"> - <string>Display phone numbers of these types :</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <widget class="QCheckBox" name="kcfg_business"> - <property name="text"> - <string>Work</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="kcfg_mobile"> - <property name="text"> - <string>Mobile</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="kcfg_home"> - <property name="text"> - <string>Home</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> </widget> </item> <item> - <spacer name="verticalSpacer_configAddressBook"> - <property name="orientation"> - <enum>Qt::Vertical</enum> + <widget class="QListWidget" name="m_pPhoneTypeList"> + <property name="editTriggers"> + <set>QAbstractItemView::NoEditTriggers</set> + </property> + <property name="selectionMode"> + <enum>QAbstractItemView::SingleSelection</enum> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>72</height> - </size> + <property name="sortingEnabled"> + <bool>true</bool> </property> - </spacer> + </widget> </item> </layout> </widget> - <customwidgets> - <customwidget> - <class>KIntSpinBox</class> - <extends>QSpinBox</extends> - <header>knuminput.h</header> - </customwidget> - </customwidgets> <resources/> - <connections> - <connection> - <sender>horizontalSlider_maxResults</sender> - <signal>valueChanged(int)</signal> - <receiver>kcfg_maxResults</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>265</x> - <y>67</y> - </hint> - <hint type="destinationlabel"> - <x>326</x> - <y>70</y> - </hint> - </hints> - </connection> - <connection> - <sender>kcfg_maxResults</sender> - <signal>valueChanged(int)</signal> - <receiver>horizontalSlider_maxResults</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>326</x> - <y>70</y> - </hint> - <hint type="destinationlabel"> - <x>265</x> - <y>67</y> - </hint> - </hints> - </connection> - <connection> - <sender>kcfg_enableAddressBook</sender> - <signal>toggled(bool)</signal> - <receiver>widget_configAddressBookGeneral</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>92</x> - <y>25</y> - </hint> - <hint type="destinationlabel"> - <x>91</x> - <y>39</y> - </hint> - </hints> - </connection> - </connections> + <connections/> </ui> diff --git a/kde/src/conf/dlgaudio.cpp b/kde/src/conf/dlgaudio.cpp index ae9bbd966f15f5b8f3dce3c9969cac1adb318800..1366b5457d58858d5055528a4ce9ace00f37e8ab 100755 --- a/kde/src/conf/dlgaudio.cpp +++ b/kde/src/conf/dlgaudio.cpp @@ -25,6 +25,7 @@ #include "conf/ConfigurationSkeleton.h" #include "conf/ConfigurationDialog.h" #include <QtGui/QHeaderView> +#include <KStandardDirs> #include "lib/sflphone_const.h" @@ -36,9 +37,13 @@ DlgAudio::DlgAudio(KConfigDialog *parent) KUrlRequester_ringtone->setMode(KFile::File | KFile::ExistingOnly); KUrlRequester_ringtone->lineEdit()->setObjectName("kcfg_ringtone"); KUrlRequester_ringtone->lineEdit()->setReadOnly(true); + KUrlRequester_ringtone->setUrl( KStandardDirs::realFilePath(ConfigurationSkeleton::ringtone())); + + + ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); KUrlRequester_destinationFolder->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly); - KUrlRequester_destinationFolder->setUrl(KUrl(QDir::home().path())); + KUrlRequester_destinationFolder->setUrl(KUrl(configurationManager.getRecordPath())); KUrlRequester_destinationFolder->lineEdit()->setObjectName("kcfg_destinationFolder"); KUrlRequester_destinationFolder->lineEdit()->setReadOnly(true); @@ -63,8 +68,10 @@ void DlgAudio::updateSettings() //alsaPlugin ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self(); skeleton->setAlsaPlugin(box_alsaPlugin->currentText()); - - //codecTableHasChanged = false; + skeleton->setRingtone(KUrlRequester_ringtone->lineEdit()->text()); + + ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + configurationManager.setRecordPath(KUrlRequester_destinationFolder->lineEdit()->text()); } bool DlgAudio::hasChanged() diff --git a/kde/src/conf/dlggeneral.cpp b/kde/src/conf/dlggeneral.cpp index c99d01b61ca550f36c8e875ed72051a9993f7700..ea7f3a6a811784ee1480a4466d83cd1e79ade071 100755 --- a/kde/src/conf/dlggeneral.cpp +++ b/kde/src/conf/dlggeneral.cpp @@ -22,15 +22,28 @@ #include <QToolButton> #include <QAction> +#include "conf/ConfigurationSkeleton.h" +#include "conf/ConfigurationDialog.h" + DlgGeneral::DlgGeneral(QWidget *parent) : QWidget(parent) { setupUi(this); connect(toolButton_historyClear, SIGNAL(clicked()), this, SIGNAL(clearCallHistoryAsked())); -} + kcfg_historyMax->setValue(ConfigurationSkeleton::historyMax()); +} DlgGeneral::~DlgGeneral() { } +void DlgGeneral::updateWidgets() +{ + +} + +void DlgGeneral::updateSettings() +{ + ConfigurationSkeleton::setHistoryMax(kcfg_historyMax->value()); +} \ No newline at end of file diff --git a/kde/src/conf/dlggeneral.h b/kde/src/conf/dlggeneral.h index 26719ac2cc06fd510d0dcf3f698a00db06dbad80..92a6c002a906d4ed297ec6bb991a7fcbad85d425 100755 --- a/kde/src/conf/dlggeneral.h +++ b/kde/src/conf/dlggeneral.h @@ -38,6 +38,11 @@ public: //Destructor ~DlgGeneral(); +public slots: + //Mutator + void updateWidgets(); + void updateSettings(); + signals: void clearCallHistoryAsked(); diff --git a/kde/src/conf/sflphone-client-kde.kcfg b/kde/src/conf/sflphone-client-kde.kcfg index c989ed036b7b4c6eae30f0d5f81fbe2a6a41175c..4e9685f0d39ea3899c36820ffcc9f9f9a6c0dd37 100755 --- a/kde/src/conf/sflphone-client-kde.kcfg +++ b/kde/src/conf/sflphone-client-kde.kcfg @@ -26,21 +26,31 @@ <entry name="notifOnCalls" type="Bool"> <label>Defines whether user should be notified when receiving a call.</label> + <default>true</default> </entry> <entry name="notifOnMessages" type="Bool"> <label>Defines whether user should be notified when receiving a message.</label> + <default>true</default> </entry> <entry name="displayOnStart" type="Bool"> <label>Defines whether the main window should be displayed on start.</label> + <default>true</default> </entry> <entry name="displayOnCalls" type="Bool"> <label>Defines whether the main window should be displayed when receiving a message.</label> + <default>true</default> </entry> <entry name="displayDialpad" type="Bool"> <label>Defines whether the dialpad is being shown by default</label> + <default>true</default> + </entry> + <entry name="displayMessageBox" type="Bool"> + <label>Defines whether the text message box is visible</label> + <default>false</default> </entry> <entry name="displayVolume" type="Bool"> <label>Defines whether the volume widgets are visible by default</label> + <default>false</default> </entry> <entry name="displayMenu" type="Bool"> <label>Defines whether the main menu is visible by default, it can be restored with "Ctrl+m"</label> @@ -59,7 +69,7 @@ </entry> <entry name="displayContactCallHistory" type="Bool"> <label>Defines if the individual contact history list is visible</label> - </entry> + </entry> <!-- Audio Settings --> @@ -77,11 +87,6 @@ <entry name="ringtone" type="Path"> <label>Defines which ringtone is used.</label> </entry> - <!-- - <entry name="activeCodecList" type="StringList"> - <label>Defines which ALSA plugin to use.</label> - </entry> - --> <entry name="alsaPlugin" type="String"> <label>Defines which ALSA plugin to use.</label> </entry> @@ -100,20 +105,10 @@ <entry name="enableAddressBook" type="Bool"> <label>Defines whether the search in KDE Address Book is enabled</label> </entry> - <entry name="maxResults" type="Int"> - <label>Defines the max number of contacts to display during a search in address book.</label> - </entry> - <entry name="displayPhoto" type="Bool"> - <label>Defines whether to display contacts photos.</label> - </entry> - <entry name="business" type="Bool"> - <label>Defines whether to display professionnal phone numbers.</label> - </entry> - <entry name="mobile" type="Bool"> - <label>Defines whether to display mobile phone numbers.</label> - </entry> - <entry name="home" type="Bool"> - <label>Defines whether to display personnal phone numbers.</label> + + <entry name="phoneTypeList" type="StringList"> + <label>Defines whether the search in KDE Address Book is enabled</label> + <default>{Work,Home,Messenger,Prefered number,Voice,Mobile,Work,Video,Mailbox,Modem,Car,ISDN,PCS,Pager,Other...,Work}</default> </entry> <!-- Bookmark --> @@ -121,12 +116,6 @@ <label>List of bookmarked clients</label> </entry> - <!-- Record Settings --> - - <entry name="destinationFolder" type="Path"> - <label>Defines the destination directory for call recordings.</label> - </entry> - <!-- Hooks Settings --> <entry name="enableHooksSIP" type="Bool"> diff --git a/kde/src/lib/Call.cpp b/kde/src/lib/Call.cpp index e09f029a425a2765ee3f5e3f001d77476d7228a9..d700174dda1cbecba349c2566486c3d942a90eda 100644 --- a/kde/src/lib/Call.cpp +++ b/kde/src/lib/Call.cpp @@ -535,6 +535,11 @@ void Call::changeCurrentState(call_state newState) emit isOver(this); } +void Call::sendTextMessage(QString message) +{ + CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance(); + callManager.sendTextMessage(m_CallId,message); +} /***************************************************************************** * * diff --git a/kde/src/lib/Call.h b/kde/src/lib/Call.h index 47252d9f60a1bbca1dcfe19c9d7fb985ab513481..4d763bf472382627dd873f99db678a8a7d3891f5 100644 --- a/kde/src/lib/Call.h +++ b/kde/src/lib/Call.h @@ -168,6 +168,7 @@ public: void appendText(const QString& str); void backspaceItemText(); void changeCurrentState(call_state newState); + void sendTextMessage(QString message); private: diff --git a/kde/src/lib/CallModel.cpp b/kde/src/lib/CallModel.cpp index 79acc3b3df532e8ae78b120b7f289b311b003a3b..f172b83aa2f51f51b7cfefb986f58126060291ee 100644 --- a/kde/src/lib/CallModel.cpp +++ b/kde/src/lib/CallModel.cpp @@ -96,7 +96,7 @@ void CallModelBase::on1_changingConference(const QString &confID, const QString { Call* conf = getCall(confID); qDebug() << "Changing conference state" << conf << confID; - if (conf) { + if (conf && dynamic_cast<Call*>(conf)) { //Prevent a race condition between call and conference changeConference(confID, state); emit conferenceChanged(conf); } diff --git a/kde/src/lib/CallModel.h b/kde/src/lib/CallModel.h index adf17e1aecdca377899d6df1190297b5c5997b4e..3346f93d6c3921466fda1f999ee6f14150436004 100644 --- a/kde/src/lib/CallModel.h +++ b/kde/src/lib/CallModel.h @@ -40,9 +40,9 @@ class ContactBackend; typedef QMap<QString, Call*> CallMap; typedef QList<Call*> CallList; -///@class CallModelBase Base class for the central model/frontend -///This class need to exist because template classes can't have signals ans -///slots because Qt MOC generator can't guess the type at precompilation +///@class CallModelBase Base class for the central model/frontend +///This class need to exist because template classes can't have signals and +///slots because Qt MOC generator can't guess the type at precompilation class LIB_EXPORT CallModelBase : public QObject { Q_OBJECT diff --git a/kde/src/lib/CallModel.hpp b/kde/src/lib/CallModel.hpp index dc2973ec62f22aa6faeced08476f9596be68225f..cff7ce9808ea661e696bac41aa5885e1b15e86b6 100644 --- a/kde/src/lib/CallModel.hpp +++ b/kde/src/lib/CallModel.hpp @@ -63,7 +63,7 @@ public: SortableCallSource(Call* call=0) : count(0),callInfo(call) {} uint count; Call* callInfo; - const bool operator<(SortableCallSource other) { + bool operator<(SortableCallSource other) { return (other.count > count); } }; @@ -436,7 +436,6 @@ template<typename CallWidget, typename Index> const QStringList CallModel<CallWi ///Return the history list template<typename CallWidget, typename Index> const CallMap& CallModel<CallWidget,Index>::getHistory() { - qDebug() << "Getting history" << m_sHistoryCalls.count(); return m_sHistoryCalls; } @@ -736,25 +735,26 @@ template<typename CallWidget, typename Index> CallWidget CallModel<CallWidget,In ///Common set of instruction shared by all gui updater template<typename CallWidget, typename Index> bool CallModel<CallWidget,Index>::updateCommon(Call* call) { - if (!m_sPrivateCallList_call[call]) { + if (!m_sPrivateCallList_call[call] && dynamic_cast<Call*>(call)) { m_sPrivateCallList_call [ call ] = new InternalStruct ; m_sPrivateCallList_call [ call ]->call_real = call ; m_sPrivateCallList_call [ call ]->conference = false ; m_sPrivateCallList_callId [ call->getCallId() ] = m_sPrivateCallList_call[call] ; } + else + return false; return true; } ///Update the widget associated with this call template<typename CallWidget, typename Index> bool CallModel<CallWidget,Index>::updateWidget (Call* call, CallWidget value ) { - updateCommon(call); + if (!updateCommon(call)) return false; m_sPrivateCallList_call[call]->call = value ; m_sPrivateCallList_widget[value] = m_sPrivateCallList_call[call] ; return true; } - ///Update the index associated with this call template<typename CallWidget, typename Index> bool CallModel<CallWidget,Index>::updateIndex (Call* call, Index value ) { diff --git a/kde/src/ui/SFLPhoneView_base.ui b/kde/src/ui/SFLPhoneView_base.ui index c56489472622fb9aa1d0e28be67e38a9afd14c00..9ad0c749aa5d497d20bc778661d2ba6dea781fe5 100755 --- a/kde/src/ui/SFLPhoneView_base.ui +++ b/kde/src/ui/SFLPhoneView_base.ui @@ -24,6 +24,33 @@ </property> </widget> </item> + <item> + <widget class="QWidget" name="m_pMessageBoxW" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="KLineEdit" name="m_pSendMessageLE"> + <property name="placeholderText"> + <string>Send text message</string> + </property> + <property name="showClearButton" stdset="0"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="m_pSendMessagePB"> + <property name="text"> + <string>Send</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> <item> <widget class="QWidget" name="widget_controls" native="true"> <property name="enabled"> @@ -163,6 +190,11 @@ </layout> </widget> <customwidgets> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> <customwidget> <class>Dialpad</class> <extends>QWidget</extends> diff --git a/kde/src/widgets/BookmarkDock.cpp b/kde/src/widgets/BookmarkDock.cpp index ad47e54580116707e42a2328b0b5540c5dc88e72..4b6722456b3dc4d9af6149ba02d805b1e34ee343 100644 --- a/kde/src/widgets/BookmarkDock.cpp +++ b/kde/src/widgets/BookmarkDock.cpp @@ -74,6 +74,8 @@ BookmarkDock::BookmarkDock(QWidget* parent) : QDockWidget(parent) m_pItemView = new CategorizedTreeWidget(this); m_pMostUsedCK = new QCheckBox(this); + m_pFilterLE->setPlaceholderText(i18n("Filter")); + m_pMostUsedCK->setChecked(ConfigurationSkeleton::displayContactCallHistory()); QWidget* mainWidget = new QWidget(this); diff --git a/kde/src/widgets/CallTreeItem.cpp b/kde/src/widgets/CallTreeItem.cpp index 712462ccdfcbf7d2a29361822186e5d63e457fcf..9ea46ccc42c5ec81f937287098a773adb8967a17 100644 --- a/kde/src/widgets/CallTreeItem.cpp +++ b/kde/src/widgets/CallTreeItem.cpp @@ -244,7 +244,7 @@ void CallTreeItem::updated() void CallTreeItem::dragEnterEvent ( QDragEnterEvent *e ) { kDebug() << "Drag enter"; - if (SFLPhone::model()->getIndex(this)->parent() && + if (SFLPhone::model()->getIndex(this) && SFLPhone::model()->getIndex(this)->parent() && SFLPhone::model()->getIndex(e->mimeData()->data( MIME_CALLID))->parent() && SFLPhone::model()->getIndex(this)->parent() == SFLPhone::model()->getIndex(e->mimeData()->data( MIME_CALLID))->parent() && e->mimeData()->data( MIME_CALLID) != SFLPhone::model()->getCall(this)->getCallId()) { @@ -286,7 +286,7 @@ void CallTreeItem::dragLeaveEvent ( QDragLeaveEvent *e ) ///Something is being dropped void CallTreeItem::dropEvent(QDropEvent *e) { - kDebug() << "Drop accepted" << e->pos(); + kDebug() << "Drop accepted"; QTimer::singleShot(500, this, SLOT(hide())); m_isHover = false; if (e->pos().x() < rect().width()/2) { @@ -330,4 +330,4 @@ void CallTreeItem::hide() m_pBtnConf->setVisible(false); m_pBtnTrans->setVisible(false); } -} \ No newline at end of file +} diff --git a/kde/src/widgets/ContactDock.cpp b/kde/src/widgets/ContactDock.cpp index 42b9c5c5f29d6c70109ffe0b9babb02217a15170..6003df1fed88ff9f63e1ec7902ea585c9a741bd7 100644 --- a/kde/src/widgets/ContactDock.cpp +++ b/kde/src/widgets/ContactDock.cpp @@ -195,7 +195,7 @@ void ContactDock::reloadContact() } foreach (Contact* cont, list) { - if (cont->getPhoneNumbers().count()) { + if (cont->getPhoneNumbers().count() && usableNumberCount(cont)) { ContactItemWidget* aContact = new ContactItemWidget(m_pContactView); QString category; switch (CURRENT_SORTING_MODE) { @@ -374,7 +374,7 @@ void ContactDock::keyPressEvent(QKeyEvent* event) { if (m_pContactView->selectedItems()[0] && m_pContactView->itemWidget(m_pContactView->selectedItems()[0],0)) { QNumericTreeWidgetItem_hist* item = dynamic_cast<QNumericTreeWidgetItem_hist*>(m_pContactView->selectedItems()[0]); if (item) { - Call* call; + Call* call = NULL; SFLPhone::app()->view()->selectCallPhoneNumber(call,item->widget->getContact()); } } @@ -390,3 +390,13 @@ void ContactDock::keyPressEvent(QKeyEvent* event) { * Helpers * * * ****************************************************************************/ + +int ContactDock::usableNumberCount(Contact* cont) +{ + uint result =0; + QStringList list = ConfigurationSkeleton::phoneTypeList(); + foreach (Contact::PhoneNumber* pn,cont->getPhoneNumbers()) { + result += list.indexOf(pn->getType()) != -1; + } + return result; +} diff --git a/kde/src/widgets/ContactDock.h b/kde/src/widgets/ContactDock.h index da1ebbcb8cd17d54be2131bace4fab55ad22edce..06dbe812456297cff4f258a6c7284ebf9178caa9 100644 --- a/kde/src/widgets/ContactDock.h +++ b/kde/src/widgets/ContactDock.h @@ -75,6 +75,9 @@ private: QCheckBox* m_pShowHistoCK; QList<ContactItemWidget*> m_Contacts; + //Helpers + int usableNumberCount(Contact* cont); + public slots: virtual void keyPressEvent(QKeyEvent* event); diff --git a/kde/src/widgets/HistoryDock.cpp b/kde/src/widgets/HistoryDock.cpp index 4806ba27c58d19a7fd6a39fb80a2eba3dedcaa84..8202c3405e8a9afa412a80f3317e05d0d743cacf 100644 --- a/kde/src/widgets/HistoryDock.cpp +++ b/kde/src/widgets/HistoryDock.cpp @@ -289,7 +289,7 @@ void HistoryDock::reload() //Align all durationwidget foreach(HistoryTreeItem* item, m_History) { - maxWidth = (item->getDurWidth() > maxWidth)?item->getDurWidth():maxWidth; + maxWidth = ((uint)item->getDurWidth() > (uint)maxWidth)?item->getDurWidth():maxWidth; } foreach(HistoryTreeItem* item, m_History) { item->setDurWidth(maxWidth); diff --git a/kde/src/widgets/HistoryTreeItem.cpp b/kde/src/widgets/HistoryTreeItem.cpp index 6a90792f15473e8b190f5fde34301a3047479bd0..74f54d9f8344ff22bbe4500bbd4089decbe8ea8b 100644 --- a/kde/src/widgets/HistoryTreeItem.cpp +++ b/kde/src/widgets/HistoryTreeItem.cpp @@ -426,11 +426,12 @@ void HistoryTreeItem::stateChanged(Phonon::State newState, Phonon::State /* oldS ///Reference code for metastate change void HistoryTreeItem::metaStateChanged(Phonon::State newState, Phonon::State oldState) { + Q_UNUSED(oldState); if (newState == Phonon::ErrorState) { QMessageBox::warning(this, tr("Error opening files"), m_pMetaInformationResolver->errorString()); while (!m_lSources.isEmpty() && - !(m_lSources.takeLast() == m_pMetaInformationResolver->currentSource())) {} /* loop */; + !(m_lSources.takeLast() == m_pMetaInformationResolver->currentSource())) {} /* loop */; return; } @@ -454,6 +455,7 @@ void HistoryTreeItem::metaStateChanged(Phonon::State newState, Phonon::State old ///Resize the player void HistoryTreeItem::resizeEvent(QResizeEvent* event) { + Q_UNUSED(event); if (m_pPlayer) { m_pPlayer->setMinimumSize(width(),height()); m_pPlayer->setMaximumSize(width(),height());