kopete/kopete
kopetecontactlistview.cpp
Go to the documentation of this file.
138 connect( Kopete::BehaviorSettings::self(), SIGNAL(configChanged()), SLOT(slotSettingsChanged()) );
139 connect( Kopete::AppearanceSettings::self(), SIGNAL(configChanged()), SLOT(slotSettingsChanged()) );
176 d->actionMakeMetaContact = new KAction(KIcon("list-add-user"), i18n("Merge Meta Contacts"), ac);
187 d->actionRename = new KAction( KIcon("edit-rename"), i18nc( "verb, rename a contact", "Rename" ), ac );
195 d->actionAddContact = new KActionMenu( KIcon( QLatin1String("list-add-user") ), i18n( "&Add Contact" ), ac );
199 d->actionAddTemporaryContact = new KAction( KIcon("list-add-user"), i18n( "Add to Your Contact List" ), ac );
201 connect( d->actionAddTemporaryContact, SIGNAL(triggered(bool)), this, SLOT(addTemporaryContact()) );
203 // connect( Kopete::ContactList::self(), SIGNAL(metaContactSelected(bool)), this, SLOT(slotMetaContactSelected(bool)) );
219 Kopete::MetaContact* KopeteContactListView::metaContactFromIndex( const QModelIndex& index ) const
221 QObject* metaContactObject = qVariantValue<QObject*>( index.data( Kopete::Items::ObjectRole ) );
283 // FIXME: Why QTreeView::keyboardSearch updates selection only when selectionMode is SingleSelection?
308 QPointer <KopeteMetaLVIProps> propsDialog = new KopeteMetaLVIProps( metaContactFromIndex( index ), 0L );
401 if( KMessageBox::warningContinueCancel( this, msg, i18n( "Remove" ), KGuiItem( i18n( "Remove" ), "edit-delete" ),
416 if( KMessageBox::warningContinueCancelList( this, msg, displayNameList, i18n("Remove"), KGuiItem( i18n( "Remove" ), "edit-delete" ),
439 if ( index.data( Kopete::Items::TypeRole ) == Kopete::Items::MetaContact && d->actionMove->currentAction() )
446 const QString msg = i18n( "Account %1 is offline. Do you really want to move this metacontact?", c->account()->accountLabel() );
447 if ( KMessageBox::warningYesNo( this, msg, i18n( "Move contact" ), KStandardGuiItem::yes(), KStandardGuiItem::no(),
448 "askMoveMetaContactToGroup", KMessageBox::Notify | KMessageBox::Dangerous ) == KMessageBox::No )
462 QObject* groupObject = qVariantValue<QObject*>( index.data( Kopete::Items::MetaContactGroupRole ) );
481 if ( index.data( Kopete::Items::TypeRole ) == Kopete::Items::MetaContact && d->actionCopy->currentAction() )
541 KToolInvocation::invokeMailer( emailAddr, QString::null ); //krazy:exclude=nullstrassign for old broken gcc
543 KMessageBox::queuedMessageBox( this, KMessageBox::Sorry, i18n( "There is no email address set for this contact in the KDE address book." ), i18n( "No Email Address in Address Book" ) );
547 KMessageBox::queuedMessageBox( this, KMessageBox::Sorry, i18n( "This contact was not found in the KDE address book. Check that a contact is selected in the properties dialog." ), i18n( "Not Found in Address Book" ) );
670 accept = (event->proposedAction() & Qt::MoveAction); // MetaContact merge (copy&merge not supported)
672 accept = (event->proposedAction() & (Qt::MoveAction | Qt::CopyAction)); // Move/copy between groups
674 accept = (event->proposedAction() & Qt::MoveAction); // In plain view metaContact can only be moved
730 d->scrollAutoHideCounter = d->scrollAutoHideTimeout; // Mouse left the contact list, hide it after timeout
760 void KopeteContactListView::selectionChanged( const QItemSelection& selected, const QItemSelection& deselected )
781 disconnect( d->selectedMetaContact, SIGNAL(onlineStatusChanged(Kopete::MetaContact*,Kopete::OnlineStatus::StatusType)),
789 connect( d->selectedMetaContact, SIGNAL(onlineStatusChanged(Kopete::MetaContact*,Kopete::OnlineStatus::StatusType)),
826 bool singleContactSelected = (selected.count() == 1 && selected.first().data( Kopete::Items::TypeRole ) == Kopete::Items::MetaContact);
827 bool singleGroupSelected = (selected.count() == 1 && selected.first().data( Kopete::Items::TypeRole ) == Kopete::Items::Group);
828 Kopete::MetaContact* metaContact = ( singleContactSelected ) ? metaContactFromIndex( selected.first() ) : 0;
878 d->actionMakeMetaContact->setEnabled( hasContactInSelection ); // Specifically for multiple contacts, not groups.
899 bool singleGroupSelected = (selected.count() == 1 && selected.first().data( Kopete::Items::TypeRole ) == Kopete::Items::Group);
939 /* Kopete::UI::ListView::Item::setEffects( Kopete::AppearanceSettings::self()->contactListAnimateChange(),
947 KAction *action = new KAction( KIcon( QIcon( account->accountIcon() ) ), account->accountLabel(), this );
988 AddContactPage *addContactPage = account->protocol()->createAddContactWidget( addDialog, account );
1053 void KopeteContactListView::metaContactPopup( Kopete::MetaContact *metaContact, const QPoint& pos )
1064 KMenu *popup = dynamic_cast<KMenu *>( window->factory()->container( "contact_popup", window ) );
1094 QString text = i18nc( "Translators: format: '<displayName> (<id>)'", "%2 <%1>", c->contactId(), c->nickName() );
1131 popup = dynamic_cast<KMenu *>( window->factory()->container( "contactlistitems_popup", window ) );
QModelIndexList indexes() const
virtual int rowCount(const QModelIndex &parent) const =0
Type type() const
virtual void dragMoveEvent(QDragMoveEvent *event)
virtual bool viewportEvent(QEvent *event)
Definition: kopetecontactlistview.cpp:737
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
void setAlternatingRowColors(bool enable)
virtual bool eventFilter(QObject *object, QEvent *event)
Definition: kopetecontactlistview.cpp:710
DropIndicatorPosition dropIndicatorPosition() const
virtual void mouseReleaseEvent(QMouseEvent *event)
Definition: kopetecontactlistview.cpp:602
void setSelectionMode(QAbstractItemView::SelectionMode mode)
Contains definitions common between model items.
QWidget * window() const
void setMimeData(QMimeData *data)
Qt::DropAction proposedAction() const
void initActions(KActionCollection *ac)
Definition: kopetecontactlistview.cpp:151
virtual bool hasFormat(const QString &mimeType) const
QObject * sender() const
void collapsed(const QModelIndex &index)
const QPoint & pos() const
void setDragDropMode(DragDropMode behavior)
void mergeMetaContact()
Definition: kopetecontactlistview.cpp:320
QWidget * viewport() const
int height() const
void addTemporaryContact()
Definition: kopetecontactlistview.cpp:561
void setAnimated(bool enable)
virtual void rowsInserted(const QModelIndex &parent, int start, int end)
Definition: kopetecontactlistview.cpp:747
virtual QRect visualRect(const QModelIndex &index) const
const_iterator insert(const T &value)
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
virtual void keyboardSearch(const QString &search)
virtual void setRootIndex(const QModelIndex &index)
int rowHeight(const QModelIndex &index) const
~KopeteContactListView()
Definition: kopetecontactlistview.cpp:146
Qt::DropAction exec(QFlags< Qt::DropAction > supportedActions)
void setExpanded(const QModelIndex &index, bool expanded)
virtual void dragMoveEvent(QDragMoveEvent *event)
Definition: kopetecontactlistview.cpp:637
Definition: kopeteitembase.h:57
bool isValid() const
virtual bool viewportEvent(QEvent *event)
int count(const T &value) const
void append(const T &value)
void showItemProperties()
Definition: kopetecontactlistview.cpp:300
Definition: kopeteitembase.h:57
bool isAccepted() const
virtual void timerEvent(QTimerEvent *event)
void installEventFilter(QObject *filterObj)
QWidget * topLevelWidget() const
QList< T > values() const
static LayoutManager * instance()
Definition: contactlistlayoutmanager.cpp:47
virtual void rowsInserted(const QModelIndex &parent, int start, int end)
bool isEmpty() const
Definition: kopeteitemdelegate.h:34
bool isEmpty() const
void executeDelayedItemsLayout()
void setItemDelegate(QAbstractItemDelegate *delegate)
void removeGroupOrMetaContact()
Definition: kopetecontactlistview.cpp:350
QAbstractItemDelegate * itemDelegate() const
Kopete::Contact * contactAt(const QStyleOptionViewItem &option, const QModelIndex &index, const QPoint &point) const
Definition: kopeteitemdelegate.cpp:97
void setEditTriggers(QFlags< QAbstractItemView::EditTrigger > triggers)
virtual bool eventFilter(QObject *watched, QEvent *event)
virtual QVariant data(const QModelIndex &index, int role) const =0
void deleteLater()
T & first()
void contactActivated(const QModelIndex &index)
Definition: kopetecontactlistview.cpp:231
void hide()
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
int count() const
QModelIndex parent() const
QScrollBar * verticalScrollBar() const
void setIndentation(int i)
virtual void mouseReleaseEvent(QMouseEvent *event)
void visibleContentHeightChanged()
QRect rect() const
void setAcceptDrops(bool on)
Qt::KeyboardModifiers modifiers() const
bool contains(QChar ch, Qt::CaseSensitivity cs) const
virtual void timerEvent(QTimerEvent *event)
Definition: kopetecontactlistview.cpp:699
QModelIndex rootIndex() const
Definition: kopetelviprops.h:42
void activated(const QModelIndex &index)
QString & replace(int position, int n, QChar after)
void setExpandsOnDoubleClick(bool enable)
bool empty() const
int startTimer(int interval)
virtual void setModel(QAbstractItemModel *newModel)
Definition: kopetecontactlistview.cpp:254
int width() const
Definition: kopetelviprops.h:64
QVariant data(int role) const
typedef DropActions
KopeteContactListView(QWidget *parent=0)
Definition: kopetecontactlistview.cpp:114
virtual void setModel(QAbstractItemModel *model)
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
virtual void contextMenuEvent(QContextMenuEvent *event)
Definition: kopetecontactlistview.cpp:568
int visibleContentHeight() const
Definition: kopetecontactlistview.cpp:269
int length() const
virtual void startDrag(Qt::DropActions supportedActions)
Definition: kopetecontactlistview.cpp:614
bool toBool() const
void setMouseTracking(bool enable)
int timerId() const
virtual QStyleOptionViewItem viewOptions() const
virtual QModelIndexList selectedIndexes() const
virtual void keyboardSearch(const QString &search)
Definition: kopetecontactlistview.cpp:281
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
QString left(int n) const
void edit(const QModelIndex &index)
QList< T > toList() const
QHeaderView * header() const
void expanded(const QModelIndex &index)
const QPoint & pos() const
Qt::DropAction defaultDropAction() const
QAbstractItemModel * model() const
QModelIndex currentIndex() const
void setRootIsDecorated(bool show)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
virtual void reset()
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy)
void killTimer(int id)
void removeEventFilter(QObject *obj)
int height() const
virtual QModelIndex indexAt(const QPoint &point) const
void setDropIndicatorShown(bool enable)
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Definition: kopetecontactlistview.cpp:760
void setDragEnabled(bool enable)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.