mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-31 16:09:35 +02:00
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:
parent
6b1abaa0eb
commit
35d6d4ae8d
@ -20833,3 +20833,7 @@
|
||||
* Added 'RDLibraryModel::isCut() and 'RDLibraryModel::cutRow()
|
||||
methods.
|
||||
* Refactored 'RDCutDialog' to use the model-based API.
|
||||
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.
|
||||
|
@ -143,6 +143,7 @@ dist_librd_la_SOURCES = dbversion.h\
|
||||
rdgrid.cpp rdgrid.h\
|
||||
rdgroup.cpp rdgroup.h\
|
||||
rdgroup_list.cpp rdgroup_list.h\
|
||||
rdgrouplistmodel.cpp rdgrouplistmodel.h\
|
||||
rdhash.cpp rdhash.h\
|
||||
rdhotkeys.cpp rdhotkeys.h\
|
||||
rdhotkeylist.cpp rdhotkeylist.h\
|
||||
@ -304,6 +305,7 @@ nodist_librd_la_SOURCES = moc_rdadd_cart.cpp\
|
||||
moc_rdgetpasswd.cpp\
|
||||
moc_rdgpio.cpp\
|
||||
moc_rdgpioselector.cpp\
|
||||
moc_rdgrouplistmodel.cpp\
|
||||
moc_rdhotkeys.cpp\
|
||||
moc_rdhotkeylist.cpp\
|
||||
moc_rdimagepickerbox.cpp\
|
||||
|
@ -105,6 +105,7 @@ SOURCES += rdgpioselector.cpp
|
||||
SOURCES += rdgrid.cpp
|
||||
SOURCES += rdgroup.cpp
|
||||
SOURCES += rdgroup_list.cpp
|
||||
SOURCES += rdgrouplistmodel.cpp
|
||||
SOURCES += rdhash.cpp
|
||||
SOURCES += rdidvalidator.cpp
|
||||
SOURCES += rdimagepickerbox.cpp
|
||||
@ -254,6 +255,7 @@ HEADERS += rdgrid.h
|
||||
HEADERS += rdgpio.h
|
||||
HEADERS += rdgroup_list.h
|
||||
HEADERS += rdgroup.h
|
||||
HEADERS += rdgrouplistmodel.h
|
||||
HEADERS += rdhash.h
|
||||
HEADERS += rdidvalidator.h
|
||||
HEADERS += rdimagepickerbox.h
|
||||
|
@ -2309,6 +2309,53 @@ pro dobu zprávy.
|
||||
<translation>PIN:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
<source>ALL</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>E-Mail Addresses</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDImagePickerModel</name>
|
||||
<message>
|
||||
|
@ -2286,6 +2286,53 @@ figure for the report period.
|
||||
<translation>PIN:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
<source>ALL</source>
|
||||
<translation type="unfinished">ALLE</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>E-Mail Addresses</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDImagePickerModel</name>
|
||||
<message>
|
||||
|
@ -2288,6 +2288,53 @@ para el período a reportar.
|
||||
<translation>Pin:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
<source>ALL</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>E-Mail Addresses</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDImagePickerModel</name>
|
||||
<message>
|
||||
|
@ -1947,6 +1947,53 @@ figure for the report period.
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
<source>ALL</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>E-Mail Addresses</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDImagePickerModel</name>
|
||||
<message>
|
||||
|
@ -2267,6 +2267,53 @@ for rapportperioden.
|
||||
<translation>Pin-nummer:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
<source>ALL</source>
|
||||
<translation type="unfinished">ALLE</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>E-Mail Addresses</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDImagePickerModel</name>
|
||||
<message>
|
||||
|
@ -2267,6 +2267,53 @@ for rapportperioden.
|
||||
<translation>Pin-nummer:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
<source>ALL</source>
|
||||
<translation type="unfinished">ALLE</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>E-Mail Addresses</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDImagePickerModel</name>
|
||||
<message>
|
||||
|
@ -2274,6 +2274,53 @@ para o período do relatório
|
||||
<translation>Pin:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
<source>ALL</source>
|
||||
<translation type="unfinished">TODOS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>E-Mail Addresses</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDImagePickerModel</name>
|
||||
<message>
|
||||
|
375
lib/rdgrouplistmodel.cpp
Normal file
375
lib/rdgrouplistmodel.cpp
Normal file
@ -0,0 +1,375 @@
|
||||
// rdgrouplistmodel.cpp
|
||||
//
|
||||
// Data model for Rivendell groups
|
||||
//
|
||||
// (C) Copyright 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
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// 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, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include "rdescape_string.h"
|
||||
#include "rdgrouplistmodel.h"
|
||||
|
||||
RDGroupListModel::RDGroupListModel(QObject *parent)
|
||||
: QAbstractTableModel(parent)
|
||||
{
|
||||
d_service_names.push_back(tr("ALL"));
|
||||
d_log_icons=new RDLogIcons();
|
||||
|
||||
//
|
||||
// Column Attributes
|
||||
//
|
||||
unsigned left=Qt::AlignLeft|Qt::AlignVCenter;
|
||||
unsigned center=Qt::AlignCenter;
|
||||
// unsigned right=Qt::AlignRight|Qt::AlignVCenter;
|
||||
|
||||
d_headers.push_back(tr("Name"));
|
||||
d_alignments.push_back(left);
|
||||
|
||||
d_headers.push_back(tr("Description"));
|
||||
d_alignments.push_back(left);
|
||||
|
||||
d_headers.push_back(tr("Start Cart"));
|
||||
d_alignments.push_back(center);
|
||||
|
||||
d_headers.push_back(tr("End Cart"));
|
||||
d_alignments.push_back(center);
|
||||
|
||||
d_headers.push_back(tr("Enforce Range"));
|
||||
d_alignments.push_back(center);
|
||||
|
||||
d_headers.push_back(tr("E-Mail Addresses"));
|
||||
d_alignments.push_back(left);
|
||||
|
||||
d_headers.push_back(tr("Traffic Report"));
|
||||
d_alignments.push_back(center);
|
||||
|
||||
d_headers.push_back(tr("Music Report"));
|
||||
d_alignments.push_back(center);
|
||||
|
||||
d_headers.push_back(tr("Now & Next"));
|
||||
d_alignments.push_back(center);
|
||||
}
|
||||
|
||||
|
||||
RDGroupListModel::~RDGroupListModel()
|
||||
{
|
||||
delete d_log_icons;
|
||||
}
|
||||
|
||||
|
||||
QPalette RDGroupListModel::palette()
|
||||
{
|
||||
return d_palette;
|
||||
}
|
||||
|
||||
|
||||
void RDGroupListModel::setPalette(const QPalette &pal)
|
||||
{
|
||||
d_palette=pal;
|
||||
}
|
||||
|
||||
|
||||
void RDGroupListModel::setFont(const QFont &font)
|
||||
{
|
||||
d_font=font;
|
||||
d_bold_font=font;
|
||||
d_bold_font.setWeight(QFont::Bold);
|
||||
}
|
||||
|
||||
|
||||
int RDGroupListModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
return d_headers.size();
|
||||
}
|
||||
|
||||
|
||||
int RDGroupListModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
return d_texts.size();
|
||||
}
|
||||
|
||||
|
||||
QVariant RDGroupListModel::headerData(int section,Qt::Orientation orient,
|
||||
int role) const
|
||||
{
|
||||
if((orient==Qt::Horizontal)&&(role==Qt::DisplayRole)) {
|
||||
return d_headers.at(section);
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
QVariant RDGroupListModel::data(const QModelIndex &index,int role) const
|
||||
{
|
||||
QString str;
|
||||
int col=index.column();
|
||||
int row=index.row();
|
||||
|
||||
if(row<d_texts.size()) {
|
||||
switch((Qt::ItemDataRole)role) {
|
||||
case Qt::DisplayRole:
|
||||
return d_texts.at(row).at(col);
|
||||
|
||||
case Qt::DecorationRole:
|
||||
if(col==0) {
|
||||
return d_icons.at(row);
|
||||
}
|
||||
break;
|
||||
|
||||
case Qt::TextAlignmentRole:
|
||||
return d_alignments.at(col);
|
||||
|
||||
case Qt::FontRole:
|
||||
if(col==0) {
|
||||
return d_bold_font;
|
||||
}
|
||||
return d_font;
|
||||
|
||||
case Qt::TextColorRole:
|
||||
if(col==0) {
|
||||
return d_colors.at(row);
|
||||
}
|
||||
break;
|
||||
|
||||
case Qt::BackgroundRole:
|
||||
// Nothing to do!
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
QString RDGroupListModel::groupName(const QModelIndex &row) const
|
||||
{
|
||||
return d_texts.at(row.row()).at(0).toString();
|
||||
}
|
||||
|
||||
|
||||
QModelIndex RDGroupListModel::addGroup(const QString &grpname)
|
||||
{
|
||||
//
|
||||
// Find the insertion offset
|
||||
//
|
||||
int offset=d_texts.size();
|
||||
for(int i=0;i<d_texts.size();i++) {
|
||||
if(grpname<d_texts.at(i).at(0).toString()) {
|
||||
offset=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
beginInsertRows(QModelIndex(),offset,offset);
|
||||
QList<QVariant> list;
|
||||
for(int i=0;i<columnCount();i++) {
|
||||
list.push_back(QVariant());
|
||||
}
|
||||
list[0]=grpname;
|
||||
d_texts.insert(offset,list);
|
||||
d_colors.insert(offset,QVariant());
|
||||
d_icons.insert(offset,QVariant());
|
||||
updateRowLine(offset);
|
||||
endInsertRows();
|
||||
|
||||
return createIndex(offset,0);
|
||||
}
|
||||
|
||||
|
||||
QModelIndex RDGroupListModel::renameGroup(const QString &oldname,
|
||||
const QString &newname)
|
||||
{
|
||||
removeGroup(oldname);
|
||||
for(int i=0;i<d_texts.size();i++) {
|
||||
if(d_texts.at(i).at(0)==newname) { // Merged to an existing group?
|
||||
updateRowLine(i);
|
||||
return createIndex(i,0);
|
||||
}
|
||||
}
|
||||
return addGroup(newname);
|
||||
}
|
||||
|
||||
|
||||
void RDGroupListModel::removeGroup(const QModelIndex &row)
|
||||
{
|
||||
beginRemoveRows(QModelIndex(),row.row(),row.row());
|
||||
|
||||
d_texts.removeAt(row.row());
|
||||
d_colors.removeAt(row.row());
|
||||
d_icons.removeAt(row.row());
|
||||
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
|
||||
void RDGroupListModel::removeGroup(const QString &grpname)
|
||||
{
|
||||
for(int i=0;i<d_texts.size();i++) {
|
||||
if(d_texts.at(i).at(0)==grpname) {
|
||||
removeGroup(createIndex(i,0));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RDGroupListModel::refresh(const QModelIndex &row)
|
||||
{
|
||||
if(row.row()<d_texts.size()) {
|
||||
QString sql=sqlFields()+
|
||||
"where NAME=\""+RDEscapeString(d_texts.at(row.row()).at(0).toString())+
|
||||
"\"";
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
updateRow(row.row(),q);
|
||||
emit dataChanged(createIndex(row.row(),0),
|
||||
createIndex(row.row(),columnCount()));
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RDGroupListModel::refresh(const QString &grpname)
|
||||
{
|
||||
for(int i=0;i<d_texts.size();i++) {
|
||||
if(d_texts.at(i).at(0)==grpname) {
|
||||
updateRowLine(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RDGroupListModel::setFilterSql(const QString &sql)
|
||||
{
|
||||
updateModel(sql);
|
||||
}
|
||||
|
||||
|
||||
void RDGroupListModel::updateModel(const QString &filter_sql)
|
||||
{
|
||||
RDSqlQuery *q=NULL;
|
||||
QString sql=sqlFields();
|
||||
if(!filter_sql.isEmpty()) {
|
||||
sql+="where "+
|
||||
filter_sql;
|
||||
}
|
||||
sql+="order by NAME ";
|
||||
beginResetModel();
|
||||
d_texts.clear();
|
||||
d_colors.clear();
|
||||
d_icons.clear();
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
QList<QVariant> texts;
|
||||
d_texts.push_back(texts);
|
||||
d_colors.push_back(QVariant());
|
||||
QList<QVariant> icons;
|
||||
d_icons.push_back(icons);
|
||||
updateRow(d_texts.size()-1,q);
|
||||
}
|
||||
delete q;
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
||||
void RDGroupListModel::updateRowLine(int line)
|
||||
{
|
||||
if(line<d_texts.size()) {
|
||||
QString sql=sqlFields()+
|
||||
"where NAME=\""+RDEscapeString(d_texts.at(line).at(0).toString())+"\"";
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
updateRow(line,q);
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RDGroupListModel::updateRow(int row,RDSqlQuery *q)
|
||||
{
|
||||
QList<QVariant> texts;
|
||||
|
||||
// Group Name
|
||||
texts.push_back(q->value(0));
|
||||
d_colors[row]=QColor(q->value(10).toString());
|
||||
if(q->value(5).toInt()==RDCart::Macro) {
|
||||
d_icons[row]=d_log_icons->typeIcon(RDLogLine::Macro);
|
||||
}
|
||||
else {
|
||||
d_icons[row]=d_log_icons->typeIcon(RDLogLine::Cart);
|
||||
}
|
||||
|
||||
// Description
|
||||
texts.push_back(q->value(1));
|
||||
|
||||
// Start Cart
|
||||
if(q->value(2).toUInt()==0) {
|
||||
texts.push_back(tr("[none]"));
|
||||
}
|
||||
else {
|
||||
texts.push_back(QString().sprintf("%06u",q->value(2).toUInt()));
|
||||
}
|
||||
|
||||
// End Cart
|
||||
if(q->value(3).toUInt()==0) {
|
||||
texts.push_back(tr("[none]"));
|
||||
}
|
||||
else {
|
||||
texts.push_back(QString().sprintf("%06u",q->value(3).toUInt()));
|
||||
}
|
||||
|
||||
// Enforce Range
|
||||
texts.push_back(q->value(4));
|
||||
|
||||
// Notification E-Mail Addresses
|
||||
texts.push_back(q->value(6));
|
||||
|
||||
// Traffic Report
|
||||
texts.push_back(q->value(7));
|
||||
|
||||
// Music Report
|
||||
texts.push_back(q->value(8));
|
||||
|
||||
// Now & Next
|
||||
texts.push_back(q->value(9));
|
||||
|
||||
d_texts[row]=texts;
|
||||
}
|
||||
|
||||
|
||||
QString RDGroupListModel::sqlFields() const
|
||||
{
|
||||
QString sql=QString("select ")+
|
||||
"NAME,"+ // 00
|
||||
"DESCRIPTION,"+ // 01
|
||||
"DEFAULT_LOW_CART,"+ // 02
|
||||
"DEFAULT_HIGH_CART,"+ // 03
|
||||
"ENFORCE_CART_RANGE,"+ // 04
|
||||
"DEFAULT_CART_TYPE,"+ // 05
|
||||
"NOTIFY_EMAIL_ADDRESS," // 06
|
||||
"REPORT_TFC,"+ // 07
|
||||
"REPORT_MUS,"+ // 08
|
||||
"ENABLE_NOW_NEXT,"+ // 09
|
||||
"COLOR "+ // 10
|
||||
"from GROUPS ";
|
||||
|
||||
return sql;
|
||||
}
|
78
lib/rdgrouplistmodel.h
Normal file
78
lib/rdgrouplistmodel.h
Normal file
@ -0,0 +1,78 @@
|
||||
// rdgrouplistmodel.h
|
||||
//
|
||||
// Data model for Rivendell groups
|
||||
//
|
||||
// (C) Copyright 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
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// 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, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef RDGROUPLISTMODEL_H
|
||||
#define RDGROUPLISTMODEL_H
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include <QFont>
|
||||
#include <QList>
|
||||
#include <QPalette>
|
||||
|
||||
#include <rddb.h>
|
||||
#include <rdlog_icons.h>
|
||||
#include <rdnotification.h>
|
||||
|
||||
class RDGroupListModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RDGroupListModel(QObject *parent=0);
|
||||
~RDGroupListModel();
|
||||
QPalette palette();
|
||||
void setPalette(const QPalette &pal);
|
||||
void setFont(const QFont &font);
|
||||
int columnCount(const QModelIndex &parent=QModelIndex()) const;
|
||||
int rowCount(const QModelIndex &parent=QModelIndex()) const;
|
||||
QVariant headerData(int section,Qt::Orientation orient,
|
||||
int role=Qt::DisplayRole) const;
|
||||
QVariant data(const QModelIndex &index,int role=Qt::DisplayRole) const;
|
||||
QString groupName(const QModelIndex &row) const;
|
||||
QModelIndex addGroup(const QString &name);
|
||||
QModelIndex renameGroup(const QString &oldname,const QString &newname);
|
||||
void removeGroup(const QModelIndex &row);
|
||||
void removeGroup(const QString &grpname);
|
||||
void refresh(const QModelIndex &row);
|
||||
void refresh(const QString &grpname);
|
||||
|
||||
public slots:
|
||||
void setFilterSql(const QString &sql);
|
||||
|
||||
protected:
|
||||
void updateModel(const QString &filter_sql);
|
||||
void updateRowLine(int line);
|
||||
void updateRow(int row,RDSqlQuery *q);
|
||||
QString sqlFields() const;
|
||||
|
||||
private:
|
||||
QPalette d_palette;
|
||||
QFont d_font;
|
||||
QFont d_bold_font;
|
||||
QStringList d_service_names;
|
||||
QList<QVariant> d_headers;
|
||||
QList<QVariant> d_alignments;
|
||||
QList<QList<QVariant> > d_texts;
|
||||
QList<QVariant> d_icons;
|
||||
QList<QVariant> d_colors;
|
||||
RDLogIcons *d_log_icons;
|
||||
};
|
||||
|
||||
|
||||
#endif // RDGROUPLISTMODEL_H
|
@ -205,16 +205,16 @@ void AddGroup::okData()
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
delete group;
|
||||
done(-1);
|
||||
done(false);
|
||||
return;
|
||||
}
|
||||
delete group;
|
||||
*group_group=group_name_edit->text();
|
||||
done(0);
|
||||
done(true);
|
||||
}
|
||||
|
||||
|
||||
void AddGroup::cancelData()
|
||||
{
|
||||
done(-1);
|
||||
done(false);
|
||||
}
|
||||
|
@ -427,13 +427,13 @@ void EditGroup::okData()
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
|
||||
done(0);
|
||||
done(true);
|
||||
}
|
||||
|
||||
|
||||
void EditGroup::cancelData()
|
||||
{
|
||||
done(-1);
|
||||
done(false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// List Rivendell Groups
|
||||
//
|
||||
// (C) Copyright 2002-2020 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
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <qmessagebox.h>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <rdapplication.h>
|
||||
#include <rdcart.h>
|
||||
@ -38,8 +38,6 @@
|
||||
ListGroups::ListGroups(QWidget *parent)
|
||||
: RDDialog(parent)
|
||||
{
|
||||
setModal(true);
|
||||
|
||||
//
|
||||
// Fix the Window Size
|
||||
//
|
||||
@ -99,6 +97,24 @@ ListGroups::ListGroups(QWidget *parent)
|
||||
//
|
||||
// Group List
|
||||
//
|
||||
list_groups_view=new QTableView(this);
|
||||
list_groups_view->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
list_groups_view->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
list_groups_view->setShowGrid(false);
|
||||
list_groups_view->setSortingEnabled(false);
|
||||
list_groups_view->setWordWrap(false);
|
||||
list_groups_model=new RDGroupListModel(this);
|
||||
list_groups_model->setFont(defaultFont());
|
||||
list_groups_model->setPalette(palette());
|
||||
list_groups_view->setModel(list_groups_model);
|
||||
list_groups_view->resizeColumnsToContents();
|
||||
connect(list_groups_view,SIGNAL(doubleClicked(const QModelIndex &)),
|
||||
this,SLOT(doubleClickedData(const QModelIndex &)));
|
||||
connect(list_groups_model,SIGNAL(modelReset()),this,SLOT(modelResetData()));
|
||||
|
||||
list_groups_model->setFilterSql(QString());
|
||||
|
||||
/*
|
||||
list_groups_view=new RDListView(this);
|
||||
list_groups_view->setAllColumnsShowFocus(true);
|
||||
list_groups_view->addColumn(tr("Name"));
|
||||
@ -124,8 +140,9 @@ ListGroups::ListGroups(QWidget *parent)
|
||||
SIGNAL(doubleClicked(Q3ListViewItem *,const QPoint &,int)),
|
||||
this,
|
||||
SLOT(doubleClickedData(Q3ListViewItem *,const QPoint &,int)));
|
||||
*/
|
||||
|
||||
RefreshList();
|
||||
// RefreshList();
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +153,7 @@ ListGroups::~ListGroups()
|
||||
|
||||
QSize ListGroups::sizeHint() const
|
||||
{
|
||||
return QSize(640,480);
|
||||
return QSize(1024,750);
|
||||
}
|
||||
|
||||
|
||||
@ -148,77 +165,87 @@ QSizePolicy ListGroups::sizePolicy() const
|
||||
|
||||
void ListGroups::addData()
|
||||
{
|
||||
QString group;
|
||||
QString grpname;
|
||||
|
||||
AddGroup *add_group=new AddGroup(&group,this);
|
||||
if(add_group->exec()<0) {
|
||||
AddGroup *add_group=new AddGroup(&grpname,this);
|
||||
if(!add_group->exec()) {
|
||||
delete add_group;
|
||||
return;
|
||||
}
|
||||
delete add_group;
|
||||
add_group=NULL;
|
||||
RDListViewItem *item=new RDListViewItem(list_groups_view);
|
||||
item->setText(0,group);
|
||||
RefreshItem(item);
|
||||
item->setSelected(true);
|
||||
list_groups_view->setCurrentItem(item);
|
||||
list_groups_view->ensureItemVisible(item);
|
||||
QModelIndex index=list_groups_model->addGroup(grpname);
|
||||
if(index.isValid()) {
|
||||
list_groups_view->selectRow(index.row());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ListGroups::editData()
|
||||
{
|
||||
RDListViewItem *item=(RDListViewItem *)list_groups_view->selectedItem();
|
||||
if(item==NULL) {
|
||||
QModelIndexList rows=list_groups_view->selectionModel()->selectedRows();
|
||||
|
||||
if(rows.size()!=1) {
|
||||
return;
|
||||
}
|
||||
EditGroup *edit_group=new EditGroup(item->text(0),this);
|
||||
edit_group->exec();
|
||||
EditGroup *edit_group=
|
||||
new EditGroup(list_groups_model->groupName(rows.first()),this);
|
||||
if(edit_group->exec()) {
|
||||
list_groups_model->refresh(rows.first());
|
||||
}
|
||||
delete edit_group;
|
||||
edit_group=NULL;
|
||||
RefreshItem(item);
|
||||
}
|
||||
|
||||
|
||||
void ListGroups::renameData()
|
||||
{
|
||||
RDListViewItem *item=(RDListViewItem *)list_groups_view->selectedItem();
|
||||
if(item==NULL) {
|
||||
QModelIndexList rows=list_groups_view->selectionModel()->selectedRows();
|
||||
|
||||
if(rows.size()!=1) {
|
||||
return;
|
||||
}
|
||||
|
||||
QString groupname=item->text(0);
|
||||
RenameGroup *rename_group=new RenameGroup(groupname,this);
|
||||
rename_group->exec();
|
||||
QString grpname=list_groups_model->groupName(rows.first());
|
||||
QString newgrpname;
|
||||
RenameGroup *rename_group=new RenameGroup(grpname,this);
|
||||
if(rename_group->exec(&newgrpname)) {
|
||||
QModelIndex index=list_groups_model->renameGroup(grpname,newgrpname);
|
||||
if(index.isValid()) {
|
||||
list_groups_view->selectRow(index.row());
|
||||
}
|
||||
}
|
||||
delete rename_group;
|
||||
rename_group=NULL;
|
||||
RefreshList();
|
||||
}
|
||||
|
||||
|
||||
void ListGroups::deleteData()
|
||||
{
|
||||
RDListViewItem *item=(RDListViewItem *)list_groups_view->selectedItem();
|
||||
if(item==NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
RDSqlQuery *q=NULL;
|
||||
QString warning;
|
||||
int carts=0;
|
||||
QModelIndexList rows=list_groups_view->selectionModel()->selectedRows();
|
||||
|
||||
QString groupname=item->text(0);
|
||||
if(groupname.isEmpty()) {
|
||||
if(rows.size()!=1) {
|
||||
return;
|
||||
}
|
||||
sql=QString("select NUMBER from CART where ")+
|
||||
"GROUP_NAME=\""+RDEscapeString(groupname)+"\"";
|
||||
|
||||
|
||||
QString grpname=list_groups_model->groupName(rows.first());
|
||||
if(grpname.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
sql=QString("select ")+
|
||||
"NUMBER "+ // 00
|
||||
"from CART where "+
|
||||
"GROUP_NAME=\""+RDEscapeString(grpname)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
if((carts=q->size())>0) {
|
||||
warning=QString().sprintf("%d ",carts)+tr("member carts will be deleted along with group")+" \""+groupname+"\"!";
|
||||
warning=QString().sprintf("%d ",carts)+tr("member carts will be deleted along with group")+" \""+grpname+"\"!\n";
|
||||
}
|
||||
warning+=tr("Are you sure you want to delete group")+" \""+groupname+"\"?";
|
||||
warning+=tr("Are you sure you want to delete group")+" \""+grpname+"\"?";
|
||||
switch(QMessageBox::warning(this,tr("Delete Group"),warning,
|
||||
QMessageBox::Yes,QMessageBox::No)) {
|
||||
case QMessageBox::No:
|
||||
@ -245,35 +272,30 @@ void ListGroups::deleteData()
|
||||
// Delete Member Audio Perms
|
||||
//
|
||||
sql=QString("delete from AUDIO_PERMS where ")+
|
||||
"GROUP_NAME=\""+RDEscapeString(groupname)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
"GROUP_NAME=\""+RDEscapeString(grpname)+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
|
||||
//
|
||||
// Delete Member User Perms
|
||||
//
|
||||
sql=QString("delete from USER_PERMS where ")+
|
||||
"GROUP_NAME=\""+RDEscapeString(groupname)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
"GROUP_NAME=\""+RDEscapeString(grpname)+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
|
||||
//
|
||||
// Delete Replicator Map Records
|
||||
//
|
||||
sql=QString("delete from REPLICATOR_MAP where ")+
|
||||
"GROUP_NAME=\""+RDEscapeString(groupname)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
"GROUP_NAME=\""+RDEscapeString(grpname)+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
|
||||
//
|
||||
// Delete from Group List
|
||||
//
|
||||
sql=QString("delete from GROUPS where ")+
|
||||
"NAME=\""+RDEscapeString(groupname)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
item->setSelected(false);
|
||||
delete item;
|
||||
"NAME=\""+RDEscapeString(grpname)+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
list_groups_model->removeGroup(grpname);
|
||||
}
|
||||
|
||||
|
||||
@ -380,16 +402,21 @@ void ListGroups::reportData()
|
||||
}
|
||||
|
||||
|
||||
void ListGroups::doubleClickedData(Q3ListViewItem *item,const QPoint &pt,
|
||||
int col)
|
||||
void ListGroups::doubleClickedData(const QModelIndex &index)
|
||||
{
|
||||
editData();
|
||||
}
|
||||
|
||||
|
||||
void ListGroups::modelResetData()
|
||||
{
|
||||
list_groups_view->resizeColumnsToContents();
|
||||
}
|
||||
|
||||
|
||||
void ListGroups::closeData()
|
||||
{
|
||||
done(0);
|
||||
done(true);
|
||||
}
|
||||
|
||||
|
||||
@ -407,6 +434,7 @@ void ListGroups::resizeEvent(QResizeEvent *e)
|
||||
|
||||
void ListGroups::RefreshList()
|
||||
{
|
||||
/*
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
RDListViewItem *item;
|
||||
@ -430,11 +458,13 @@ void ListGroups::RefreshList()
|
||||
WriteItem(item,q);
|
||||
}
|
||||
delete q;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void ListGroups::RefreshItem(RDListViewItem *item)
|
||||
{
|
||||
/*
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
@ -456,9 +486,10 @@ void ListGroups::RefreshItem(RDListViewItem *item)
|
||||
WriteItem(item,q);
|
||||
}
|
||||
delete q;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void ListGroups::WriteItem(RDListViewItem *item,RDSqlQuery *q)
|
||||
{
|
||||
item->setText(0,q->value(0).toString());
|
||||
@ -490,3 +521,4 @@ void ListGroups::WriteItem(RDListViewItem *item,RDSqlQuery *q)
|
||||
item->setText(7,q->value(7).toString());
|
||||
item->setText(8,q->value(8).toString());
|
||||
}
|
||||
*/
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// List Rivendell Groups
|
||||
//
|
||||
// (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
|
||||
@ -21,11 +21,13 @@
|
||||
#ifndef LIST_GROUPS_H
|
||||
#define LIST_GROUPS_H
|
||||
|
||||
#include <qpushbutton.h>
|
||||
#include <QPushButton>
|
||||
#include <QTableView>
|
||||
|
||||
#include <rddb.h>
|
||||
#include <rddialog.h>
|
||||
#include <rdlistviewitem.h>
|
||||
#include <rdgrouplistmodel.h>
|
||||
//#include <rdlistviewitem.h>
|
||||
|
||||
class ListGroups : public RDDialog
|
||||
{
|
||||
@ -42,7 +44,9 @@ class ListGroups : public RDDialog
|
||||
void renameData();
|
||||
void deleteData();
|
||||
void reportData();
|
||||
void doubleClickedData(Q3ListViewItem *item,const QPoint &pt,int col);
|
||||
void doubleClickedData(const QModelIndex &index);
|
||||
// void doubleClickedData(Q3ListViewItem *item,const QPoint &pt,int col);
|
||||
void modelResetData();
|
||||
void closeData();
|
||||
|
||||
protected:
|
||||
@ -51,8 +55,10 @@ class ListGroups : public RDDialog
|
||||
private:
|
||||
void RefreshList();
|
||||
void RefreshItem(RDListViewItem *item);
|
||||
void WriteItem(RDListViewItem *item,RDSqlQuery *q);
|
||||
RDListView *list_groups_view;
|
||||
// void WriteItem(RDListViewItem *item,RDSqlQuery *q);
|
||||
// RDListView *list_groups_view;
|
||||
QTableView *list_groups_view;
|
||||
RDGroupListModel *list_groups_model;
|
||||
QPushButton *list_add_button;
|
||||
QPushButton *list_edit_button;
|
||||
QPushButton *list_rename_button;
|
||||
|
@ -5589,55 +5589,19 @@ Stále ještě jej chcete smazat?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Groups:</source>
|
||||
<translation>&Skupiny:</translation>
|
||||
<translation type="obsolete">&Skupiny:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>member carts will be deleted along with group</source>
|
||||
<translation>Členské vozíky budou smazány se skupinou</translation>
|
||||
<translation type="unfinished">Členské vozíky budou smazány se skupinou</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to delete group</source>
|
||||
<translation>Opravdu chcete smazat tuto skupinu</translation>
|
||||
<translation type="unfinished">Opravdu chcete smazat tuto skupinu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete Group</source>
|
||||
<translation>Smazat skupinu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Default Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="unfinished">Smazat skupinu</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -5287,55 +5287,19 @@ Generieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Groups:</source>
|
||||
<translation>&Gruppen:</translation>
|
||||
<translation type="obsolete">&Gruppen:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>member carts will be deleted along with group</source>
|
||||
<translation>Mitgliedscarts werden mit der Gruppe gelöscht</translation>
|
||||
<translation type="unfinished">Mitgliedscarts werden mit der Gruppe gelöscht</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to delete group</source>
|
||||
<translation>Sind Sie sicher, daß sie diese Gruppr löschen wollen</translation>
|
||||
<translation type="unfinished">Sind Sie sicher, daß sie diese Gruppr löschen wollen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete Group</source>
|
||||
<translation>Gruppe löschen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Default Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="unfinished">Gruppe löschen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -5540,55 +5540,19 @@ Do you still want to delete it?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Groups:</source>
|
||||
<translation>&Grupos:</translation>
|
||||
<translation type="obsolete">&Grupos:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>member carts will be deleted along with group</source>
|
||||
<translation>cartuchos serán borrados junto con el grupo</translation>
|
||||
<translation type="unfinished">cartuchos serán borrados junto con el grupo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to delete group</source>
|
||||
<translation>Desea eliminar el grupo</translation>
|
||||
<translation type="unfinished">Desea eliminar el grupo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete Group</source>
|
||||
<translation>Borrar grupo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Default Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="unfinished">Borrar grupo</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -4343,10 +4343,6 @@ Permissions</source>
|
||||
<source>&Close</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Groups:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>member carts will be deleted along with group</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@ -4359,42 +4355,6 @@ Permissions</source>
|
||||
<source>Delete Group</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Default Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListHostvars</name>
|
||||
|
@ -5156,55 +5156,19 @@ Klikk på "Lisens"-knappen for fleire opplysningar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Groups:</source>
|
||||
<translation>&Grupper:</translation>
|
||||
<translation type="obsolete">&Grupper:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>member carts will be deleted along with group</source>
|
||||
<translation>medlemskorger blir sletta saman med gruppa</translation>
|
||||
<translation type="unfinished">medlemskorger blir sletta saman med gruppa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to delete group</source>
|
||||
<translation>Er du sikker på at du vil sletta gruppa</translation>
|
||||
<translation type="unfinished">Er du sikker på at du vil sletta gruppa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete Group</source>
|
||||
<translation>Slett gruppa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Default Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="unfinished">Slett gruppa</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -5156,55 +5156,19 @@ Klikk på "Lisens"-knappen for fleire opplysningar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Groups:</source>
|
||||
<translation>&Grupper:</translation>
|
||||
<translation type="obsolete">&Grupper:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>member carts will be deleted along with group</source>
|
||||
<translation>medlemskorger blir sletta saman med gruppa</translation>
|
||||
<translation type="unfinished">medlemskorger blir sletta saman med gruppa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to delete group</source>
|
||||
<translation>Er du sikker på at du vil sletta gruppa</translation>
|
||||
<translation type="unfinished">Er du sikker på at du vil sletta gruppa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete Group</source>
|
||||
<translation>Slett gruppa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Default Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="unfinished">Slett gruppa</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -5267,55 +5267,19 @@ Você ainda quer Deletar?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Groups:</source>
|
||||
<translation>&Grupos:</translation>
|
||||
<translation type="obsolete">&Grupos:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>member carts will be deleted along with group</source>
|
||||
<translation>Cartões do Grupo serão deletados junto com o Grupo</translation>
|
||||
<translation type="unfinished">Cartões do Grupo serão deletados junto com o Grupo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to delete group</source>
|
||||
<translation>Tem certeza que quer deletar este grupo?</translation>
|
||||
<translation type="unfinished">Tem certeza que quer deletar este grupo?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete Group</source>
|
||||
<translation>Deletar Grupo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>End Cart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Default Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Traffic Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Music Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Now & Next</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="unfinished">Deletar Grupo</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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
|
||||
@ -35,14 +35,21 @@ class RenameGroup : public RDDialog
|
||||
QSize sizeHint() const;
|
||||
QSizePolicy sizePolicy() const;
|
||||
|
||||
public slots:
|
||||
int exec(QString *newname);
|
||||
|
||||
private slots:
|
||||
void okData();
|
||||
void cancelData();
|
||||
|
||||
private:
|
||||
QLineEdit *group_name_edit;
|
||||
QLineEdit *group_newname_edit;
|
||||
QString group_name;
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *e);
|
||||
|
||||
private:
|
||||
QLineEdit *group_name_edit;
|
||||
QLineEdit *group_newname_edit;
|
||||
QString group_name;
|
||||
QString *group_new_name;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user