2021-02-25 Fred Gleason <fredg@paravelsystems.com>

* Fixed a regression in sound panels where changing the name of
	a panel would fail to be reflected in the panel selector.
	* Fixed regressions in sound panels where configuration changes
	would not be updated properly.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2021-02-25 14:16:58 -05:00
parent 6ee9578318
commit a923e8953d
4 changed files with 30 additions and 26 deletions

View File

@ -21223,3 +21223,8 @@
2021-02-25 Fred Gleason <fredg@paravelsystems.com> 2021-02-25 Fred Gleason <fredg@paravelsystems.com>
* Fixed regressions in rdcartslots(1) that caused widgets to fail * Fixed regressions in rdcartslots(1) that caused widgets to fail
to update properly after reloading slots. to update properly after reloading slots.
2021-02-25 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in sound panels where changing the name of
a panel would fail to be reflected in the panel selector.
* Fixed regressions in sound panels where configuration changes
would not be updated properly.

View File

@ -2,7 +2,7 @@
// //
// Button Editor for SoundPanel // Button Editor for SoundPanel
// //
// (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 // 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
@ -18,15 +18,14 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// //
#include <qpushbutton.h> #include <QColorDialog>
#include <qlabel.h>
#include <qcolordialog.h> #include "rdbutton_dialog.h"
#include <rddb.h> #include "rdcart.h"
#include <rdcart.h> #include "rdcart_dialog.h"
#include <rdcart_dialog.h> #include "rdconf.h"
#include <rd.h> #include "rd.h"
#include <rdbutton_dialog.h> #include "rddb.h"
#include <rdconf.h>
RDButtonDialog::RDButtonDialog(QString station_name,const QString &caption, RDButtonDialog::RDButtonDialog(QString station_name,const QString &caption,
const QString &label_template, const QString &label_template,
@ -154,7 +153,7 @@ int RDButtonDialog::exec(RDPanelButton *button,bool hookmode,
void RDButtonDialog::setCartData() void RDButtonDialog::setCartData()
{ {
if(edit_cart_dialog->exec(&edit_cart,RDCart::All,edit_svcname,NULL)==0) { if(edit_cart_dialog->exec(&edit_cart,RDCart::All,edit_svcname,NULL)) {
DisplayCart(edit_cart); DisplayCart(edit_cart);
} }
} }
@ -205,13 +204,13 @@ void RDButtonDialog::okData()
edit_button->setActiveLength(edit_button->length(edit_hookmode)); edit_button->setActiveLength(edit_button->length(edit_hookmode));
edit_button->setHookMode(edit_hookmode); edit_button->setHookMode(edit_hookmode);
delete cart; delete cart;
done(0); done(true);
} }
void RDButtonDialog::cancelData() void RDButtonDialog::cancelData()
{ {
done(-1); done(false);
} }

View File

@ -2,7 +2,7 @@
// //
// Edit a SoundPanel Panel Name // Edit a SoundPanel Panel Name
// //
// (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 // 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
@ -18,8 +18,7 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// //
#include <qlabel.h> #include <QPushButton>
#include <qpushbutton.h>
#include <rdedit_panel_name.h> #include <rdedit_panel_name.h>
@ -85,11 +84,11 @@ QSizePolicy RDEditPanelName::sizePolicy() const
void RDEditPanelName::okData() void RDEditPanelName::okData()
{ {
*panel_name=panel_name_edit->text(); *panel_name=panel_name_edit->text();
done(0); done(true);
} }
void RDEditPanelName::cancelData() void RDEditPanelName::cancelData()
{ {
done(-1); done(false);
} }

View File

@ -746,8 +746,7 @@ void RDSoundPanel::buttonMapperData(int id)
if(panel_button_dialog-> if(panel_button_dialog->
exec(panel_buttons[PanelOffset(panel_type,panel_number)]-> exec(panel_buttons[PanelOffset(panel_type,panel_number)]->
panelButton(row,col),panel_playmode_box->currentIndex()==1, panelButton(row,col),panel_playmode_box->currentIndex()==1,
rda->user()->name(),rda->user()->password()) rda->user()->name(),rda->user()->password())) {
==0) {
SaveButton(panel_type,panel_number,row,col); SaveButton(panel_type,panel_number,row,col);
} }
} }
@ -843,15 +842,18 @@ void RDSoundPanel::panelSetupData()
{ {
if(rda->user()->configPanels()||(panel_type==RDAirPlayConf::UserPanel)) { if(rda->user()->configPanels()||(panel_type==RDAirPlayConf::UserPanel)) {
QString sql; QString sql;
RDSqlQuery *q;
int cutpt=panel_selector_box->currentText().indexOf(" "); int cutpt=panel_selector_box->currentText().indexOf(" ");
if(panel_selector_box->currentText().left(5)==tr("Panel")) { if(panel_selector_box->currentText().left(5)==tr("Panel")) {
cutpt=-1; cutpt=-1;
} }
QString tag=panel_selector_box->currentText().left(cutpt);
QString panel_name=panel_selector_box->currentText(). QString panel_name=panel_selector_box->currentText().
right(panel_selector_box->currentText().length()-cutpt-1); right(panel_selector_box->currentText().length()-cutpt-1);
RDEditPanelName *edn=new RDEditPanelName(&panel_name); RDEditPanelName *edn=new RDEditPanelName(&panel_name);
if(edn->exec()==0) { if(edn->exec()) {
panel_selector_box->
setItemText(panel_selector_box->currentIndex(),tag+" "+panel_name);
panel_selector_box-> panel_selector_box->
setCurrentIndex(panel_selector_box-> setCurrentIndex(panel_selector_box->
findText("["+PanelTag(panel_selector_box-> findText("["+PanelTag(panel_selector_box->
@ -860,15 +862,14 @@ void RDSoundPanel::panelSetupData()
QString().sprintf("(TYPE=%d)&&",panel_type)+ QString().sprintf("(TYPE=%d)&&",panel_type)+
"(OWNER=\""+RDEscapeString(PanelOwner(panel_type))+"\")&&"+ "(OWNER=\""+RDEscapeString(PanelOwner(panel_type))+"\")&&"+
QString().sprintf("(PANEL_NO=%d)",panel_number); QString().sprintf("(PANEL_NO=%d)",panel_number);
q=new RDSqlQuery(sql); RDSqlQuery::apply(sql);
delete q;
sql=QString("insert into ")+panel_name_tablename+" set "+ sql=QString("insert into ")+panel_name_tablename+" set "+
QString().sprintf("TYPE=%d,",panel_type)+ QString().sprintf("TYPE=%d,",panel_type)+
"OWNER=\""+RDEscapeString(PanelOwner(panel_type))+"\","+ "OWNER=\""+RDEscapeString(PanelOwner(panel_type))+"\","+
QString().sprintf("PANEL_NO=%d,",panel_number)+ QString().sprintf("PANEL_NO=%d,",panel_number)+
"NAME=\""+RDEscapeString(panel_name)+"\""; "NAME=\""+RDEscapeString(panel_name)+"\"";
q=new RDSqlQuery(sql); RDSqlQuery::apply(sql);
delete q;
} }
delete edn; delete edn;
} }