2023-09-27 Fred Gleason <fredg@paravelsystems.com>

* Fixed bugs in 'RDSoundPanel' affecting drag-and-drop operation.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2023-09-27 14:53:11 -04:00
parent f49d03682b
commit 901d93aabe
4 changed files with 13 additions and 10 deletions

View File

@ -24391,3 +24391,5 @@
2023-09-27 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in 'RDSoundPanel' where clicking a non-configured
button in Setup mode would fail to open the 'Edit Button' dialog.
2023-09-27 Fred Gleason <fredg@paravelsystems.com>
* Fixed bugs in 'RDSoundPanel' affecting drag-and-drop operation.

View File

@ -31,9 +31,11 @@ RDButtonPanel::RDButtonPanel(RDAirPlayConf::PanelType type,QWidget *parent)
panel_button[i][j]=
new RDPanelButton(i,j,rda->station(),rda->panelConf()->flashPanel(),
parent);
if(rda->station()->enableDragdrop()&&
(!rda->station()->enforcePanelSetup())) {
panel_button[i][j]->setAcceptDrops(true);
if(rda->station()->enableDragdrop()) {
panel_button[i][j]->setAllowDrags(true);
if(!rda->station()->enforcePanelSetup()) {
panel_button[i][j]->setAcceptDrops(true);
}
}
panel_button[i][j]->setGeometry((15+PANEL_BUTTON_SIZE_X)*j,
(15+PANEL_BUTTON_SIZE_Y)*i,

View File

@ -2,7 +2,7 @@
//
// The SoundPanel Button for RDAirPlay.
//
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2023 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
@ -383,7 +383,7 @@ void RDPanelButton::mousePressEvent(QMouseEvent *e)
void RDPanelButton::mouseMoveEvent(QMouseEvent *e)
{
button_move_count--;
if(button_move_count==0) {
if(button_allow_drags&&(button_move_count==0)) {
QPushButton::mouseReleaseEvent(e);
QDrag *drag=new QDrag(this);
RDCartDrag *cd=new RDCartDrag(button_cart,button_text,button_color);

View File

@ -704,9 +704,10 @@ void RDSoundPanel::setupClickedData()
panel_playmode_box->setDisabled(true);
}
if(rda->station()->enableDragdrop()&&(rda->station()->enforcePanelSetup())) {
for(int i=0;i<panel_panels.size();i++) {
if(panel_panels.value(username).at(i)!=NULL) {
panel_panels.value(username).at(i)->setAcceptDrops(panel_setup_mode);
for(QMap<QString,QList<RDButtonPanel *> >::const_iterator it=
panel_panels.begin();it!=panel_panels.end();it++) {
for(int i=0;i<it.value().size();i++) {
it.value().at(i)->setAcceptDrops(panel_setup_mode);
}
}
}
@ -716,8 +717,6 @@ void RDSoundPanel::setupClickedData()
void RDSoundPanel::buttonMapperData(int grid_pos)
{
printf("buttonMapperData(%d)\n",grid_pos);
RDPanelButton *button=GetCurrentPanel()->
panelButton(grid_pos/PANEL_MAX_BUTTON_COLUMNS,
grid_pos%PANEL_MAX_BUTTON_COLUMNS);