diff --git a/lang/fr/sflphone.po b/lang/fr/sflphone.po index f9c4a48f2039337a7fc551b6dffd265b50e033ba..5c5f5c97ffcdecd429297cd9d7c3463869d0838d 100644 --- a/lang/fr/sflphone.po +++ b/lang/fr/sflphone.po @@ -550,11 +550,11 @@ msgstr "" #: ../sflphone-client-kde/build/src/ui_dlgaccountsbase.h:417 msgid "Registration expire" -msgstr "Enregistré" +msgstr "Expiration d'enregistrement" #: ../sflphone-client-kde/build/src/ui_dlgaccountsbase.h:418 msgid "Conform to RFC 3263" -msgstr "" +msgstr "Respecter RFC 3263" #: ../sflphone-client-kde/build/src/ui_dlgaccountsbase.h:419 msgid "Advanced" diff --git a/sflphone-client-kde/src/conf/ConfigurationSkeleton.cpp b/sflphone-client-kde/src/conf/ConfigurationSkeleton.cpp index 40365957d6c92e4f3007744707486f528e7bedad..f2bcf04b8b75eb3dbe8eb9879187df0cf2c2807d 100644 --- a/sflphone-client-kde/src/conf/ConfigurationSkeleton.cpp +++ b/sflphone-client-kde/src/conf/ConfigurationSkeleton.cpp @@ -28,7 +28,6 @@ ConfigurationSkeleton::ConfigurationSkeleton() { qDebug() << "Building ConfigurationSkeleton"; codecListModel = new CodecListModel(); - accountListModel = new AccountListModel(); readConfig(); } @@ -57,7 +56,6 @@ void ConfigurationSkeleton::readConfig() ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); -// qDebug() << "configurationManager.getAudioManager4() = " << configurationManager.getAudioManager(); //////////////////////// ////General settings//// //////////////////////// @@ -206,13 +204,13 @@ void ConfigurationSkeleton::writeConfig() qDebug() << "Writing Display settings"; //Notification settings -// if(notifOnCalls() != configurationManager.getNotify()) configurationManager.setNotify(); -// if(notifOnMessages() != configurationManager.getMailNotify()) configurationManager.setMailNotify(); + if(notifOnCalls() != configurationManager.getNotify()) configurationManager.setNotify(); + if(notifOnMessages() != configurationManager.getMailNotify()) configurationManager.setMailNotify(); //Window display settings //WARNING états inversés -// if(displayOnStart() == configurationManager.isStartHidden()) configurationManager.startHidden(); -// if(displayOnCalls() != configurationManager.popupMode()) configurationManager.switchPopupMode(); + if(displayOnStart() == configurationManager.isStartHidden()) configurationManager.startHidden(); + if(displayOnCalls() != configurationManager.popupMode()) configurationManager.switchPopupMode(); ///////////////////////// ////Accounts settings//// @@ -224,8 +222,8 @@ void ConfigurationSkeleton::writeConfig() //Stun settings -// if(enableStun() != configurationManager.isStunEnabled()) configurationManager.enableStun(); -// configurationManager.setStunServer(stunServer()); + if(enableStun() != configurationManager.isStunEnabled()) configurationManager.enableStun(); + configurationManager.setStunServer(stunServer()); ////////////////////// ////Audio settings//// diff --git a/sflphone-client-kde/src/conf/ConfigurationSkeleton.h b/sflphone-client-kde/src/conf/ConfigurationSkeleton.h index 05f20e579ad11bb14b99a4344342d8cda330f248..666173a93d3fb492b737976eaa77c8883ee2cb7e 100644 --- a/sflphone-client-kde/src/conf/ConfigurationSkeleton.h +++ b/sflphone-client-kde/src/conf/ConfigurationSkeleton.h @@ -46,16 +46,20 @@ private: static ConfigurationSkeleton * instance; CodecListModel * codecListModel; - - AccountListModel * accountListModel; public: ConfigurationSkeleton(); ~ConfigurationSkeleton(); + /** + * @copydoc KCoreConfigSkeleton::readConfig() + */ virtual void readConfig(); + /** + * @copydoc KCoreConfigSkeleton::writeConfig() + */ virtual void writeConfig(); diff --git a/sflphone-client-kde/src/conf/dlgaccounts.cpp b/sflphone-client-kde/src/conf/dlgaccounts.cpp index b10e635ff461b408b494ba37c03d95ce51444236..3d91e82d07cdacc41f2f44157223cd069ecf2439 100644 --- a/sflphone-client-kde/src/conf/dlgaccounts.cpp +++ b/sflphone-client-kde/src/conf/dlgaccounts.cpp @@ -181,8 +181,9 @@ void DlgAccounts::loadAccount(QListWidgetItem * item) edit5_password->setText( account->getAccountDetail(ACCOUNT_PASSWORD)); edit6_mailbox->setText( account->getAccountDetail(ACCOUNT_MAILBOX)); checkBox_conformRFC->setChecked( account->getAccountDetail(ACCOUNT_RESOLVE_ONCE) != "TRUE" ); - int val = account->getAccountDetail(ACCOUNT_EXPIRE).toInt(); - spinbox_regExpire->setValue(val); + bool ok; + int val = account->getAccountDetail(ACCOUNT_EXPIRE).toInt(ok); + spinbox_regExpire->setValue(ok ? val : ACCOUNT_EXPIRE_DEFAULT); updateStatusLabel(account); frame2_editAccounts->setEnabled(true); } @@ -358,6 +359,7 @@ bool DlgAccounts::hasChanged() void DlgAccounts::updateSettings() { + qDebug() << "DlgAccounts::updateSettings"; if(accountListHasChanged) { saveAccountList(); @@ -369,11 +371,8 @@ void DlgAccounts::updateSettings() void DlgAccounts::updateWidgets() { qDebug() << "DlgAccounts::updateWidgets"; - if(accountListHasChanged) - { - loadAccountList(); - toolButton_accountsApply->setEnabled(false); - accountListHasChanged = false; - } + loadAccountList(); + toolButton_accountsApply->setEnabled(false); + accountListHasChanged = false; } diff --git a/sflphone-client-kde/src/conf/dlgaccounts.h b/sflphone-client-kde/src/conf/dlgaccounts.h index cd1a607e743073538e79b12af061d4d0247ae248..a0456b3bb402f421c9c5aa62d54f6c7d85aaca1b 100644 --- a/sflphone-client-kde/src/conf/dlgaccounts.h +++ b/sflphone-client-kde/src/conf/dlgaccounts.h @@ -38,6 +38,19 @@ public: DlgAccounts(KConfigDialog *parent = 0); void saveAccount(QListWidgetItem * item); + /** + * Fills the settings form in the right side with the + * settings of @p item. + * + * \note When the user creates a new account, its accountDetails + * map is empty, so the form is filled with blank strings, + * zeros... And when the user clicks \e Apply , these settings are + * saved just after the account is created. So be careful the form + * is filled with the right default settings if blank (as 600 for + * registration expire). + * + * @param item + */ void loadAccount(QListWidgetItem * item); private: diff --git a/sflphone-client-kde/src/conf/dlgaccountsbase.ui b/sflphone-client-kde/src/conf/dlgaccountsbase.ui index ad48d274db74d1fd0ef9056d7896a8b64180630c..eafe181482ff650951b73e6f5f9ab1781cf4c1b8 100644 --- a/sflphone-client-kde/src/conf/dlgaccountsbase.ui +++ b/sflphone-client-kde/src/conf/dlgaccountsbase.ui @@ -496,7 +496,7 @@ <connections> <connection> <sender>kcfg_enableStun</sender> - <signal>clicked(bool)</signal> + <signal>toggled(bool)</signal> <receiver>kcfg_stunServer</receiver> <slot>setEnabled(bool)</slot> <hints> diff --git a/sflphone-client-kde/src/conf/dlgaudio.cpp b/sflphone-client-kde/src/conf/dlgaudio.cpp index 68f669c88c203d29743f6ab6f10df897afb8f243..5d15f69406127b158896edb97f8a3cca9d08a880 100644 --- a/sflphone-client-kde/src/conf/dlgaudio.cpp +++ b/sflphone-client-kde/src/conf/dlgaudio.cpp @@ -62,8 +62,6 @@ DlgAudio::~DlgAudio() void DlgAudio::updateWidgets() { - ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self(); -// box_alsaPlugin->setCurrentIndex(box_alsaPlugin->findText(skeleton->alsaPlugin())); loadAlsaSettings(); codecTableHasChanged = false; @@ -84,12 +82,9 @@ bool DlgAudio::hasChanged() { qDebug() << "DlgAudio::hasChanged"; ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self(); - qDebug() << "skeleton->alsaPlugin() = " << skeleton->alsaPlugin(); - qDebug() << "box_alsaPlugin->currentText() = " << box_alsaPlugin->currentText(); bool alsaPluginHasChanged = skeleton->interface() == ConfigurationSkeleton::EnumInterface::ALSA && skeleton->alsaPlugin() != box_alsaPlugin->currentText(); - qDebug() << "DlgAudio::hasChanged" << alsaPluginHasChanged << codecTableHasChanged; return alsaPluginHasChanged || codecTableHasChanged; } diff --git a/sflphone-client-kde/src/sflphone_const.h b/sflphone-client-kde/src/sflphone_const.h index b2408e25553182f993323f4436dc8c013689369e..356a2e5755c5300b06bc4707172f84fe09daa9b8 100644 --- a/sflphone-client-kde/src/sflphone_const.h +++ b/sflphone-client-kde/src/sflphone_const.h @@ -121,6 +121,7 @@ #define ACCOUNT_STATUS "Status" #define ACCOUNT_SIP_STUN_SERVER "STUN.server" #define ACCOUNT_SIP_STUN_ENABLED "STUN.enable" +#define ACCOUNT_EXPIRE_DEFAULT 600 #define ACCOUNT_ENABLED_TRUE "TRUE" #define ACCOUNT_ENABLED_FALSE "FALSE" diff --git a/sflphone-common/src/dbus/configurationmanager.cpp b/sflphone-common/src/dbus/configurationmanager.cpp index c9dfc7d52959332e208fcf41ef16bc1672366611..7afc9cb250eacae12e0490b5145f1eeae9aec89e 100644 --- a/sflphone-common/src/dbus/configurationmanager.cpp +++ b/sflphone-common/src/dbus/configurationmanager.cpp @@ -78,7 +78,7 @@ ConfigurationManager::getAccountList() return Manager::instance().getAccountList(); } - +//TODO std::vector< std::string > ConfigurationManager::getToneLocaleList() { @@ -87,18 +87,16 @@ ConfigurationManager::getToneLocaleList() return ret; } - - +//TODO std::string ConfigurationManager::getVersion() { std::string ret (""); _debug ("ConfigurationManager::getVersion received\n"); return ret; - } - +//TODO std::vector< std::string > ConfigurationManager::getRingtoneList() { @@ -112,14 +110,14 @@ ConfigurationManager::getRingtoneList() std::vector< std::string > ConfigurationManager::getCodecList() { - _debug ("ConfigurationManager::getRingtoneList received\n"); + _debug ("ConfigurationManager::getCodecList received\n"); return Manager::instance().getCodecList(); } std::vector< std::string > ConfigurationManager::getCodecDetails (const int32_t& payload) { - _debug ("ConfigurationManager::getRingtoneList received\n"); + _debug ("ConfigurationManager::getCodecDetails received\n"); return Manager::instance().getCodecDetails (payload); } diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 0ca48a06ce1fda0cdcffed2c83929781e5c24adf..c539c3cec379e87d72bba9d2593ed1c351b77cc4 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -2205,10 +2205,12 @@ void ManagerImpl::setMicVolume (unsigned short mic_vol) void ManagerImpl::setSipPort (int port) { - _debug ("Setting to new port %d\n", port); - setConfig (PREFERENCES, CONFIG_SIP_PORT, port); - - this->restartPJSIP (); + _debug("Setting to new port %d\n", port); + int prevPort = getConfigInt (PREFERENCES , CONFIG_SIP_PORT); + if(prevPort != port){ + setConfig(PREFERENCES, CONFIG_SIP_PORT, port); + this->restartPJSIP (); + } } int ManagerImpl::getSipPort (void) @@ -2439,7 +2441,12 @@ std::map< std::string, std::string > ManagerImpl::getAccountDetails (const Accou std::string accountType; RegistrationState state; - state = _accountMap[accountID]->getRegistrationState(); + Account * account = _accountMap[accountID]; + if(!account){ + _debug("getAccountDetails on unexisting account"); + return a; + } + state = account->getRegistrationState(); accountType = getConfigString (accountID, CONFIG_ACCOUNT_TYPE); a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ALIAS, getConfigString (accountID, CONFIG_ACCOUNT_ALIAS)));