Bug 246232

Summary: Contact chooser should allow multiple contacts choice
Product: [Unmaintained] telepathy Reporter: Daniele E. Domenichelli <ddomenichelli>
Component: common-internalsAssignee: Telepathy Bugs <kde-telepathy-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: wishlist CC: kde
Priority: NOR    
Version: unspecified   
Target Milestone: Future   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 246229, 316759    

Description Daniele E. Domenichelli 2010-07-30 11:40:47 UTC
We need a widget (populated using a model) to allow a multiple contact/metacontact/account choice
Comment 1 Daniele E. Domenichelli 2012-10-26 07:26:04 UTC
We should already be able to do it in the widget, so we need to expose it in the dialog
Comment 2 David Edmundson 2013-04-12 19:13:54 UTC
(moving to wishlist)

Also I'm unsure how best to do this:

Adding this to ContactGridWidget would suck because because then we have methods selectedContact() and signal selectionChanged(account, contact); which would be fundamentally broken.

We need to return a QList < QPair<KTp::ContactPtr, Tp::AccountPtr> >  which is a bit messy. 

Modifying it to always select lists makes all code using it a bit more complicated.

Making a new widget would suck too because we now have two classes that do the same thing, and have a lot of duplication.
Comment 3 Daniele E. Domenichelli 2013-04-16 22:29:52 UTC
Perhaps we can be inspired by QFileDialog, that can handle single/multiple file selection and have similar methods/signals

https://qt-project.org/doc/qt-4.8/QFileDialog.html
Comment 4 David Edmundson 2013-04-16 23:14:12 UTC
assuming we're editing KTp::ContactGridWidget:

current interface:

public:

    Tp::AccountPtr selectedAccount() const;
    Tp::ContactPtr selectedContact() const;

Q_SIGNALS:
    void selectionChanged(Tp::AccountPtr selectedAccount, Tp::ContactPtr selectedContact);
Comment 5 David Edmundson 2013-04-16 23:18:39 UTC
Stupid bugzilla (this is all meant to be one comment)

proposed new interface:

public:
    void setMultipleSelection(bool);
    QPair<Tp::AccountPtr, Tp::ContactPtr> selectedContact() const;
    QList<QPair<Tp::AccountPtr, Tp::ContactPtr> >selectedContacts() const;

Q_SIGNALS:
    void selectionChanged(QList<QPair<Tp::AccountPtr, Tp::ContactPtr> >);


then update all code to use it?
Having a mix of selectedAccount, selectedContact and lists of pairs would be rubbish.
...and I don't really like using QPair.

Maybe we could instead do:

QList<Tp::ContactPtr> selectedContacts();
Tp::AccountPtr accountForContact(Tp::ContactPtr);

instead? Seems neater.
Comment 6 Daniele E. Domenichelli 2013-04-17 10:41:32 UTC
I wonder why can't we have a Contact that has a pointer to its account in TelepathyQt
Perhaps we can have it in KTp::Contact?
In that way we could just have
  QList<KTp::ContactPtr> selectedContacts();
  contact->account();

Also we could simplify a lot of methods that require both account and contact...

Anyway for now using the GlobalContactManager seems to be the easier option
Comment 7 Christoph Cullmann 2024-09-18 18:14:24 UTC
Dear user, unfortunately Telepathy is no longer maintained.

Please migrate to another solution, e.g. for Jabber a possibility is Kaidan, for Matrix a candidate is NeoChat.