2024-05-07 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in the SoundPanel that caused button color highlighting
	for addition/move/delete operations to fail to be displayed for User
	panels when the	user didn't have the 'Configure System Panels'
	privilege.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2024-05-07 15:23:12 -04:00
parent 1519123f68
commit 1908a556f7
5 changed files with 18 additions and 11 deletions

View File

@ -24756,3 +24756,8 @@
2024-05-07 Fred Gleason <fredg@paravelsystems.com> 2024-05-07 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in the 'Edit Audio' dialog that caused it to * Fixed a regression in the 'Edit Audio' dialog that caused it to
ignore the state of the 'Edit Audio' user privilege. ignore the state of the 'Edit Audio' user privilege.
2024-05-07 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in the SoundPanel that caused button color highlighting
for addition/move/delete operations to fail to be displayed for User
panels when the user didn't have the 'Configure System Panels'
privilege.

View File

@ -88,6 +88,12 @@ QSizePolicy RDButtonPanel::sizePolicy() const
} }
RDAirPlayConf::PanelType RDButtonPanel::panelType() const
{
return panel_type;
}
int RDButtonPanel::number() const int RDButtonPanel::number() const
{ {
return panel_number; return panel_number;

View File

@ -48,6 +48,7 @@ class RDButtonPanel : public RDWidget
~RDButtonPanel(); ~RDButtonPanel();
QSize sizeHint() const; QSize sizeHint() const;
QSizePolicy sizePolicy() const; QSizePolicy sizePolicy() const;
RDAirPlayConf::PanelType panelType() const;
int number() const; int number() const;
QString title() const; QString title() const;
void setTitle(const QString &str); void setTitle(const QString &str);

View File

@ -71,7 +71,6 @@ RDSoundPanel::RDSoundPanel(int station_panels,int user_panels,bool flash,
panel_flash=flash; panel_flash=flash;
panel_flash_count=0; panel_flash_count=0;
panel_flash_state=false; panel_flash_state=false;
panel_config_panels=false;
panel_pause_enabled=false; panel_pause_enabled=false;
for(unsigned i=0;i<RD_SOUNDPANEL_MAX_OUTPUTS;i++) { for(unsigned i=0;i<RD_SOUNDPANEL_MAX_OUTPUTS;i++) {
panel_card[i]=-1; panel_card[i]=-1;
@ -429,9 +428,8 @@ void RDSoundPanel::setActionMode(RDAirPlayConf::ActionMode mode)
panel_setup_button->setEnabled(panel_action_mode==RDAirPlayConf::Normal); panel_setup_button->setEnabled(panel_action_mode==RDAirPlayConf::Normal);
for(QMap<QString,QList<RDButtonPanel *> >::const_iterator it=panel_arrays.begin();it!=panel_arrays.end();it++) { for(QMap<QString,QList<RDButtonPanel *> >::const_iterator it=panel_arrays.begin();it!=panel_arrays.end();it++) {
for(int i=0;i<it.value().size();i++) { for(int i=0;i<it.value().size();i++) {
if(i<panel_station_panels && if((it.value().at(i)->panelType()==RDAirPlayConf::StationPanel)&&
(!panel_config_panels) && (!rda->user()->configPanels())) {
(mode==RDAirPlayConf::AddTo || mode==RDAirPlayConf::CopyTo || mode==RDAirPlayConf::DeleteFrom)) {
it.value().at(i)->setActionMode(RDAirPlayConf::Normal); it.value().at(i)->setActionMode(RDAirPlayConf::Normal);
} }
else { else {
@ -575,11 +573,9 @@ void RDSoundPanel::acceptCartDrop(int row,int col,unsigned cartnum,
void RDSoundPanel::changeUser() void RDSoundPanel::changeUser()
{ {
panel_config_panels=rda->user()->configPanels();
UpdatePanels(rda->user()->name()); UpdatePanels(rda->user()->name());
if(panel_dump_panel_updates) { if(panel_dump_panel_updates) {
printf("%s\n",json(rda->user()->name()).constData()); printf("%s\n",json(rda->user()->name()).constData());
// printf("{\r\n%s}\r\n",json(4).toUtf8().constData());
} }
// //
@ -754,7 +750,7 @@ void RDSoundPanel::buttonClickedData(int pnum,int col,int row)
case RDAirPlayConf::CopyTo: case RDAirPlayConf::CopyTo:
if(button->playDeck()==NULL if(button->playDeck()==NULL
&& ((panel_type==RDAirPlayConf::UserPanel) || && ((panel_type==RDAirPlayConf::UserPanel) ||
panel_config_panels)) { rda->user()->configPanels())) {
emit selectClicked(0,button->row(),button->column()); emit selectClicked(0,button->row(),button->column());
} }
break; break;
@ -762,7 +758,7 @@ void RDSoundPanel::buttonClickedData(int pnum,int col,int row)
case RDAirPlayConf::AddTo: case RDAirPlayConf::AddTo:
if(button->playDeck()==NULL if(button->playDeck()==NULL
&& ((panel_type==RDAirPlayConf::UserPanel) || && ((panel_type==RDAirPlayConf::UserPanel) ||
panel_config_panels)) { rda->user()->configPanels())) {
emit selectClicked(0,button->row(),button->column()); emit selectClicked(0,button->row(),button->column());
} }
break; break;
@ -770,7 +766,7 @@ void RDSoundPanel::buttonClickedData(int pnum,int col,int row)
case RDAirPlayConf::DeleteFrom: case RDAirPlayConf::DeleteFrom:
if(button->playDeck()==NULL if(button->playDeck()==NULL
&& ((panel_type==RDAirPlayConf::UserPanel) || && ((panel_type==RDAirPlayConf::UserPanel) ||
panel_config_panels)) { rda->user()->configPanels())) {
emit selectClicked(0,button->row(),button->column()); emit selectClicked(0,button->row(),button->column());
} }
break; break;
@ -781,7 +777,7 @@ void RDSoundPanel::buttonClickedData(int pnum,int col,int row)
return; return;
} }
if((panel_type==RDAirPlayConf::StationPanel)&& if((panel_type==RDAirPlayConf::StationPanel)&&
(!panel_config_panels)) { (!rda->user()->configPanels())) {
ClearReset(); ClearReset();
return; return;
} }

View File

@ -188,7 +188,6 @@ class RDSoundPanel : public RDWidget
bool panel_flash_state; bool panel_flash_state;
QString panel_logfile; QString panel_logfile;
bool panel_timescaling_supported[RD_SOUNDPANEL_MAX_OUTPUTS]; bool panel_timescaling_supported[RD_SOUNDPANEL_MAX_OUTPUTS];
bool panel_config_panels;
RDEventPlayer *panel_event_player; RDEventPlayer *panel_event_player;
QString panel_svcname; QString panel_svcname;
RDAirPlayConf::ActionMode panel_action_mode; RDAirPlayConf::ActionMode panel_action_mode;