mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-10 08:33:39 +02:00
2022-05-04 Fred Gleason <fredg@paravelsystems.com>
* Added an 'show_unchanged' argument to the constructor of the 'RDGroupListModel' model. * Modified the 'Edit Cart' dialog in rdlibrary(1) so as to default the 'Group:' and 'Usage:' controls to '[unchanged]' when opened in multi-edit mode. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -23036,3 +23036,9 @@
|
|||||||
in rdadmin(1).
|
in rdadmin(1).
|
||||||
2022-05-03 Fred Gleason <fredg@paravelsystems.com>
|
2022-05-03 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Updated the user logo for rdairplay(1).
|
* Updated the user logo for rdairplay(1).
|
||||||
|
2022-05-04 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Added an 'show_unchanged' argument to the constructor of the
|
||||||
|
'RDGroupListModel' model.
|
||||||
|
* Modified the 'Edit Cart' dialog in rdlibrary(1) so as to
|
||||||
|
default the 'Group:' and 'Usage:' controls to '[unchanged]' when
|
||||||
|
opened in multi-edit mode.
|
||||||
|
@@ -36,7 +36,7 @@ RDCartFilter::RDCartFilter(bool show_drag_box,bool user_is_admin,
|
|||||||
d_cart_model=NULL;
|
d_cart_model=NULL;
|
||||||
d_show_drag_box=show_drag_box;
|
d_show_drag_box=show_drag_box;
|
||||||
|
|
||||||
d_group_model=new RDGroupListModel(true,user_is_admin,this);
|
d_group_model=new RDGroupListModel(true,false,user_is_admin,this);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Filter Phrase
|
// Filter Phrase
|
||||||
|
@@ -22,11 +22,12 @@
|
|||||||
#include "rdescape_string.h"
|
#include "rdescape_string.h"
|
||||||
#include "rdgrouplistmodel.h"
|
#include "rdgrouplistmodel.h"
|
||||||
|
|
||||||
RDGroupListModel::RDGroupListModel(bool show_all,bool user_is_admin,
|
RDGroupListModel::RDGroupListModel(bool show_all,bool show_unchanged,
|
||||||
QObject *parent)
|
bool user_is_admin,QObject *parent)
|
||||||
: QAbstractTableModel(parent)
|
: QAbstractTableModel(parent)
|
||||||
{
|
{
|
||||||
d_show_all=show_all;
|
d_show_all=show_all;
|
||||||
|
d_show_unchanged=show_unchanged;
|
||||||
d_user_is_admin=user_is_admin;
|
d_user_is_admin=user_is_admin;
|
||||||
d_service_names.push_back(tr("ALL"));
|
d_service_names.push_back(tr("ALL"));
|
||||||
d_sort_column=0;
|
d_sort_column=0;
|
||||||
@@ -200,7 +201,7 @@ QStringList RDGroupListModel::allGroupNames() const
|
|||||||
{
|
{
|
||||||
QStringList ret;
|
QStringList ret;
|
||||||
|
|
||||||
if(d_show_all) {
|
if(d_show_all||d_show_unchanged) {
|
||||||
for(int i=1;i<d_texts.size();i++) {
|
for(int i=1;i<d_texts.size();i++) {
|
||||||
ret.push_back(d_texts.at(i).at(0).toString());
|
ret.push_back(d_texts.at(i).at(0).toString());
|
||||||
}
|
}
|
||||||
@@ -348,7 +349,6 @@ void RDGroupListModel::updateModel()
|
|||||||
|
|
||||||
RDSqlQuery *q=NULL;
|
RDSqlQuery *q=NULL;
|
||||||
QString sql=sqlFields()+filterSql();
|
QString sql=sqlFields()+filterSql();
|
||||||
// sql+="order by `NAME` ";
|
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
d_texts.clear();
|
d_texts.clear();
|
||||||
d_colors.clear();
|
d_colors.clear();
|
||||||
@@ -360,6 +360,12 @@ void RDGroupListModel::updateModel()
|
|||||||
d_colors.push_back(QVariant());
|
d_colors.push_back(QVariant());
|
||||||
d_icons.push_back(icons);
|
d_icons.push_back(icons);
|
||||||
}
|
}
|
||||||
|
if(d_show_unchanged) {
|
||||||
|
d_texts.push_back(texts);
|
||||||
|
d_texts.back().push_back(tr("[unchanged]"));
|
||||||
|
d_colors.push_back(QVariant());
|
||||||
|
d_icons.push_back(icons);
|
||||||
|
}
|
||||||
|
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
while(q->next()) {
|
while(q->next()) {
|
||||||
|
@@ -33,7 +33,8 @@ class RDGroupListModel : public QAbstractTableModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
RDGroupListModel(bool show_all,bool user_is_admin,QObject *parent=0);
|
RDGroupListModel(bool show_all,bool show_unchanged,bool user_is_admin,
|
||||||
|
QObject *parent);
|
||||||
~RDGroupListModel();
|
~RDGroupListModel();
|
||||||
QPalette palette();
|
QPalette palette();
|
||||||
void setPalette(const QPalette &pal);
|
void setPalette(const QPalette &pal);
|
||||||
@@ -75,6 +76,7 @@ class RDGroupListModel : public QAbstractTableModel
|
|||||||
QList<QVariant> d_icons;
|
QList<QVariant> d_icons;
|
||||||
QList<QVariant> d_colors;
|
QList<QVariant> d_colors;
|
||||||
bool d_show_all;
|
bool d_show_all;
|
||||||
|
bool d_show_unchanged;
|
||||||
bool d_user_is_admin;
|
bool d_user_is_admin;
|
||||||
QStringList d_visible_groups;
|
QStringList d_visible_groups;
|
||||||
QStringList d_column_fields;
|
QStringList d_column_fields;
|
||||||
|
@@ -42,7 +42,7 @@ RDListGroups::RDListGroups(QString *groupname,const QString &caption,
|
|||||||
group_group_view=new RDTableView(this);
|
group_group_view=new RDTableView(this);
|
||||||
group_group_view->setGeometry(10,10,
|
group_group_view->setGeometry(10,10,
|
||||||
sizeHint().width()-20,sizeHint().height()-80);
|
sizeHint().width()-20,sizeHint().height()-80);
|
||||||
group_group_model=new RDGroupListModel(false,false,this);
|
group_group_model=new RDGroupListModel(false,false,false,this);
|
||||||
group_group_model->setFont(font());
|
group_group_model->setFont(font());
|
||||||
group_group_model->setPalette(palette());
|
group_group_model->setPalette(palette());
|
||||||
group_group_view->setModel(group_group_model);
|
group_group_view->setModel(group_group_model);
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell Dropbox Configuration
|
// Edit a Rivendell Dropbox Configuration
|
||||||
//
|
//
|
||||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -58,7 +58,7 @@ EditDropbox::EditDropbox(int id,bool duplicate,QWidget *parent)
|
|||||||
//
|
//
|
||||||
box_group_name_box=new QComboBox(this);
|
box_group_name_box=new QComboBox(this);
|
||||||
box_group_name_box->setGeometry(140,10,100,20);
|
box_group_name_box->setGeometry(140,10,100,20);
|
||||||
box_group_name_model=new RDGroupListModel(true,true,this);
|
box_group_name_model=new RDGroupListModel(true,false,true,this);
|
||||||
box_group_name_model->setFont(defaultFont());
|
box_group_name_model->setFont(defaultFont());
|
||||||
box_group_name_model->setPalette(palette());
|
box_group_name_model->setPalette(palette());
|
||||||
box_group_name_box->setModel(box_group_name_model);
|
box_group_name_box->setModel(box_group_name_model);
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit Rivendell System-Wide Configuration
|
// Edit Rivendell System-Wide Configuration
|
||||||
//
|
//
|
||||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -148,7 +148,7 @@ EditSystem::EditSystem(QWidget *parent)
|
|||||||
// Temporary Cart Group
|
// Temporary Cart Group
|
||||||
//
|
//
|
||||||
edit_temp_cart_group_box=new RDComboBox(this);
|
edit_temp_cart_group_box=new RDComboBox(this);
|
||||||
edit_temp_cart_group_model=new RDGroupListModel(false,true,this);
|
edit_temp_cart_group_model=new RDGroupListModel(false,false,true,this);
|
||||||
edit_temp_cart_group_box->setModel(edit_temp_cart_group_model);
|
edit_temp_cart_group_box->setModel(edit_temp_cart_group_model);
|
||||||
edit_temp_cart_group_label=new QLabel(tr("Temporary Cart Group:"),this);
|
edit_temp_cart_group_label=new QLabel(tr("Temporary Cart Group:"),this);
|
||||||
edit_temp_cart_group_label->setFont(labelFont());
|
edit_temp_cart_group_label->setFont(labelFont());
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// List Rivendell Groups
|
// List Rivendell Groups
|
||||||
//
|
//
|
||||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -98,7 +98,7 @@ ListGroups::ListGroups(QWidget *parent)
|
|||||||
list_groups_view=new RDTableView(this);
|
list_groups_view=new RDTableView(this);
|
||||||
list_groups_view->setSortingEnabled(true);
|
list_groups_view->setSortingEnabled(true);
|
||||||
list_groups_view->sortByColumn(0,Qt::AscendingOrder);
|
list_groups_view->sortByColumn(0,Qt::AscendingOrder);
|
||||||
list_groups_model=new RDGroupListModel(false,true,this);
|
list_groups_model=new RDGroupListModel(false,false,true,this);
|
||||||
list_groups_model->setFont(defaultFont());
|
list_groups_model->setFont(defaultFont());
|
||||||
list_groups_model->setPalette(palette());
|
list_groups_model->setPalette(palette());
|
||||||
list_groups_view->setModel(list_groups_model);
|
list_groups_view->setModel(list_groups_model);
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell Cart
|
// Edit a Rivendell Cart
|
||||||
//
|
//
|
||||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -109,7 +109,7 @@ EditCart::EditCart(const QList<unsigned> &cartnums,QString *path,bool new_cart,
|
|||||||
else {
|
else {
|
||||||
rdcart_group_box->setGeometry(135,38,110,21);
|
rdcart_group_box->setGeometry(135,38,110,21);
|
||||||
}
|
}
|
||||||
rdcart_group_model=new RDGroupListModel(false,false,this);
|
rdcart_group_model=new RDGroupListModel(false,cartnums.size()>1,false,this);
|
||||||
rdcart_group_box->setModel(rdcart_group_model);
|
rdcart_group_box->setModel(rdcart_group_model);
|
||||||
rdcart_group_edit=new QLineEdit(this);
|
rdcart_group_edit=new QLineEdit(this);
|
||||||
rdcart_group_edit->setGeometry(280,11,140,21);
|
rdcart_group_edit->setGeometry(280,11,140,21);
|
||||||
@@ -270,11 +270,11 @@ EditCart::EditCart(const QList<unsigned> &cartnums,QString *path,bool new_cart,
|
|||||||
rdcart_usage_box=new QComboBox(this);
|
rdcart_usage_box=new QComboBox(this);
|
||||||
rdcart_usage_box->setGeometry(270,110,150,21);
|
rdcart_usage_box->setGeometry(270,110,150,21);
|
||||||
if(cartnums.size()>1) {
|
if(cartnums.size()>1) {
|
||||||
rdcart_usage_box->insertItem(0,"");
|
rdcart_usage_box->insertItem(0,tr("[unchanged]"),-1);
|
||||||
}
|
}
|
||||||
for(int i=0;i<(int)RDCart::UsageLast;i++) {
|
for(int i=0;i<(int)RDCart::UsageLast;i++) {
|
||||||
rdcart_usage_box->insertItem(rdcart_usage_box->count(),
|
rdcart_usage_box->insertItem(rdcart_usage_box->count(),
|
||||||
RDCart::usageText((RDCart::UsageCode)i));
|
RDCart::usageText((RDCart::UsageCode)i),i);
|
||||||
}
|
}
|
||||||
QLabel *label=new QLabel(tr("Usage:"),this);
|
QLabel *label=new QLabel(tr("Usage:"),this);
|
||||||
label->setGeometry(195,112,70,21);
|
label->setGeometry(195,112,70,21);
|
||||||
@@ -613,7 +613,12 @@ EditCart::EditCart(const QList<unsigned> &cartnums,QString *path,bool new_cart,
|
|||||||
rdcart_controls.conductor_edit->setText(rdcart_cart->conductor());
|
rdcart_controls.conductor_edit->setText(rdcart_cart->conductor());
|
||||||
rdcart_controls.composer_edit->setText(rdcart_cart->composer());
|
rdcart_controls.composer_edit->setText(rdcart_cart->composer());
|
||||||
rdcart_controls.user_defined_edit->setText(rdcart_cart->userDefined());
|
rdcart_controls.user_defined_edit->setText(rdcart_cart->userDefined());
|
||||||
rdcart_usage_box->setCurrentIndex((int)rdcart_cart->usageCode());
|
//rdcart_usage_box->setCurrentIndex((int)rdcart_cart->usageCode());
|
||||||
|
for(int i=0;i<rdcart_usage_box->count();i++) {
|
||||||
|
if(rdcart_usage_box->itemData(i).toInt()==(int)rdcart_cart->usageCode()) {
|
||||||
|
rdcart_usage_box->setCurrentIndex(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
rdcart_usage_edit->
|
rdcart_usage_edit->
|
||||||
setText(RDCart::usageText((RDCart::UsageCode)rdcart_usage_box->
|
setText(RDCart::usageText((RDCart::UsageCode)rdcart_usage_box->
|
||||||
currentIndex()));
|
currentIndex()));
|
||||||
@@ -623,12 +628,8 @@ EditCart::EditCart(const QList<unsigned> &cartnums,QString *path,bool new_cart,
|
|||||||
rdcart_cut_sched_box->setCurrentIndex(rdcart_cart->useWeighting());
|
rdcart_cut_sched_box->setCurrentIndex(rdcart_cart->useWeighting());
|
||||||
rdcart_cut_sched_edit->setText(rdcart_cut_sched_box->currentText());
|
rdcart_cut_sched_edit->setText(rdcart_cut_sched_box->currentText());
|
||||||
}
|
}
|
||||||
else {//multi edit
|
else { //Multi Edit
|
||||||
if(rdcart_group_box->count() == 0) {
|
rdcart_group_box->setCurrentIndex(0);
|
||||||
rdcart_group_box->insertItem("");
|
|
||||||
// PopulateGroupList();
|
|
||||||
rdcart_group_box->setCurrentIndex(0);
|
|
||||||
}
|
|
||||||
rdcart_usage_box->setCurrentIndex(0);
|
rdcart_usage_box->setCurrentIndex(0);
|
||||||
rdcart_notes_button->hide();
|
rdcart_notes_button->hide();
|
||||||
}
|
}
|
||||||
@@ -822,8 +823,11 @@ void EditCart::okData()
|
|||||||
rdcart_cart->setConductor(rdcart_controls.conductor_edit->text());
|
rdcart_cart->setConductor(rdcart_controls.conductor_edit->text());
|
||||||
rdcart_cart->setComposer(rdcart_controls.composer_edit->text());
|
rdcart_cart->setComposer(rdcart_controls.composer_edit->text());
|
||||||
rdcart_cart->setUserDefined(rdcart_controls.user_defined_edit->text());
|
rdcart_cart->setUserDefined(rdcart_controls.user_defined_edit->text());
|
||||||
|
// rdcart_cart->
|
||||||
|
// setUsageCode((RDCart::UsageCode)rdcart_usage_box->currentIndex());
|
||||||
rdcart_cart->
|
rdcart_cart->
|
||||||
setUsageCode((RDCart::UsageCode)rdcart_usage_box->currentIndex());
|
setUsageCode((RDCart::UsageCode)rdcart_usage_box->
|
||||||
|
itemData(rdcart_usage_box->currentIndex()).toInt());
|
||||||
if(rdcart_cart->type()==RDCart::Macro) {
|
if(rdcart_cart->type()==RDCart::Macro) {
|
||||||
rdcart_macro_cart->save();
|
rdcart_macro_cart->save();
|
||||||
rdcart_cart->setAsyncronous(rdcart_syncronous_box->isChecked());
|
rdcart_cart->setAsyncronous(rdcart_syncronous_box->isChecked());
|
||||||
@@ -837,7 +841,7 @@ void EditCart::okData()
|
|||||||
for(int i=0;i<rdcart_cart_numbers.size();i++) {
|
for(int i=0;i<rdcart_cart_numbers.size();i++) {
|
||||||
RDCart *cart=new RDCart(rdcart_cart_numbers.at(i));
|
RDCart *cart=new RDCart(rdcart_cart_numbers.at(i));
|
||||||
if(cart->owner().isEmpty()) {
|
if(cart->owner().isEmpty()) {
|
||||||
if(!rdcart_group_box->currentText().trimmed().isEmpty()) {
|
if(rdcart_group_box->currentIndex()>0) {
|
||||||
cart->setGroupName(rdcart_group_box->currentText());
|
cart->setGroupName(rdcart_group_box->currentText());
|
||||||
}
|
}
|
||||||
if(!rdcart_controls.title_edit->text().trimmed().isEmpty()) {
|
if(!rdcart_controls.title_edit->text().trimmed().isEmpty()) {
|
||||||
@@ -880,9 +884,9 @@ void EditCart::okData()
|
|||||||
trimmed().isEmpty()) {
|
trimmed().isEmpty()) {
|
||||||
cart->setUserDefined(rdcart_controls.user_defined_edit->text());
|
cart->setUserDefined(rdcart_controls.user_defined_edit->text());
|
||||||
}
|
}
|
||||||
if(!rdcart_usage_box->currentText().trimmed().isEmpty()) {
|
if(rdcart_usage_box->currentIndex()>0) {
|
||||||
cart->setUsageCode((RDCart::UsageCode)
|
cart->setUsageCode((RDCart::UsageCode)rdcart_usage_box->
|
||||||
(rdcart_usage_box->currentIndex()-1));
|
itemData(rdcart_usage_box->currentIndex()).toInt());
|
||||||
}
|
}
|
||||||
cart->updateSchedCodes(add_codes,remove_codes);
|
cart->updateSchedCodes(add_codes,remove_codes);
|
||||||
}
|
}
|
||||||
|
@@ -85,7 +85,7 @@ EditEvent::EditEvent(QString eventname,bool new_event,QStringList *new_events,
|
|||||||
//
|
//
|
||||||
event_group_box=new QComboBox(this);
|
event_group_box=new QComboBox(this);
|
||||||
event_group_box->setGeometry(55,25,CENTER_LINE-70,20);
|
event_group_box->setGeometry(55,25,CENTER_LINE-70,20);
|
||||||
event_group_model=new RDGroupListModel(true,false,this);
|
event_group_model=new RDGroupListModel(true,false,false,this);
|
||||||
event_group_model->changeUser();
|
event_group_model->changeUser();
|
||||||
event_group_box->setModel(event_group_model);
|
event_group_box->setModel(event_group_model);
|
||||||
connect(event_group_box,SIGNAL(activated(const QString &)),
|
connect(event_group_box,SIGNAL(activated(const QString &)),
|
||||||
|
Reference in New Issue
Block a user