feat: front proxy for group

This commit is contained in:
arm64v8a
2023-05-25 09:34:56 +09:00
parent fbd2a3354c
commit b5e0b16a73
11 changed files with 162 additions and 49 deletions

View File

@@ -45,6 +45,7 @@ GroupItem::GroupItem(QWidget *parent, const std::shared_ptr<NekoGui::Group> &ent
ui->setupUi(this);
this->setLayoutDirection(Qt::LeftToRight);
this->parentWindow = parent;
this->ent = ent;
this->item = item;
if (ent == nullptr) return;
@@ -102,15 +103,16 @@ void GroupItem::on_update_sub_clicked() {
}
void GroupItem::on_edit_clicked() {
auto dialog = new DialogEditGroup(ent, this);
int ret = dialog->exec();
dialog->deleteLater();
if (ret == QDialog::Accepted) {
ent->Save();
refresh_data();
MW_dialog_message(Dialog_DialogManageGroups, "refresh" + Int2String(ent->id));
}
auto dialog = new DialogEditGroup(ent, parentWindow);
connect(dialog, &QDialog::finished, this, [=] {
if (dialog->result() == QDialog::Accepted) {
ent->Save();
refresh_data();
MW_dialog_message(Dialog_DialogManageGroups, "refresh" + Int2String(ent->id));
}
dialog->deleteLater();
});
dialog->show();
}
void GroupItem::on_remove_clicked() {