From 1908a556f73c5e02be70c27d21628da80accf9c9 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Tue, 7 May 2024 15:23:12 -0400 Subject: [PATCH] 2024-05-07 Fred Gleason * 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 --- ChangeLog | 5 +++++ lib/rdbutton_panel.cpp | 6 ++++++ lib/rdbutton_panel.h | 1 + lib/rdsound_panel.cpp | 16 ++++++---------- lib/rdsound_panel.h | 1 - 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27e331f9..42c86a6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24756,3 +24756,8 @@ 2024-05-07 Fred Gleason * Fixed a regression in the 'Edit Audio' dialog that caused it to ignore the state of the 'Edit Audio' user privilege. +2024-05-07 Fred Gleason + * 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. diff --git a/lib/rdbutton_panel.cpp b/lib/rdbutton_panel.cpp index 89b1d124..a8e14ea1 100644 --- a/lib/rdbutton_panel.cpp +++ b/lib/rdbutton_panel.cpp @@ -88,6 +88,12 @@ QSizePolicy RDButtonPanel::sizePolicy() const } +RDAirPlayConf::PanelType RDButtonPanel::panelType() const +{ + return panel_type; +} + + int RDButtonPanel::number() const { return panel_number; diff --git a/lib/rdbutton_panel.h b/lib/rdbutton_panel.h index 4bae68a3..e0574a9c 100644 --- a/lib/rdbutton_panel.h +++ b/lib/rdbutton_panel.h @@ -48,6 +48,7 @@ class RDButtonPanel : public RDWidget ~RDButtonPanel(); QSize sizeHint() const; QSizePolicy sizePolicy() const; + RDAirPlayConf::PanelType panelType() const; int number() const; QString title() const; void setTitle(const QString &str); diff --git a/lib/rdsound_panel.cpp b/lib/rdsound_panel.cpp index 9df303f3..cccd6d2d 100644 --- a/lib/rdsound_panel.cpp +++ b/lib/rdsound_panel.cpp @@ -71,7 +71,6 @@ RDSoundPanel::RDSoundPanel(int station_panels,int user_panels,bool flash, panel_flash=flash; panel_flash_count=0; panel_flash_state=false; - panel_config_panels=false; panel_pause_enabled=false; for(unsigned i=0;isetEnabled(panel_action_mode==RDAirPlayConf::Normal); for(QMap >::const_iterator it=panel_arrays.begin();it!=panel_arrays.end();it++) { for(int i=0;ipanelType()==RDAirPlayConf::StationPanel)&& + (!rda->user()->configPanels())) { it.value().at(i)->setActionMode(RDAirPlayConf::Normal); } else { @@ -575,11 +573,9 @@ void RDSoundPanel::acceptCartDrop(int row,int col,unsigned cartnum, void RDSoundPanel::changeUser() { - panel_config_panels=rda->user()->configPanels(); UpdatePanels(rda->user()->name()); if(panel_dump_panel_updates) { 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: if(button->playDeck()==NULL && ((panel_type==RDAirPlayConf::UserPanel) || - panel_config_panels)) { + rda->user()->configPanels())) { emit selectClicked(0,button->row(),button->column()); } break; @@ -762,7 +758,7 @@ void RDSoundPanel::buttonClickedData(int pnum,int col,int row) case RDAirPlayConf::AddTo: if(button->playDeck()==NULL && ((panel_type==RDAirPlayConf::UserPanel) || - panel_config_panels)) { + rda->user()->configPanels())) { emit selectClicked(0,button->row(),button->column()); } break; @@ -770,7 +766,7 @@ void RDSoundPanel::buttonClickedData(int pnum,int col,int row) case RDAirPlayConf::DeleteFrom: if(button->playDeck()==NULL && ((panel_type==RDAirPlayConf::UserPanel) || - panel_config_panels)) { + rda->user()->configPanels())) { emit selectClicked(0,button->row(),button->column()); } break; @@ -781,7 +777,7 @@ void RDSoundPanel::buttonClickedData(int pnum,int col,int row) return; } if((panel_type==RDAirPlayConf::StationPanel)&& - (!panel_config_panels)) { + (!rda->user()->configPanels())) { ClearReset(); return; } diff --git a/lib/rdsound_panel.h b/lib/rdsound_panel.h index 2c1c8bb3..aad3c145 100644 --- a/lib/rdsound_panel.h +++ b/lib/rdsound_panel.h @@ -188,7 +188,6 @@ class RDSoundPanel : public RDWidget bool panel_flash_state; QString panel_logfile; bool panel_timescaling_supported[RD_SOUNDPANEL_MAX_OUTPUTS]; - bool panel_config_panels; RDEventPlayer *panel_event_player; QString panel_svcname; RDAirPlayConf::ActionMode panel_action_mode;