summaryrefslogtreecommitdiffstats
path: root/src/gui/historylistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/historylistview.cpp')
-rw-r--r--src/gui/historylistview.cpp91
1 files changed, 0 insertions, 91 deletions
diff --git a/src/gui/historylistview.cpp b/src/gui/historylistview.cpp
deleted file mode 100644
index 666f3ac..0000000
--- a/src/gui/historylistview.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- Copyright (C) 2005-2009 Michel de Boer <michel@twinklephone.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include "historylistview.h"
-#include "util.h"
-#include "userintf.h"
-
-#include "qpixmap.h"
-//Added by qt3to4:
-#include <q3mimefactory.h>
-
-HistoryListViewItem::HistoryListViewItem( Q3ListView * parent, const t_call_record &cr, t_user *user_config, time_t _last_viewed) :
- Q3ListViewItem(parent,
- time2str(cr.time_start, "%d %b %Y %H:%M:%S").c_str(),
- cr.get_direction().c_str(),
- (cr.direction == t_call_record::DIR_IN ?
- ui->format_sip_address(user_config,
- cr.from_display, cr.from_uri).c_str() :
- ui->format_sip_address(user_config,
- cr.to_display, cr.to_uri).c_str()),
- cr.subject.c_str(),
- cr.invite_resp_reason.c_str())
-{
- call_record = cr;
- last_viewed = _last_viewed;
-
- // Set direction icon
- setPixmap(HISTCOL_DIRECTION, (cr.direction == t_call_record::DIR_IN ?
- QPixmap(":/icons/images/1leftarrow-yellow.png") :
- QPixmap(":/icons/images/1rightarrow.png")));
-
- // Set status icon
- setPixmap(HISTCOL_STATUS, (cr.invite_resp_code < 300 ?
- QPixmap(":/icons/images/ok.png") :
- QPixmap(":/icons/images/cancel.png")));
-}
-
-void HistoryListViewItem::paintCell(QPainter *painter, const QColorGroup &cg,
- int column, int width, int align)
-{
- painter->save();
- QColorGroup grp(cg);
- if (call_record.time_start > last_viewed &&
- call_record.rel_cause == t_call_record::CS_FAILURE &&
- call_record.direction == t_call_record::DIR_IN)
- {
- // Highlight missed calls since last view
- grp.setColor(QColorGroup::Base, QColor("yellow"));
- }
- Q3ListViewItem::paintCell(painter, grp, column, width, align);
- painter->restore();
-}
-
-int HistoryListViewItem::compare ( Q3ListViewItem * i, int col, bool ascending ) const
-{
- if (col != HISTCOL_TIMESTAMP) {
- return Q3ListViewItem::compare(i, col, ascending);
- }
- if (call_record.time_start < ((HistoryListViewItem *)i)->get_time_start()) {
- return -1;
- }
- if (call_record.time_start == ((HistoryListViewItem *)i)->get_time_start()) {
- return 0;
- }
- return 1;
-}
-
-time_t HistoryListViewItem::get_time_start(void) const
-{
- return call_record.time_start;
-}
-
-t_call_record HistoryListViewItem::get_call_record(void) const
-{
- return call_record;
-}