Bug 246232 - Contact chooser should allow multiple contacts choice
Summary: Contact chooser should allow multiple contacts choice
Status: CONFIRMED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: common-internals (show other bugs)
Version: unspecified
Platform: unspecified All
: NOR wishlist
Target Milestone: Future
Assignee: Telepathy Bugs
URL:
Keywords:
Depends on:
Blocks: 316759 246229
  Show dependency treegraph
 
Reported: 2010-07-30 11:40 UTC by Daniele E. Domenichelli
Modified: 2013-04-17 10:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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