aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Bertrand <nicolas.bertrand@linux.intel.com>2011-05-18 15:33:29 +0200
committerDenis Kenzior <denkenz@gmail.com>2011-05-22 05:42:56 -0500
commit55260ebe1166eaa4643393846e938b65beec97b9 (patch)
tree44ebf2bac0761ab4bc6f164a1979c51e079c969a
parentad79c7744b120cac101e17cb61fa8cfc49d2512e (diff)
downloadphonesim-55260ebe1166eaa4643393846e938b65beec97b9.tar.gz
control: Handle hangup call
-rw-r--r--src/control.cpp24
-rw-r--r--src/control.h2
2 files changed, 25 insertions, 1 deletions
diff --git a/src/control.cpp b/src/control.cpp
index 60f23f2..7c52564 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -90,6 +90,7 @@ ControlWidget::ControlWidget(const QString &ruleFile, Control *parent)
connect(ui->pbSendNotif, SIGNAL(clicked()), this, SLOT(sendCSSN()));
connect(ui->pbAlerting, SIGNAL(clicked()), this, SLOT(setStateAlerting()));
connect(ui->pbActive, SIGNAL(clicked()), this, SLOT(setStateConnected()));
+ connect(ui->pbHangup, SIGNAL(clicked()), this, SLOT(setStateHangup()));
QStringList headers;
headers << "Sender" << "Priority" << "Notification Status";
@@ -127,7 +128,8 @@ Control::Control(const QString& ruleFile, SimRules *sr, QObject *parent)
<< SIGNAL(switchTo(QString))
<< SIGNAL(startIncomingCall(QString, QString, QString))
<< SIGNAL(stateChangedToAlerting())
- << SIGNAL(stateChangedToConnected());
+ << SIGNAL(stateChangedToConnected())
+ << SIGNAL(stateChangedToHangup(int));
foreach (QByteArray sig, proxySignals)
connect(widget, sig, this, sig);
@@ -182,6 +184,26 @@ void ControlWidget::setStateAlerting()
emit stateChangedToAlerting();
}
+void ControlWidget::setStateHangup()
+{
+ QList <QTableWidgetItem *> items = ui->twCallMgt->selectedItems();
+
+ foreach ( QTableWidgetItem *item, items )
+ {
+ int row = item->row();
+ if ( row >= 0 )
+ {
+ QTableWidgetItem *itemCallId = ui->twCallMgt->item( row, 0 );
+ if ( itemCallId != 0 )
+ {
+ QString strid = itemCallId->text();
+ int id = strid.toInt();
+ emit p->stateChangedToHangup( id );
+ }
+ }
+ }
+}
+
void ControlWidget::setCssiEnabled( bool enableCSSI )
{
ui->cbCSSI->setEnabled( enableCSSI );
diff --git a/src/control.h b/src/control.h
index 3b8ff64..fd1a4e6 100644
--- a/src/control.h
+++ b/src/control.h
@@ -106,6 +106,7 @@ private slots:
void sendCSSN();
void setStateAlerting();
void setStateConnected();
+ void setStateHangup();
signals:
void unsolicitedCommand(const QString &);
@@ -115,6 +116,7 @@ signals:
void startIncomingCall(const QString &, const QString &, const QString &);
void stateChangedToAlerting();
void stateChangedToConnected();
+ void stateChangedToHangup( int callId );
protected:
void closeEvent(QCloseEvent *event);