blob: c50f82bce773f26c4899d4e15e5a50edd7e5776e [file] [log] [blame]
Edric Milaret029b95a2015-06-09 09:51:44 -04001/***************************************************************************
2 * Copyright (C) 2015 by Savoir-Faire Linux *
3 * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>*
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
19#include "videooverlay.h"
20#include "ui_videooverlay.h"
21
22#include "callmodel.h"
23
24VideoOverlay::VideoOverlay(QWidget *parent) :
25 QWidget(parent),
26 ui(new Ui::VideoOverlay)
27{
28 ui->setupUi(this);
29
Edric Milaret3aca8e32015-06-12 10:01:40 -040030 ui->chatButton->setCheckable(true);
31
Edric Milaret029b95a2015-06-09 09:51:44 -040032 actionModel_ = CallModel::instance()->userActionModel();
33 setAttribute(Qt::WA_NoSystemBackground);
34}
35
36VideoOverlay::~VideoOverlay()
37{
38 delete ui;
39}
40
41void
42VideoOverlay::setName(const QString& name)
43{
44 ui->nameLabel->setText(name);
45}
46
47void
48VideoOverlay::setTime(const QString& time)
49{
50 ui->timerLabel->setText(time);
51}
52
53void
54VideoOverlay::on_holdButton_toggled(bool checked)
55{
56 Q_UNUSED(checked)
57 actionModel_->execute(UserActionModel::Action::HOLD);
58}
59
60void
61VideoOverlay::on_hangupButton_clicked()
62{
63 actionModel_->execute(UserActionModel::Action::HANGUP);
Edric Milaret3aca8e32015-06-12 10:01:40 -040064 ui->chatButton->setChecked(false);
Edric Milaret029b95a2015-06-09 09:51:44 -040065}
66
67void
68VideoOverlay::on_chatButton_toggled(bool checked)
69{
Edric Milaret3aca8e32015-06-12 10:01:40 -040070 emit setChatVisibility(checked);
Edric Milaret029b95a2015-06-09 09:51:44 -040071}
72