blob: 0448af032a60584057e4f141d767ea37ef3ad082 [file] [log] [blame]
Edric Milaret5cbf2b62015-07-09 11:36:53 -04001/***************************************************************************
Edric Milaret5f316da2015-09-28 11:57:42 -04002 * Copyright (C) 2015 by Savoir-faire Linux *
Edric Milaret5cbf2b62015-07-09 11:36:53 -04003 * 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
Edric Milaret5f316da2015-09-28 11:57:42 -040019#pragma once
Edric Milaret5cbf2b62015-07-09 11:36:53 -040020
21#include <QDialog>
22#include <QSortFilterProxyModel>
23
24#include "callmodel.h"
25
26namespace Ui {
27class TransferDialog;
28}
29
30class ActiveCallsProxyModel : public QSortFilterProxyModel
31{
32public:
33 ActiveCallsProxyModel(QAbstractItemModel* parent) : QSortFilterProxyModel(parent)
34 {
35 setSourceModel(parent);
36 }
37 virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
38 {
39 return sourceModel()->index(source_row,0,source_parent)
40 .data(static_cast<int>(Call::Role::State)).value<Call::State>() != Call::State::CURRENT;
41 }
42};
43
44
45class TransferDialog : public QDialog
46{
47 Q_OBJECT
48
49public:
50 explicit TransferDialog(QWidget *parent = 0);
51 ~TransferDialog();
52
53//UI SLOTS
54protected slots:
55 void showEvent(QShowEvent *event);
56private slots:
57 void on_transferButton_clicked();
58 void on_activeCallsView_doubleClicked(const QModelIndex &index);
59 void on_activeCallsView_clicked(const QModelIndex &index);
60
61private:
62 Ui::TransferDialog *ui;
63 Call *selectedCall_;
64};
65