Do you have the time?
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16481 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
8f7a3e43dc
commit
19143d9107
|
@ -65,6 +65,7 @@ signals:
|
|||
void delAccount(QSharedPointer<Account>);
|
||||
|
||||
private slots:
|
||||
/* We need to wait for the gateway deletion before reloading it */
|
||||
void accountReloadSlot(QSharedPointer<Account>);
|
||||
|
||||
private:
|
||||
|
|
|
@ -110,6 +110,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
/* 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 @@ MainWindow::~MainWindow()
|
|||
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 @@ void MainWindow::sendDTMF(QString dtmf)
|
|||
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 @@ void MainWindow::newOutgoingCall(QSharedPointer<Call> call)
|
|||
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 @@ void MainWindow::ringing(QSharedPointer<Call> call)
|
|||
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);
|
||||
|
|
|
@ -79,12 +79,14 @@ private slots:
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue