Commit 24c90366 authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

[ #13801 ] Fix about 200 Krazy2 notification/warning/comments

parent 3a099cd3
......@@ -229,7 +229,7 @@ bool ManagerImpl::outgoingCall(const std::string& account_id,
if (hasCurrentCall()) {
DEBUG("Has current call (%s) put it onhold", current_call_id.c_str());
// if this is not a conferenceand this and is not a conference participant
// if this is not a conference and this and is not a conference participant
if (not isConference(current_call_id) and not isConferenceParticipant(current_call_id))
onHoldCall(current_call_id);
else if (isConference(current_call_id) and not isConferenceParticipant(call_id))
......@@ -474,12 +474,12 @@ void ManagerImpl::offHoldCall(const std::string& callId)
std::string currentCallId(getCurrentCallId());
//Place current call on hold if it isn't
if (hasCurrentCall()) {
if (not isConference(currentCallId) and not isConferenceParticipant(currentCallId)) {
if (not currentCallId.empty() and not isConference(currentCallId) and not isConferenceParticipant(currentCallId)) {
DEBUG("Has current call (%s), put on hold", currentCallId.c_str());
onHoldCall(currentCallId);
} else if (isConference(currentCallId) && callId != currentCallId) {
holdConference(currentCallId);
} else if (isConference(currentCallId) and not isConferenceParticipant(callId))
detachParticipant(MainBuffer::DEFAULT_ID, currentCallId);
}
......
......@@ -18,6 +18,7 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
**************************************************************************/
#include "AccountWizard.h"
//Unix
#include <unistd.h>
......@@ -36,7 +37,6 @@
#include <KDebug>
//SFLphone
#include "AccountWizard.h"
#include "lib/sflphone_const.h"
#include "lib/configurationmanager_interface_singleton.h"
......@@ -153,7 +153,7 @@ rest_account get_rest_account(QString host, QString email)
kDebug() << "HOST: " << host;
int res = sendRequest(host, 80, req, ret);
if (res != -1) {
QStringList list = ret.split("\n");
QStringList list = ret.split('\n');
ra.user = list[0];
ra.passwd = list[1];\
ra.success = true;
......@@ -240,8 +240,8 @@ void AccountWizard::accept()
rest_account acc = get_rest_account(SFL_ACCOUNT_HOST, charEmailAddress);
if(acc.success) {
ret += i18n("This assistant is now finished.") + "\n";
field( FIELD_SIP_ALIAS ) = QString( acc.user) + "@" + SFL_ACCOUNT_HOST;
ret += i18n("This assistant is now finished.") + '\n';
field( FIELD_SIP_ALIAS ) = QString( acc.user) + '@' + SFL_ACCOUNT_HOST;
field( FIELD_SIP_VOICEMAIL ) = QString( );
field( FIELD_SIP_SERVER ) = QString( SFL_ACCOUNT_HOST );
field( FIELD_SIP_PASSWORD ) = QString( acc.passwd );
......@@ -262,7 +262,7 @@ void AccountWizard::accept()
}
}
else if(field(FIELD_SIP_ACCOUNT).toBool()) { //sip
ret += i18n("This assistant is now finished.") + "\n";
ret += i18n("This assistant is now finished.") + '\n';
alias = field ( FIELD_SIP_ALIAS ).toString();
enabled = QString ( REGISTRATION_ENABLED_TRUE ) ;
......@@ -277,7 +277,7 @@ void AccountWizard::accept()
}
else { // iax
ret += i18n("This assistant is now finished.") + "\n";
ret += i18n("This assistant is now finished.") + '\n';
alias = field ( FIELD_IAX_ALIAS ).toString();
enabled = QString ( REGISTRATION_ENABLED_TRUE ) ;
......@@ -317,12 +317,12 @@ void AccountWizard::accept()
locale_interface = ifaceList.at(0);
published_address = ifaceList.at(0);
ret += i18n( "Alias" ) + " : " + alias + "\n";
ret += i18n( "Server" ) + " : " + server + "\n";
ret += i18n( "Username" ) + " : " + user + "\n";
ret += i18n( "Password" ) + " : " + password + "\n";
ret += i18n( "Protocol" ) + " : " + protocol + "\n";
ret += i18n( "Voicemail number" ) + " : " + mailbox + "\n";
ret += i18n( "Alias" ) + " : " + alias + '\n';
ret += i18n( "Server" ) + " : " + server + '\n';
ret += i18n( "Password" ) + " : " + password + '\n';
ret += i18n( "Protocol" ) + " : " + protocol + '\n';
ret += i18n( "Voicemail number" ) + " : " + mailbox + '\n';
ret += i18nc( "SIP Account username","Username" ) + " : " + user + '\n';
}
if(is_create_account) {
......@@ -507,10 +507,10 @@ WizardAccountSIPFormPage::WizardAccountSIPFormPage(QWidget *parent)
label_alias = new QLabel( i18n( "Alias" ) + " *" );
label_server = new QLabel( i18n( "Server" ) + " *" );
label_user = new QLabel( i18n( "Username" ) + " *" );
label_password = new QLabel( i18n( "Password" ) + " *" );
label_voicemail = new QLabel( i18n( "Voicemail number" ) );
label_enableZrtp = new QLabel( i18n( "Secure with ZRTP" ) );
label_user = new QLabel( i18nc( "SIP Account Username","Username") + " *" );
lineEdit_alias = new QLineEdit;
lineEdit_server = new QLineEdit;
......@@ -521,10 +521,10 @@ WizardAccountSIPFormPage::WizardAccountSIPFormPage(QWidget *parent)
lineEdit_password->setEchoMode(QLineEdit::Password);
registerField(QString( FIELD_SIP_ALIAS) + "*" , lineEdit_alias );
registerField(QString( FIELD_SIP_SERVER) + "*" , lineEdit_server );
registerField(QString( FIELD_SIP_USER) + "*" , lineEdit_user );
registerField(QString( FIELD_SIP_PASSWORD) + "*" , lineEdit_password );
registerField(QString( FIELD_SIP_ALIAS) + '*' , lineEdit_alias );
registerField(QString( FIELD_SIP_SERVER) + '*' , lineEdit_server );
registerField(QString( FIELD_SIP_USER) + '*' , lineEdit_user );
registerField(QString( FIELD_SIP_PASSWORD) + '*' , lineEdit_password );
registerField(QString( FIELD_SIP_VOICEMAIL) , lineEdit_voicemail );
registerField(QString( FIELD_ZRTP_ENABLED) , checkBox_enableZrtp );
......@@ -582,9 +582,9 @@ WizardAccountIAXFormPage::WizardAccountIAXFormPage(QWidget *parent)
label_alias = new QLabel(i18n("Alias") + " *" );
label_server = new QLabel(i18n("Server") + " *" );
label_user = new QLabel(i18n("Username") + " *" );
label_password = new QLabel(i18n("Password") + " *" );
label_voicemail = new QLabel(i18n("Voicemail number" ));
label_user = new QLabel(i18nc("SIP Account Username","Username") + " *" );
lineEdit_alias = new QLineEdit;
lineEdit_server = new QLineEdit;
......@@ -594,10 +594,10 @@ WizardAccountIAXFormPage::WizardAccountIAXFormPage(QWidget *parent)
lineEdit_password->setEchoMode(QLineEdit::Password);
registerField( QString( FIELD_IAX_ALIAS ) + "*", lineEdit_alias );
registerField( QString( FIELD_IAX_SERVER ) + "*", lineEdit_server );
registerField( QString( FIELD_IAX_USER ) + "*", lineEdit_user );
registerField( QString( FIELD_IAX_PASSWORD ) + "*", lineEdit_password );
registerField( QString( FIELD_IAX_ALIAS ) + '*', lineEdit_alias );
registerField( QString( FIELD_IAX_SERVER ) + '*', lineEdit_server );
registerField( QString( FIELD_IAX_USER ) + '*', lineEdit_user );
registerField( QString( FIELD_IAX_PASSWORD ) + '*', lineEdit_password );
registerField( QString( FIELD_IAX_VOICEMAIL ) , lineEdit_voicemail );
QFormLayout *layout = new QFormLayout;
......
......@@ -35,7 +35,7 @@ private:
Account* account;
public:
ActionSetAccountFirst(Account * account, QObject *parent = 0);
explicit ActionSetAccountFirst(Account * account, QObject *parent = 0);
~ActionSetAccountFirst();
private slots:
......
......@@ -107,3 +107,4 @@ INSTALL( FILES icons/transfertarrow.svg DESTINATION ${DATA_INSTALL_DIR}/sflpho
INSTALL( FILES icons/confBlackWhite.svg DESTINATION ${DATA_INSTALL_DIR}/sflphone-client-kde )
INSTALL( FILES icons/confBlackWhite.png DESTINATION ${DATA_INSTALL_DIR}/sflphone-client-kde )
INSTALL( FILES icons/voicemail.png DESTINATION ${DATA_INSTALL_DIR}/sflphone-client-kde )
INSTALL( FILES icons/conf-small.png DESTINATION ${DATA_INSTALL_DIR}/sflphone-client-kde )
......@@ -163,6 +163,7 @@ CallTreeItemDelegate(CallView* widget)
if (option.state & QStyle::State_Selected) {
QStyleOptionViewItem opt2(option);
opt2.rect.setWidth(opt2.rect.width()-15);
//Check if it is the last item
if (index.parent().isValid() && !index.parent().child(index.row()+1,0).isValid()) {
opt2.rect.setHeight(opt2.rect.height()-15);
QStyledItemDelegate::paint(painter,opt2,index);
......@@ -410,7 +411,7 @@ bool CallView::phoneNumberToCall(QTreeWidgetItem *parent, int index, const QMime
if (!QString(encodedPhoneNumber).isEmpty()) {
Contact* contact = AkonadiBackend::getInstance()->getContactByPhone(encodedPhoneNumber,true);
QString name;
name = (contact)?contact->getFormattedName():i18n("Unknown");
name = (contact)?contact->getFormattedName():i18nc("Unknown peer","Unknown");
Call* call2 = SFLPhone::model()->addDialingCall(name, AccountList::getCurrentAccount());
if (call2) {
call2->appendText(QString(encodedPhoneNumber));
......@@ -528,10 +529,10 @@ QMimeData* CallView::mimeData( const QList<QTreeWidgetItem *> items) const
}
//Plain text for other applications
mimeData->setData(MIME_PLAIN_TEXT, QString(SFLPhone::model()->getCall(items[0])->getPeerName()+"\n"+SFLPhone::model()->getCall(items[0])->getPeerPhoneNumber()).toAscii());
mimeData->setData(MIME_PLAIN_TEXT, QString(SFLPhone::model()->getCall(items[0])->getPeerName()+'\n'+SFLPhone::model()->getCall(items[0])->getPeerPhoneNumber()).toAscii());
//TODO Comment this line if you don't want to see ugly artefact, but the caller details will not be visible while dragged
items[0]->setText(0, SFLPhone::model()->getCall(items[0])->getPeerName() + "\n" + SFLPhone::model()->getCall(items[0])->getPeerPhoneNumber());
items[0]->setText(0, SFLPhone::model()->getCall(items[0])->getPeerName() + '\n' + SFLPhone::model()->getCall(items[0])->getPeerPhoneNumber());
return mimeData;
} //mimeData
......@@ -806,9 +807,9 @@ Call* CallView::addConference(Call* conf)
setCurrentItem(confItem);
CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance();
QStringList callList = callManager.getParticipantList(conf->getConfId());
const QStringList callList = callManager.getParticipantList(conf->getConfId());
foreach (QString callId, callList) {
foreach (const QString& callId, callList) {
kDebug() << "Adding " << callId << "to the conversation";
insertItem(extractItem(SFLPhone::model()->getIndex(callId)),confItem);
}
......@@ -823,10 +824,10 @@ bool CallView::conferenceChanged(Call* conf)
kDebug() << "Conference changed";
CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance();
QStringList callList = callManager.getParticipantList(conf->getConfId());
const QStringList callList = callManager.getParticipantList(conf->getConfId());
QList<QTreeWidgetItem*> buffer;
foreach (QString callId, callList) {
foreach (const QString& callId, callList) {
if (SFLPhone::model()->getCall(callId)) {
QTreeWidgetItem* item3 = extractItem(SFLPhone::model()->getIndex(callId));
insertItem(item3, SFLPhone::model()->getIndex(conf));
......@@ -973,3 +974,4 @@ void CallViewOverlay::setAccessMessage(QString message)
{
m_accessMessage = message;
}
......@@ -59,9 +59,9 @@ SFLPhoneAccessibility* SFLPhoneAccessibility::getInstance()
void SFLPhoneAccessibility::listCall()
{
if (SFLPhone::model()->getCallList().size()>0) {
KSpeechInterfaceSingleton::getInstance()->say(i18n("You currently have %1 calls").arg(QString::number(SFLPhone::model()->getCallList().size())), KSpeech::soPlainText);
KSpeechInterfaceSingleton::getInstance()->say(i18n("You currently have <numid>%1</numid> calls",SFLPhone::model()->getCallList().size()), KSpeech::soPlainText);
foreach (Call* call,SFLPhone::model()->getCallList()) {
KSpeechInterfaceSingleton::getInstance()->say(i18n("Call from %1, number %2").arg(call->getPeerName()).arg(numberToDigit((!call->getPeerPhoneNumber().isEmpty())?call->getPeerPhoneNumber():call->getCallNumber())), KSpeech::soPlainText);
KSpeechInterfaceSingleton::getInstance()->say(i18n("Call from %1, number %2",call->getPeerName(),numberToDigit((!call->getPeerPhoneNumber().isEmpty())?call->getPeerPhoneNumber():call->getCallNumber())), KSpeech::soPlainText);
}
}
else {
......@@ -75,7 +75,7 @@ QString SFLPhoneAccessibility::numberToDigit(QString number)
QString toReturn;
for(int i=0;i<number.count();i++) {
if (i+1 < number.count() && (number[i] >= 0x30 && number[i] <= 0x39) && (number[i+1] >= 0x30 && number[i+1] <= 0x39))
toReturn += number[i]+" ";
toReturn += QString(number[i])+' ';
else
toReturn += number[i];
}
......@@ -87,17 +87,17 @@ void SFLPhoneAccessibility::currentCallDetails()
{
foreach (Call* call,SFLPhone::model()->getCallList()) {
if (call->isSelected()) {
QString toSay = i18n("The current call is %1").arg( i18n(call->toHumanStateName().toAscii() ));
QString toSay = i18n("The current call is %1",i18n(call->toHumanStateName().toAscii() ));
if (!call->getPeerName().trimmed().isEmpty())
toSay += i18n(",Your peer is %1").arg( numberToDigit(call->getPeerName()) );
toSay += i18n(",Your peer is %1",numberToDigit(call->getPeerName()));
if (!call->getPeerPhoneNumber().isEmpty())
toSay += i18n(", the peer phone number is %1 ").arg( numberToDigit(call->getPeerPhoneNumber()) );
toSay += i18n(", the peer phone number is %1 ",numberToDigit(call->getPeerPhoneNumber()) );
else if (!call->getCallNumber().isEmpty())
toSay += i18n(", the phone number is %1 ").arg( numberToDigit(call->getCallNumber()) );
toSay += i18n(", the phone number is %1 ",numberToDigit(call->getCallNumber()));
int nSec = QDateTime::fromTime_t(call->getStartTimeStamp().toInt()).time().secsTo( QTime::currentTime() );
if (nSec>0)
toSay += i18n(" and you have been talking since %1 seconds").arg( nSec );
toSay += i18n(" and you have been talking since %1 seconds",nSec );
KSpeechInterfaceSingleton::getInstance()->say(toSay, KSpeech::soPlainText);
}
......
......@@ -348,8 +348,8 @@ bool SFLPhoneView::selectCallPhoneNumber(Call** call2,Contact* contact)
QHash<QString,QString> map ;
QStringList list ;
foreach (Contact::PhoneNumber* number, contact->getPhoneNumbers()) {
map[number->getType()+" ("+number->getNumber()+")"] = number->getNumber();
list << number->getType()+" ("+number->getNumber()+")";
map[number->getType()+" ("+number->getNumber()+')'] = number->getNumber();
list << number->getType()+" ("+number->getNumber()+')';
}
QString result = QInputDialog::getItem (this, i18n("Select phone number"), i18n("This contact have many phone number, please select the one you wish to call"), list, 0, false, &ok);
if (ok) {
......@@ -595,7 +595,7 @@ void SFLPhoneView::updateStatusMessage()
else {
emit statusMessageChangeAsked(i18n("Using account")
+ " \'" + account->getAlias()
+ "\' (" + account->getAccountRegistrationStatus() + ")");
+ "\' (" + account->getAccountRegistrationStatus() + ')');
}
}
......
......@@ -207,8 +207,6 @@ signals:
void recordCheckStateChangeAsked ( bool recordCheckState );
///When a new call is comming
void incomingCall(const Call * call);
};
#endif // SFLPHONEVIEW_H
......@@ -84,8 +84,6 @@ void SFLPhoneApplication::initializeMainWindow()
}
}
/**
* Initialize additional paths
*/
......
......@@ -53,16 +53,16 @@ ConfigurationDialog::ConfigurationDialog(SFLPhoneView *parent)
dlgVideo = new DlgVideo (this);
#endif
addPage( dlgGeneral , i18n("General") , "sflphone-client-kde" );
addPage( dlgDisplay , i18n("Display") , "applications-graphics" );
addPage( dlgGeneral , i18nc("General settings","General") , "sflphone-client-kde" );
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" );
#ifdef ENABLE_VIDEO
addPage( dlgVideo , i18n("Video") , "camera-web" );
addPage( dlgVideo , i18nc("Video conversation","Video") , "camera-web" );
#endif
addPage( dlgDisplay , i18nc("User interterface settings","Display") , "applications-graphics" );
connect(this, SIGNAL(applyClicked()), this, SLOT(applyCustomSettings()));
connect(this, SIGNAL(okClicked()), this, SLOT(applyCustomSettings()));
......
......@@ -30,5 +30,3 @@ DlgDisplay::DlgDisplay(QWidget *parent)
DlgDisplay::~DlgDisplay()
{
}
......@@ -38,6 +38,9 @@
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QCheckBox" name="kcfg_notifOnCalls">
<property name="accessibleDescription">
<string comment="Enable notification on incoming calls"/>
</property>
<property name="text">
<string>On incoming calls</string>
</property>
......@@ -45,6 +48,9 @@
</item>
<item>
<widget class="QCheckBox" name="kcfg_notifOnMessages">
<property name="accessibleDescription">
<string comment="Enable notifications on messages"/>
</property>
<property name="text">
<string>On messages</string>
</property>
......@@ -77,6 +83,9 @@
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QCheckBox" name="kcfg_displayOnStart">
<property name="accessibleDescription">
<string comment="Show main window on start"/>
</property>
<property name="text">
<string>On start</string>
</property>
......@@ -84,6 +93,9 @@
</item>
<item>
<widget class="QCheckBox" name="kcfg_displayOnCalls">
<property name="accessibleDescription">
<string comment="Show main window on incoming calls"/>
</property>
<property name="text">
<string>On incoming calls</string>
</property>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment