mirror of
https://github.com/altlinux/admc.git
synced 2025-01-06 21:18:15 +03:00
Add advanced selected objects getter to SelectObjectDialog
This commit is contained in:
parent
650b144697
commit
190ccbdf20
@ -103,6 +103,20 @@ QList<QString> SelectObjectDialog::get_selected() const {
|
||||
return out;
|
||||
}
|
||||
|
||||
QList<SelectedObjectData> SelectObjectDialog::get_selected_advanced() const {
|
||||
QList<SelectedObjectData> out;
|
||||
|
||||
for (int row = 0; row < model->rowCount(); row++) {
|
||||
const QModelIndex index = model->index(row, 0);
|
||||
const QString dn = index.data(ObjectRole_DN).toString();
|
||||
const QString category = index.data(ObjectRole_ObjectCategory).toString();
|
||||
|
||||
out.append({dn, category});
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
void SelectObjectDialog::accept() {
|
||||
const QList<QString> selected = get_selected();
|
||||
|
||||
|
@ -36,6 +36,11 @@ enum SelectObjectDialogMultiSelection {
|
||||
SelectObjectDialogMultiSelection_No
|
||||
};
|
||||
|
||||
struct SelectedObjectData {
|
||||
QString dn;
|
||||
QString category;
|
||||
};
|
||||
|
||||
class SelectObjectDialog final : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
@ -48,6 +53,7 @@ public:
|
||||
static QList<QString> header_labels();
|
||||
|
||||
QList<QString> get_selected() const;
|
||||
QList<SelectedObjectData> get_selected_advanced() const;
|
||||
|
||||
public slots:
|
||||
void accept() override;
|
||||
|
Loading…
Reference in New Issue
Block a user