2021-01-19 Fred Gleason <fredg@paravelsystems.com>

* Added an 'RDGroupListModel' class.
	* Refactored the 'List Groups' dialog in rdadmin(1) to use the
	model-based API.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-01-19 15:27:06 -05:00
parent 6b1abaa0eb
commit 35d6d4ae8d
25 changed files with 950 additions and 357 deletions

View File

@@ -2,7 +2,7 @@
//
// Rename a Rivendell Group
//
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@@ -34,8 +34,6 @@
RenameGroup::RenameGroup(QString group,QWidget *parent)
: RDDialog(parent)
{
setModal(true);
group_name=group;
//
@@ -121,6 +119,14 @@ QSizePolicy RenameGroup::sizePolicy() const
}
int RenameGroup::exec(QString *newname)
{
group_new_name=newname;
return RDDialog::exec();
}
void RenameGroup::okData()
{
QString sql;
@@ -236,11 +242,19 @@ void RenameGroup::okData()
delete q;
}
done(0);
*group_new_name=group_newname_edit->text();
done(true);
}
void RenameGroup::cancelData()
{
done(-1);
done(false);
}
void RenameGroup::closeEvent(QCloseEvent *e)
{
cancelData();
}