Skip to content
Snippets Groups Projects
Commit c0f63483 authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

Less bugs, cleaner code, more little features

parent 6217daa9
Branches
Tags
No related merge requests found
Showing
with 385 additions and 206 deletions
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</Menu> </Menu>
</MenuBar> </MenuBar>
<ToolBar name="mainToolBar" position="Top" noMerge="1" fullWidth="true" newline="true" > <ToolBar name="mainToolBar" iconText="icononly" position="Top" noMerge="1" fullWidth="false" newline="true" >
<Action name="action_accept" /> <Action name="action_accept" />
<Action name="action_mailBox" /> <Action name="action_mailBox" />
<Action name="action_refuse" /> <Action name="action_refuse" />
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -160,7 +160,7 @@ Call::Call(QString confId, QString account) ...@@ -160,7 +160,7 @@ Call::Call(QString confId, QString account)
this->confId = confId; this->confId = confId;
this->account = account; this->account = account;
} }
#include <unistd.h>
Call * Call::buildExistingCall(QString callId) Call * Call::buildExistingCall(QString callId)
{ {
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
...@@ -712,3 +712,9 @@ QString Call::getConfId() const { ...@@ -712,3 +712,9 @@ QString Call::getConfId() const {
void Call::setConfId(QString value) { void Call::setConfId(QString value) {
confId = value; confId = value;
} }
QString Call::getCurrentCodecName() {
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
qDebug() << "Codec name: " << callManager.getCurrentCodecName(callId); sleep(5);
return callManager.getCurrentCodecName(callId);
}
\ No newline at end of file
...@@ -258,6 +258,7 @@ public: ...@@ -258,6 +258,7 @@ public:
bool isHistory() const; bool isHistory() const;
QString getStopTimeStamp() const; QString getStopTimeStamp() const;
QString getStartTimeStamp() const; QString getStartTimeStamp() const;
QString getCurrentCodecName();
bool isConference() const; bool isConference() const;
void setConference(bool value); void setConference(bool value);
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
This diff is collapsed.
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
/** Note from the author: It was previously done by a QAbstractModel + QTreeView, but the sip-call use case is incompatible /** Note from the author: It was previously done by a QAbstractModel + QTreeView, but the sip-call use case is incompatible
* with the MVC model. The MVC never got to a point were it was bug-free and the code was getting dirty. The QTreeWidget * with the MVC model. The MVC never got to a point were it was bug-free and the code was getting dirty. The QTreeWidget
* solution may be less "clean" than MVC, but is 3 time smaller and easier to improve. * solution may be less "clean" than MVC, but is 3 time smaller and easier to improve (in fact, possible to improve).
* *
* This model is the view itself (private inheritance) so drag and drop can interact directly with the model without cross * This model is the view itself (private inheritance) so drag and drop can interact directly with the model without cross
* layer hack. This call merge the content of 4 previous classes (CallTreeModel, CallTreeView, CallList and most of the * layer hack. This call merge the content of 4 previous classes (CallTreeModel, CallTreeView, CallList and most of the
...@@ -91,6 +91,7 @@ class CallModel : private QTreeWidget { ...@@ -91,6 +91,7 @@ class CallModel : private QTreeWidget {
bool addParticipant(Call* call2, Call* conference); bool addParticipant(Call* call2, Call* conference);
bool detachParticipant(Call* call); bool detachParticipant(Call* call);
void conferenceChanged(const QString &confId, const QString &state); void conferenceChanged(const QString &confId, const QString &state);
void conferenceRemoved(const QString &confId);
MapStringString getHistoryMap(); MapStringString getHistoryMap();
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <klocale.h> #include <klocale.h>
#include <kdebug.h> #include <kdebug.h>
#include <unistd.h>
#include "sflphone_const.h" #include "sflphone_const.h"
#include "CallTreeItem.h" #include "CallTreeItem.h"
...@@ -32,7 +33,7 @@ ...@@ -32,7 +33,7 @@
const char * CallTreeItem::callStateIcons[12] = {ICON_INCOMING, ICON_RINGING, ICON_CURRENT, ICON_DIALING, ICON_HOLD, ICON_FAILURE, ICON_BUSY, ICON_TRANSFER, ICON_TRANSF_HOLD, "", "", ICON_CONFERENCE}; const char * CallTreeItem::callStateIcons[12] = {ICON_INCOMING, ICON_RINGING, ICON_CURRENT, ICON_DIALING, ICON_HOLD, ICON_FAILURE, ICON_BUSY, ICON_TRANSFER, ICON_TRANSF_HOLD, "", "", ICON_CONFERENCE};
CallTreeItem::CallTreeItem(QWidget *parent) CallTreeItem::CallTreeItem(QWidget *parent)
: itemCall(0), QWidget(parent) : itemCall(0), QWidget(parent), init(false)
{ {
} }
...@@ -51,6 +52,22 @@ void CallTreeItem::setCall(Call *call) ...@@ -51,6 +52,22 @@ void CallTreeItem::setCall(Call *call)
{ {
itemCall = call; itemCall = call;
if (itemCall->isConference()) {
if (!init) {
labelHistoryPeerName = new QLabel("Conference",this);
labelIcon = new QLabel("Icn",this);
QHBoxLayout* mainLayout = new QHBoxLayout();
mainLayout->addWidget(labelIcon);
mainLayout->addWidget(labelHistoryPeerName);
setLayout(mainLayout);
init = true;
}
labelIcon->setPixmap(QPixmap(ICON_CONFERENCE));
labelIcon->setVisible(true);
labelHistoryPeerName->setVisible(true);
return;
}
labelIcon = new QLabel(); labelIcon = new QLabel();
labelCallNumber2 = new QLabel(itemCall->getPeerPhoneNumber()); labelCallNumber2 = new QLabel(itemCall->getPeerPhoneNumber());
labelTransferPrefix = new QLabel(i18n("Transfer to : ")); labelTransferPrefix = new QLabel(i18n("Transfer to : "));
...@@ -60,6 +77,9 @@ void CallTreeItem::setCall(Call *call) ...@@ -60,6 +77,9 @@ void CallTreeItem::setCall(Call *call)
QHBoxLayout * mainLayout = new QHBoxLayout(); QHBoxLayout * mainLayout = new QHBoxLayout();
mainLayout->setContentsMargins ( 3, 1, 2, 1); mainLayout->setContentsMargins ( 3, 1, 2, 1);
labelCodec = new QLabel(this);
labelCodec->setText("Codec: "+itemCall->getCurrentCodecName());
mainLayout->setSpacing(4); mainLayout->setSpacing(4);
QVBoxLayout * descr = new QVBoxLayout(); QVBoxLayout * descr = new QVBoxLayout();
descr->setMargin(1); descr->setMargin(1);
...@@ -75,6 +95,7 @@ void CallTreeItem::setCall(Call *call) ...@@ -75,6 +95,7 @@ void CallTreeItem::setCall(Call *call)
} }
descr->addWidget(labelCallNumber2); descr->addWidget(labelCallNumber2);
descr->addWidget(labelCodec);
transfer->addWidget(labelTransferPrefix); transfer->addWidget(labelTransferPrefix);
transfer->addWidget(labelTransferNumber); transfer->addWidget(labelTransferNumber);
descr->addLayout(transfer); descr->addLayout(transfer);
...@@ -92,9 +113,6 @@ void CallTreeItem::setCall(Call *call) ...@@ -92,9 +113,6 @@ void CallTreeItem::setCall(Call *call)
void CallTreeItem::updated() void CallTreeItem::updated()
{ {
if (itemCall->isConference())
return;
call_state state = itemCall->getState(); call_state state = itemCall->getState();
bool recording = itemCall->getRecording(); bool recording = itemCall->getRecording();
if(state != CALL_STATE_OVER) { if(state != CALL_STATE_OVER) {
...@@ -122,10 +140,14 @@ void CallTreeItem::updated() ...@@ -122,10 +140,14 @@ void CallTreeItem::updated()
else { else {
qDebug() << "Updating item of call of state OVER. Doing nothing."; qDebug() << "Updating item of call of state OVER. Doing nothing.";
} }
} }
void CallTreeItem::setConference(bool value) { void CallTreeItem::setConference(bool value) {
conference = value; conference = value;
labelIcon->setPixmap(QPixmap(ICON_CONFERENCE));
//labelTransferNumber->setVisible(false);
//labelTransferPrefix->setVisible(false);
} }
bool CallTreeItem::isConference() { bool CallTreeItem::isConference() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment