30 lines
722 B
C++
30 lines
722 B
C++
#ifndef MEMBERPICKERDIALOG_H
|
|
#define MEMBERPICKERDIALOG_H
|
|
|
|
#include "../models.h"
|
|
#include <QDialog>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
class QListWidget;
|
|
QT_END_NAMESPACE
|
|
|
|
/// A simple dialog that shows a checklist of humans and returns the selected emails.
|
|
class MemberPickerDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MemberPickerDialog(const QString &title, QWidget *parent = nullptr);
|
|
|
|
/// Populate the checklist. Members whose emails appear in `exclude` are hidden.
|
|
void setMembers(const std::vector<Human> &members, const std::vector<QString> &exclude = {});
|
|
|
|
/// Returns the emails of all checked items.
|
|
QStringList selectedEmails() const;
|
|
|
|
private:
|
|
QListWidget *m_list;
|
|
};
|
|
|
|
#endif // MEMBERPICKERDIALOG_H
|