Commit 0a6a3d30 authored by Emmanuel Lepage's avatar Emmanuel Lepage

[#7025] Add full support for bookmark

parent 1a5d6250
......@@ -64,6 +64,21 @@ CallView* SFLPhone::model()
return m_pView->model();
}
ContactDock* SFLPhone::contactDock()
{
return m_pContactCD;
}
HistoryDock* SFLPhone::historyDock()
{
return m_pHistoryDW;
}
BookmarkDock* SFLPhone::bookmarkDock()
{
return m_pBookmarkDW;
}
SFLPhone::~SFLPhone()
{
saveState();
......
......@@ -128,7 +128,10 @@ public:
static SFLPhone* app();
SFLPhoneView* view();
CallView* model();
ContactDock* contactDock();
HistoryDock* historyDock();
BookmarkDock* bookmarkDock();
private slots:
void on_m_pView_statusMessageChangeAsked(const QString & message);
......
......@@ -110,7 +110,7 @@ SFLPhoneView::~SFLPhoneView()
void SFLPhoneView::saveState()
{
ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
//ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
//configurationManager.setHistory(callTreeModel->getHistoryCallId());
}
......
......@@ -18,7 +18,7 @@
*/
SFLPhoneApplication::SFLPhoneApplication()
: KApplication()
, sflphoneWindow_(0)
//, sflphoneWindow_(0)
{
// SFLPhoneApplication is created from main.cpp.
......@@ -36,7 +36,7 @@ SFLPhoneApplication::SFLPhoneApplication()
SFLPhoneApplication::~SFLPhoneApplication()
{
// automatically destroyed
sflphoneWindow_ = 0;
//sflphoneWindow_ = 0;
disableSessionManagement();
InstanceInterface& instance = InstanceInterfaceSingleton::getInstance();
Q_NOREPLY instance.Unregister(getpid());
......@@ -48,10 +48,10 @@ SFLPhoneApplication::~SFLPhoneApplication()
/**
* Return the sflphone window
*/
SFLPhone* SFLPhoneApplication::getSFLPhoneWindow() const
{
return sflphoneWindow_;
}
// SFLPhone* SFLPhoneApplication::getSFLPhoneWindow() const
// {
// return sflphoneWindow_;
// }
/**
......@@ -63,29 +63,29 @@ void SFLPhoneApplication::initializeMainWindow()
//KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
// Enable KDE session restore.
int restoredWindow = -1;
if( kapp->isSessionRestored() ) {
int n = 0;
while( KMainWindow::canBeRestored( ++n ) ) {
if( KMainWindow::classNameOfToplevel( n ) != QLatin1String( "SFLPhone" ) ) {
continue;
}
restoredWindow = n;
break;
}
}
// int restoredWindow = -1;
// if( kapp->isSessionRestored() ) {
// int n = 0;
// while( KMainWindow::canBeRestored( ++n ) ) {
// if( KMainWindow::classNameOfToplevel( n ) != QLatin1String( "SFLPhone" ) ) {
// continue;
// }
//
// restoredWindow = n;
// break;
// }
// }
// Create the main window and initialize it
sflphoneWindow_ = new SFLPhone();
if( ! sflphoneWindow_->initialize() ) {
exit(1);
return;
}
// sflphoneWindow_ = new SFLPhone();
// if( ! sflphoneWindow_->initialize() ) {
// exit(1);
// return;
// }
// Initialize KApplication
//setTopWidget( sflphoneWindow_ );
sflphoneWindow_->show();
// sflphoneWindow_->show();
}
......
......@@ -20,7 +20,7 @@ class SFLPhoneApplication : public KApplication
virtual ~SFLPhoneApplication();
// Return the contact list window
SFLPhone* getSFLPhoneWindow() const;
//SFLPhone* getSFLPhoneWindow() const;
private: // private methods
void initializeMainWindow();
......@@ -28,7 +28,7 @@ class SFLPhoneApplication : public KApplication
private:
// Reference to the sflphone window
SFLPhone *sflphoneWindow_;
//SFLPhone *sflphoneWindow_;
private slots:
Q_NOREPLY void quit2();
......
......@@ -105,6 +105,11 @@
<entry name="home" type="Bool">
<label>Defines whether to display personnal phone numbers.</label>
</entry>
<!-- Bookmark -->
<entry name="bookmarkList" type="StringList">
<label>List of bookmarked clients</label>
</entry>
<!-- Record Settings -->
......
......@@ -17,6 +17,7 @@
#include "conf/ConfigurationDialog.h"
#include "conf/ConfigurationSkeleton.h"
#include "CallView.h"
#include "SFLPhone.h"
#include <QTableView>
#include <QListView>
......@@ -57,6 +58,12 @@ int main(int argc, char **argv)
SFLPhoneApplication app;
SFLPhone* sflphoneWindow_ = new SFLPhone();
if( ! sflphoneWindow_->initialize() ) {
exit(1);
return 1;
};
sflphoneWindow_->show();
int retVal = app.exec();
......
#include "BookmarkDock.h"
#include <QtGui/QVBoxLayout>
#include <QtGui/QTreeWidgetItem>
#include <kicon.h>
#include <klineedit.h>
#include <QtGui/QTreeWidget>
#include <QtGui/QSplitter>
#include "conf/ConfigurationSkeleton.h"
#include "widgets/HistoryTreeItem.h"
class QNumericTreeWidgetItem : public QTreeWidgetItem {
public:
QNumericTreeWidgetItem(QTreeWidget* parent):QTreeWidgetItem(parent),widget(0),weight(-1){}
QNumericTreeWidgetItem(QTreeWidgetItem* parent):QTreeWidgetItem(parent),widget(0),weight(-1){}
HistoryTreeItem* widget;
int weight;
private:
bool operator<(const QTreeWidgetItem & other) const {
int column = treeWidget()->sortColumn();
if (dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)) {
if (widget !=0 && dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->widget != 0)
return widget->getTimeStamp() < dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->widget->getTimeStamp();
else if (weight > 0 && dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->weight > 0)
return weight > dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->weight;
}
return text(column) < other.text(column);
}
};
BookmarkDock::BookmarkDock(QWidget* parent) : QDockWidget(parent)
{
......@@ -28,9 +50,41 @@ BookmarkDock::BookmarkDock(QWidget* parent) : QDockWidget(parent)
m_pSplitter->setStretchFactor(0,7);
setWindowTitle("Bookmark");
m_pItemView->headerItem()->setText(0,"Bookmark" );
foreach (QString nb, ConfigurationSkeleton::bookmarkList()) {
addBookmark_internal(nb);
}
connect(m_pFilterLE, SIGNAL(textChanged(QString)), this, SLOT(filter(QString) ));
}
BookmarkDock::~BookmarkDock()
{
}
void BookmarkDock::addBookmark_internal(QString phone)
{
HistoryTreeItem* widget = new HistoryTreeItem(m_pItemView,phone);
QTreeWidgetItem* item = new QTreeWidgetItem(m_pItemView );
widget->setItem(item);
m_pItemView->addTopLevelItem(item);
m_pItemView->setItemWidget(item,0,widget);
m_pBookmark << widget;
}
void BookmarkDock::addBookmark(QString phone)
{
addBookmark_internal(phone);
ConfigurationSkeleton::setBookmarkList(ConfigurationSkeleton::bookmarkList() << phone);
}
void BookmarkDock::filter(QString text)
{
foreach(HistoryTreeItem* item, m_pBookmark) {
bool visible = (item->getName().toLower().indexOf(text) != -1) || (item->getPhoneNumber().toLower().indexOf(text) != -1);
item->getItem()-> setHidden(!visible);
}
m_pItemView->expandAll();
}
\ No newline at end of file
......@@ -6,16 +6,22 @@
class QTreeWidget;
class KLineEdit;
class QSplitter;
class HistoryTreeItem;
typedef QList<HistoryTreeItem*> BookmarkList;
class BookmarkDock : public QDockWidget {
Q_OBJECT
public:
BookmarkDock(QWidget* parent);
virtual ~BookmarkDock();
void addBookmark(QString phone);
private:
QTreeWidget* m_pItemView;
KLineEdit* m_pFilterLE;
QSplitter* m_pSplitter;
BookmarkList m_pBookmark;
void addBookmark_internal(QString phone);
private slots:
void filter(QString text);
};
#endif
\ No newline at end of file
......@@ -32,21 +32,21 @@
#include "lib/Call.h"
#include "SFLPhone.h"
class QNumericTreeWidgetItem : public QTreeWidgetItem {
class QNumericTreeWidgetItem_hist : public QTreeWidgetItem {
public:
QNumericTreeWidgetItem(QTreeWidget* parent):QTreeWidgetItem(parent),widget(0),weight(-1){}
QNumericTreeWidgetItem(QTreeWidgetItem* parent):QTreeWidgetItem(parent),widget(0),weight(-1){}
QNumericTreeWidgetItem_hist(QTreeWidget* parent):QTreeWidgetItem(parent),widget(0),weight(-1){}
QNumericTreeWidgetItem_hist(QTreeWidgetItem* parent):QTreeWidgetItem(parent),widget(0),weight(-1){}
ContactItemWidget* widget;
QString number;
int weight;
private:
bool operator<(const QTreeWidgetItem & other) const {
int column = treeWidget()->sortColumn();
//if (dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)) {
//if (widget !=0 && dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->widget != 0)
// return widget->getTimeStamp() < dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->widget->getTimeStamp();
//else if (weight > 0 && dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->weight > 0)
// return weight > dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->weight;
//if (dynamic_cast<QNumericTreeWidgetItem_hist*>((QTreeWidgetItem*)&other)) {
//if (widget !=0 && dynamic_cast<QNumericTreeWidgetItem_hist*>((QTreeWidgetItem*)&other)->widget != 0)
// return widget->getTimeStamp() < dynamic_cast<QNumericTreeWidgetItem_hist*>((QTreeWidgetItem*)&other)->widget->getTimeStamp();
//else if (weight > 0 && dynamic_cast<QNumericTreeWidgetItem_hist*>((QTreeWidgetItem*)&other)->weight > 0)
// return weight > dynamic_cast<QNumericTreeWidgetItem_hist*>((QTreeWidgetItem*)&other)->weight;
//}
return text(column) < other.text(column);
}
......@@ -114,7 +114,7 @@ void ContactDock::reloadContact()
ContactList list = AkonadiBackend::getInstance()->update();
foreach (Contact* cont, list) {
ContactItemWidget* aContact = new ContactItemWidget(m_pContactView);
QNumericTreeWidgetItem* item = new QNumericTreeWidgetItem(m_pContactView);
QNumericTreeWidgetItem_hist* item = new QNumericTreeWidgetItem_hist(m_pContactView);
item->widget = aContact;
aContact->setItem(item);
aContact->setContact(cont);
......@@ -123,7 +123,7 @@ void ContactDock::reloadContact()
qDebug() << "Phone count" << numbers.count();
if (numbers.count() > 1) {
foreach (Contact::PhoneNumber* number, numbers) {
QNumericTreeWidgetItem* item2 = new QNumericTreeWidgetItem(item);
QNumericTreeWidgetItem_hist* item2 = new QNumericTreeWidgetItem_hist(item);
QLabel* numberL = new QLabel("<b>"+number->getType()+":</b>"+number->getNumber(),this);
item2->number = number->getNumber();
m_pContactView->setItemWidget(item2,0,numberL);
......@@ -143,8 +143,8 @@ void ContactDock::loadContactHistory(QTreeWidgetItem* item)
{
if (m_pShowHistoCK->isChecked()) {
m_pCallView->clear();
if (dynamic_cast<QNumericTreeWidgetItem*>(item) != NULL) {
QNumericTreeWidgetItem* realItem = dynamic_cast<QNumericTreeWidgetItem*>(item);
if (dynamic_cast<QNumericTreeWidgetItem_hist*>(item) != NULL) {
QNumericTreeWidgetItem_hist* realItem = dynamic_cast<QNumericTreeWidgetItem_hist*>(item);
foreach (Call* call, SFLPhone::app()->model()->getHistory()) {
if (realItem->widget != 0) {
foreach (Contact::PhoneNumber* number, realItem->widget->getContact()->getPhoneNumbers()) {
......@@ -184,8 +184,8 @@ QMimeData* ContactTree::mimeData( const QList<QTreeWidgetItem *> items) const
QMimeData *mimeData = new QMimeData();
//Contact
if (dynamic_cast<QNumericTreeWidgetItem*>(items[0])) {
QNumericTreeWidgetItem* item = dynamic_cast<QNumericTreeWidgetItem*>(items[0]);
if (dynamic_cast<QNumericTreeWidgetItem_hist*>(items[0])) {
QNumericTreeWidgetItem_hist* item = dynamic_cast<QNumericTreeWidgetItem_hist*>(items[0]);
if (item->widget != 0) {
mimeData->setData(MIME_CONTACT, item->widget->getContact()->getUid().toUtf8());
}
......
......@@ -33,6 +33,8 @@
#include "lib/sflphone_const.h"
#include "ContactItemWidget.h"
#include "AkonadiBackend.h"
#include "SFLPhone.h"
#include "conf/ConfigurationSkeleton.h"
ContactItemWidget::ContactItemWidget(QWidget *parent)
: QWidget(parent), m_pMenu(0),init(false)
......@@ -64,7 +66,7 @@ ContactItemWidget::ContactItemWidget(QWidget *parent)
m_pAddPhone->setIcon(KIcon("list-resource-add"));
m_pBookmark = new KAction(this);
m_pBookmark->setShortcut(Qt::CTRL + Qt::Key_N);
m_pBookmark->setShortcut(Qt::CTRL + Qt::Key_D);
m_pBookmark->setText("Bookmark");
m_pBookmark->setIcon(KIcon("bookmarks"));
......@@ -203,7 +205,10 @@ void ContactItemWidget::showContext(const QPoint& pos)
m_pMenu->addAction(m_pAddPhone);
m_pMenu->addAction(m_pCopy);
m_pMenu->addAction(m_pEmail);
m_pMenu->addAction(m_pBookmark);
}
PhoneNumbers numbers = m_pContactKA->getPhoneNumbers();
m_pBookmark->setEnabled(numbers.count() == 1);
m_pMenu->exec(mapToGlobal(pos));
}
......@@ -240,5 +245,7 @@ void ContactItemWidget::addPhone()
void ContactItemWidget::bookmark()
{
PhoneNumbers numbers = m_pContactKA->getPhoneNumbers();
if (numbers.count() == 1)
SFLPhone::app()->bookmarkDock()->addBookmark(numbers[0]->getNumber());
}
\ No newline at end of file
......@@ -16,7 +16,7 @@
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
**************************************************************************/
#include <QtCore/QStringList>
#include <QtGui/QGridLayout>
......@@ -33,10 +33,11 @@
#include "AkonadiBackend.h"
#include "lib/Contact.h"
#include "SFLPhone.h"
#include "conf/ConfigurationSkeleton.h"
const char * HistoryTreeItem::callStateIcons[12] = {ICON_INCOMING, ICON_RINGING, ICON_CURRENT, ICON_DIALING, ICON_HOLD, ICON_FAILURE, ICON_BUSY, ICON_TRANSFER, ICON_TRANSF_HOLD, "", "", ICON_CONFERENCE};
HistoryTreeItem::HistoryTreeItem(QWidget *parent)
HistoryTreeItem::HistoryTreeItem(QWidget *parent ,QString phone)
: QWidget(parent), itemCall(0),m_pMenu(0), init(false)
{
setContextMenuPolicy(Qt::CustomContextMenu);
......@@ -46,32 +47,65 @@ HistoryTreeItem::HistoryTreeItem(QWidget *parent)
m_pCopy = new KAction(this);
m_pEmail = new KAction(this);
m_pAddToContact = new KAction(this);
m_pBookmark = new KAction(this);
m_pCallAgain->setShortcut (Qt::CTRL + Qt::Key_Enter );
m_pCallAgain->setText ("Call Again" );
m_pCallAgain->setIcon (KIcon(ICON_DIALING) );
m_pCallAgain->setShortcut ( Qt::CTRL + Qt::Key_Enter );
m_pCallAgain->setText ( "Call Again" );
m_pCallAgain->setIcon ( KIcon(ICON_DIALING) );
m_pAddToContact->setShortcut (Qt::CTRL + Qt::Key_E );
m_pAddToContact->setText ("Add Number to Contact" );
m_pAddToContact->setIcon (KIcon("list-resource-add") );
m_pAddToContact->setShortcut ( Qt::CTRL + Qt::Key_E );
m_pAddToContact->setText ( "Add Number to Contact" );
m_pAddToContact->setIcon ( KIcon("list-resource-add") );
m_pAddContact->setShortcut (Qt::CTRL + Qt::Key_E );
m_pAddContact->setText ("Add Contact" );
m_pAddContact->setIcon (KIcon("contact-new") );
m_pAddContact->setShortcut ( Qt::CTRL + Qt::Key_E );
m_pAddContact->setText ( "Add Contact" );
m_pAddContact->setIcon ( KIcon("contact-new") );
m_pCopy->setShortcut (Qt::CTRL + Qt::Key_C );
m_pCopy->setText ("Copy" );
m_pCopy->setIcon (KIcon("edit-copy") );
m_pCopy->setShortcut ( Qt::CTRL + Qt::Key_C );
m_pCopy->setText ( "Copy" );
m_pCopy->setIcon ( KIcon("edit-copy") );
m_pEmail->setShortcut (Qt::CTRL + Qt::Key_M );
m_pEmail->setText ("Send Email" );
m_pEmail->setIcon (KIcon("mail-message-new") );
m_pEmail->setShortcut ( Qt::CTRL + Qt::Key_M );
m_pEmail->setText ( "Send Email" );
m_pEmail->setIcon ( KIcon("mail-message-new") );
m_pBookmark->setShortcut ( Qt::CTRL + Qt::Key_D );
m_pBookmark->setText ( "Bookmark" );
m_pBookmark->setIcon ( KIcon("bookmarks") );
connect(m_pCallAgain , SIGNAL(triggered()) , this , SLOT(callAgain() ));
connect(m_pAddContact , SIGNAL(triggered()) , this , SLOT(addContact() ));
connect(m_pCopy , SIGNAL(triggered()) , this , SLOT(copy() ));
connect(m_pEmail , SIGNAL(triggered()) , this , SLOT(sendEmail() ));
connect(m_pAddToContact , SIGNAL(triggered()) , this , SLOT(addToContact() ));
connect(m_pBookmark , SIGNAL(triggered()) , this , SLOT(bookmark() ));
connect(this , SIGNAL(customContextMenuRequested(QPoint)) , this , SLOT(showContext(QPoint) ));
labelIcon = new QLabel( this );
labelPeerName = new QLabel( this );
labelCallNumber2 = new QLabel( this );
m_pDurationL = new QLabel( this );
m_pTimeL = new QLabel( this );
labelIcon->setMinimumSize(70,48);
labelIcon->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
QSpacerItem* verticalSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding);
QGridLayout* mainLayout = new QGridLayout(this);
mainLayout->addWidget ( labelIcon,0,0,4,1 );
mainLayout->addWidget ( labelPeerName,0,1 );
mainLayout->addWidget ( labelCallNumber2,1,1 );
mainLayout->addWidget ( m_pTimeL,2,1 );
mainLayout->addItem ( verticalSpacer,3,1 );
mainLayout->addWidget ( m_pDurationL,0,2,4,1 );
setLayout(mainLayout);
setMinimumSize(QSize(50, 30));
connect(m_pCallAgain ,SIGNAL(triggered()),this,SLOT(callAgain() ));
connect(m_pAddContact ,SIGNAL(triggered()),this,SLOT(addContact() ));
connect(m_pCopy ,SIGNAL(triggered()),this,SLOT(copy() ));
connect(m_pEmail ,SIGNAL(triggered()),this,SLOT(sendEmail() ));
connect(m_pAddToContact ,SIGNAL(triggered()),this,SLOT(addToContact() ));
if (!phone.isEmpty()) {
getContactInfo(phone);
labelCallNumber2->setText(phone);
m_pPhoneNumber = phone;
}
}
HistoryTreeItem::~HistoryTreeItem()
......@@ -93,36 +127,14 @@ void HistoryTreeItem::setCall(Call *call)
return;
}
labelIcon = new QLabel(this);
labelPeerName = new QLabel();
labelIcon = new QLabel();
labelIcon->setMinimumSize(70,48);
labelIcon->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
labelCallNumber2 = new QLabel(itemCall->getPeerPhoneNumber());
QSpacerItem* verticalSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding);
labelCallNumber2->setText(itemCall->getPeerPhoneNumber());
m_pTimeL = new QLabel();
m_pTimeL->setText(QDateTime::fromTime_t(itemCall->getStartTimeStamp().toUInt()).toString());
m_pDurationL = new QLabel();
int dur = itemCall->getStopTimeStamp().toInt() - itemCall->getStartTimeStamp().toInt();
m_pDurationL->setText(QString("%1").arg(dur/3600,2)+":"+QString("%1").arg((dur%3600)/60,2)+":"+QString("%1").arg((dur%3600)%60,2)+" ");
QGridLayout* mainLayout = new QGridLayout(this);
mainLayout->addWidget( labelIcon,0,0,4,1 );
mainLayout->addWidget( labelPeerName,0,1 );
mainLayout->addWidget( labelCallNumber2,1,1 );
mainLayout->addWidget( m_pTimeL,2,1 );
mainLayout->addItem ( verticalSpacer,3,1 );
mainLayout->addWidget( m_pDurationL,0,2,4,1 );
setLayout(mainLayout);
setMinimumSize(QSize(50, 30));
connect(itemCall, SIGNAL(changed()), this, SLOT(updated()));
connect(this,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(showContext(QPoint)));
connect(itemCall , SIGNAL(changed()) , this , SLOT(updated() ));
updated();
m_pTimeStamp = itemCall->getStartTimeStamp().toUInt();
......@@ -131,24 +143,28 @@ void HistoryTreeItem::setCall(Call *call)
m_pPhoneNumber = itemCall->getPeerPhoneNumber();
}
void HistoryTreeItem::updated()
bool HistoryTreeItem::getContactInfo(QString phoneNumber)
{
Contact* contact = AkonadiBackend::getInstance()->getContactByPhone(itemCall->getPeerPhoneNumber());
Contact* contact = AkonadiBackend::getInstance()->getContactByPhone(phoneNumber);
if (contact) {
labelIcon->setPixmap(*contact->getPhoto());
labelPeerName->setText("<b>"+contact->getFormattedName()+"</b>");
}
else {
labelIcon->setPixmap(QPixmap(KIcon("user-identity").pixmap(QSize(48,48))));
labelPeerName->setText("<b>Unknow</b>");
return false;
}
return true;
}
void HistoryTreeItem::updated()
{
if (!getContactInfo(itemCall->getPeerPhoneNumber())) {
if(! itemCall->getPeerName().trimmed().isEmpty()) {
labelPeerName->setText("<b>"+itemCall->getPeerName()+"</b>");
}
else {
labelPeerName->setText("<b>Unknow</b>");
}
}
call_state state = itemCall->getState();
bool recording = itemCall->getRecording();
if(state != CALL_STATE_OVER) {
......@@ -208,6 +224,7 @@ void HistoryTreeItem::showContext(const QPoint& pos)
m_pMenu->addAction( m_pAddToContact );
m_pMenu->addAction( m_pCopy );
m_pMenu->addAction( m_pEmail );
m_pMenu->addAction( m_pBookmark );
}
m_pMenu->exec(mapToGlobal(pos));
}
......@@ -243,3 +260,8 @@ void HistoryTreeItem::addToContact()
{
qDebug() << "Adding to contact";
}
void HistoryTreeItem::bookmark()
{
qDebug() << "bookmark";
SFLPhone::app()->bookmarkDock()->addBookmark(m_pPhoneNumber);
}
\ No newline at end of file
......@@ -49,7 +49,7 @@ class HistoryTreeItem : public QWidget
{
Q_OBJECT
public:
HistoryTreeItem(QWidget* parent =0);
HistoryTreeItem(QWidget* parent =0, QString phone = "");
~HistoryTreeItem();
Call* call() const;
......@@ -98,6 +98,8 @@ private slots:
void copy();
void addContact();
void addToContact();
void bookmark();
bool getContactInfo(QString phone);
signals:
void over(Call*);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment