diff --git a/src/admc/CMakeLists.txt b/src/admc/CMakeLists.txt index a644e1f2..b8135512 100644 --- a/src/admc/CMakeLists.txt +++ b/src/admc/CMakeLists.txt @@ -79,6 +79,7 @@ set(ADMC_SOURCES changelog_dialog.cpp error_log_dialog.cpp fsmo_dialog.cpp + find_policy_dialog.cpp filter_widget/filter_widget.cpp filter_widget/filter_dialog.cpp diff --git a/src/admc/console_impls/policy_ou_impl.cpp b/src/admc/console_impls/policy_ou_impl.cpp index c73acfb5..64f0b75a 100644 --- a/src/admc/console_impls/policy_ou_impl.cpp +++ b/src/admc/console_impls/policy_ou_impl.cpp @@ -32,6 +32,7 @@ #include "status.h" #include "utils.h" #include "select_policy_dialog.h" +#include "find_policy_dialog.h" #include #include @@ -420,7 +421,8 @@ void PolicyOUImpl::link_gpo_to_ou(const QModelIndex &ou_index, const QString &ou } void PolicyOUImpl::find_gpo() { - + auto dialog = new FindPolicyDialog(console); + dialog->open(); } void policy_ou_impl_load_item_data(QStandardItem *item, const AdObject &object) { diff --git a/src/admc/find_policy_dialog.cpp b/src/admc/find_policy_dialog.cpp new file mode 100644 index 00000000..f07d530e --- /dev/null +++ b/src/admc/find_policy_dialog.cpp @@ -0,0 +1,38 @@ +/* + * ADMC - AD Management Center + * + * Copyright (C) 2020-2022 BaseALT Ltd. + * Copyright (C) 2020-2022 Dmitry Degtyarev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "find_policy_dialog.h" +#include "ui_find_policy_dialog.h" + +#include "settings.h" + +FindPolicyDialog::FindPolicyDialog(QWidget *parent) +: QDialog(parent) { + ui = new Ui::FindPolicyDialog(); + ui->setupUi(this); + + setAttribute(Qt::WA_DeleteOnClose); + + settings_setup_dialog_geometry(SETTING_find_policy_dialog_geometry, this); +} + +FindPolicyDialog::~FindPolicyDialog() { + delete ui; +} diff --git a/src/admc/find_policy_dialog.h b/src/admc/find_policy_dialog.h new file mode 100644 index 00000000..afdd71ab --- /dev/null +++ b/src/admc/find_policy_dialog.h @@ -0,0 +1,44 @@ +/* + * ADMC - AD Management Center + * + * Copyright (C) 2020-2022 BaseALT Ltd. + * Copyright (C) 2020-2022 Dmitry Degtyarev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef FIND_POLICY_DIALOG_H +#define FIND_POLICY_DIALOG_H + +/** + * Find policy objects and perform actions on them. + */ + +#include + +namespace Ui { +class FindPolicyDialog; +} + +class FindPolicyDialog final : public QDialog { + Q_OBJECT + +public: + Ui::FindPolicyDialog *ui; + + FindPolicyDialog(QWidget *parent); + ~FindPolicyDialog(); +}; + +#endif /* FIND_POLICY_DIALOG_H */ diff --git a/src/admc/find_policy_dialog.ui b/src/admc/find_policy_dialog.ui new file mode 100644 index 00000000..28959b90 --- /dev/null +++ b/src/admc/find_policy_dialog.ui @@ -0,0 +1,68 @@ + + + FindPolicyDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 30 + 240 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + buttonBox + accepted() + FindPolicyDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + FindPolicyDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/admc/settings.h b/src/admc/settings.h index 2cb5d35e..5622c5eb 100644 --- a/src/admc/settings.h +++ b/src/admc/settings.h @@ -94,6 +94,7 @@ DEFINE_SETTING(SETTING_number_attribute_dialog_geometry); DEFINE_SETTING(SETTING_fsmo_dialog_geometry); DEFINE_SETTING(SETTING_create_shared_folder_dialog_geometry); DEFINE_SETTING(SETTING_create_contact_dialog_geometry); +DEFINE_SETTING(SETTING_find_policy_dialog_geometry); // Header state DEFINE_SETTING(SETTING_results_header);