Modified: freeswitch/trunk/fscomm/fshost.h (16480 => 16481)
--- freeswitch/trunk/fscomm/fshost.h 2010-01-23 18:35:05 UTC (rev 16480)
+++ freeswitch/trunk/fscomm/fshost.h 2010-01-23 18:36:25 UTC (rev 16481)
@@ -65,6 +65,7 @@
void delAccount(QSharedPointer<Account>);
private slots:
+ /* We need to wait for the gateway deletion before reloading it */
void accountReloadSlot(QSharedPointer<Account>);
private:
Modified: freeswitch/trunk/fscomm/mainwindow.cpp (16480 => 16481)
--- freeswitch/trunk/fscomm/mainwindow.cpp 2010-01-23 18:35:05 UTC (rev 16480)
+++ freeswitch/trunk/fscomm/mainwindow.cpp 2010-01-23 18:36:25 UTC (rev 16481)
@@ -110,6 +110,11 @@
/* Set other properties */
ui->tableAccounts->horizontalHeader()->setStretchLastSection(true);
+ /* Set the call timer */
+ callTimer = new QTimer(this);
+ callTimer->setInterval(1000);
+ connect(callTimer, SIGNAL(timeout()), this, SLOT(updateCallTimers()));
+ callTimer->start();
}
MainWindow::~MainWindow()
@@ -120,6 +125,17 @@
g_FSHost.wait();
}
+void MainWindow::updateCallTimers()
+{
+ for(int row=0; row<ui->tableCalls->rowCount(); row++)
+ {
+ QTableWidgetItem* item = ui->tableCalls->item(row, 2);
+ QTime time = QTime::fromString(item->text(),"hh:mm:ss");
+ time = time.addSecs(1);
+ item->setText(time.toString("hh:mm:ss"));
+ }
+}
+
void MainWindow::setDefaultAccount()
{
QString accName = ui->tableAccounts->item(ui->tableAccounts->selectedRanges()[0].topRow(), 0)->text();
@@ -199,7 +215,6 @@
g_FSHost.getCurrentActiveCall().data()->sendDTMF(dtmf);
}
-/* TODO: Update the timers and the item text! */
void MainWindow::callTableDoubleClick(QTableWidgetItem *item)
{
QSharedPointer<Call> lastCall = g_FSHost.getCurrentActiveCall();
@@ -314,6 +329,10 @@
item1->setData(Qt::UserRole, call.data()->getUUID());
ui->tableCalls->setItem(ui->tableCalls->rowCount()-1,1,item1);
+ QTableWidgetItem *item2 = new QTableWidgetItem("00:00:00");
+ item2->setData(Qt::UserRole, call.data()->getUUID());
+ ui->tableCalls->setItem(ui->tableCalls->rowCount()-1,2,item2);
+
ui->tableCalls->resizeColumnsToContents();
ui->tableCalls->resizeRowsToContents();
ui->tableCalls->horizontalHeader()->setStretchLastSection(true);
@@ -347,6 +366,10 @@
item1->setData(Qt::UserRole, call.data()->getUUID());
ui->tableCalls->setItem(ui->tableCalls->rowCount()-1,1,item1);
+ QTableWidgetItem *item2 = new QTableWidgetItem("00:00:00");
+ item2->setData(Qt::UserRole, call.data()->getUUID());
+ ui->tableCalls->setItem(ui->tableCalls->rowCount()-1,2,item2);
+
ui->tableCalls->resizeColumnsToContents();
ui->tableCalls->resizeRowsToContents();
ui->tableCalls->horizontalHeader()->setStretchLastSection(true);
Modified: freeswitch/trunk/fscomm/mainwindow.h (16480 => 16481)
--- freeswitch/trunk/fscomm/mainwindow.h 2010-01-23 18:35:05 UTC (rev 16480)
+++ freeswitch/trunk/fscomm/mainwindow.h 2010-01-23 18:36:25 UTC (rev 16481)
@@ -79,12 +79,14 @@
void accountDel(QSharedPointer<Account>);
void accountStateChanged(QSharedPointer<Account>);
void sysTrayActivated(QSystemTrayIcon::ActivationReason reason);
+ void updateCallTimers();
private:
Ui::MainWindow *ui;
QSignalMapper *dialpadMapper;
PrefDialog *preferences;
QSystemTrayIcon *sysTray;
+ QTimer *callTimer;
};
#endif // MAINWINDOW_H