diff --git a/ChangeLog b/ChangeLog index 6f168064..384d9630 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21223,3 +21223,8 @@ 2021-02-25 Fred Gleason * Fixed regressions in rdcartslots(1) that caused widgets to fail to update properly after reloading slots. +2021-02-25 Fred Gleason + * 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. diff --git a/lib/rdbutton_dialog.cpp b/lib/rdbutton_dialog.cpp index 68a935bd..67068c58 100644 --- a/lib/rdbutton_dialog.cpp +++ b/lib/rdbutton_dialog.cpp @@ -2,7 +2,7 @@ // // Button Editor for SoundPanel // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2021 Fred Gleason // // 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 @@ -18,15 +18,14 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include "rdbutton_dialog.h" +#include "rdcart.h" +#include "rdcart_dialog.h" +#include "rdconf.h" +#include "rd.h" +#include "rddb.h" RDButtonDialog::RDButtonDialog(QString station_name,const QString &caption, const QString &label_template, @@ -154,7 +153,7 @@ int RDButtonDialog::exec(RDPanelButton *button,bool hookmode, 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); } } @@ -205,13 +204,13 @@ void RDButtonDialog::okData() edit_button->setActiveLength(edit_button->length(edit_hookmode)); edit_button->setHookMode(edit_hookmode); delete cart; - done(0); + done(true); } void RDButtonDialog::cancelData() { - done(-1); + done(false); } diff --git a/lib/rdedit_panel_name.cpp b/lib/rdedit_panel_name.cpp index d5ff0098..42e3332d 100644 --- a/lib/rdedit_panel_name.cpp +++ b/lib/rdedit_panel_name.cpp @@ -2,7 +2,7 @@ // // Edit a SoundPanel Panel Name // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2021 Fred Gleason // // 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include -#include +#include #include @@ -85,11 +84,11 @@ QSizePolicy RDEditPanelName::sizePolicy() const void RDEditPanelName::okData() { *panel_name=panel_name_edit->text(); - done(0); + done(true); } void RDEditPanelName::cancelData() { - done(-1); + done(false); } diff --git a/lib/rdsound_panel.cpp b/lib/rdsound_panel.cpp index c0d79009..55ef2afa 100644 --- a/lib/rdsound_panel.cpp +++ b/lib/rdsound_panel.cpp @@ -746,8 +746,7 @@ void RDSoundPanel::buttonMapperData(int id) if(panel_button_dialog-> exec(panel_buttons[PanelOffset(panel_type,panel_number)]-> panelButton(row,col),panel_playmode_box->currentIndex()==1, - rda->user()->name(),rda->user()->password()) - ==0) { + rda->user()->name(),rda->user()->password())) { SaveButton(panel_type,panel_number,row,col); } } @@ -843,15 +842,18 @@ void RDSoundPanel::panelSetupData() { if(rda->user()->configPanels()||(panel_type==RDAirPlayConf::UserPanel)) { QString sql; - RDSqlQuery *q; int cutpt=panel_selector_box->currentText().indexOf(" "); if(panel_selector_box->currentText().left(5)==tr("Panel")) { cutpt=-1; } + QString tag=panel_selector_box->currentText().left(cutpt); + QString panel_name=panel_selector_box->currentText(). right(panel_selector_box->currentText().length()-cutpt-1); 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-> setCurrentIndex(panel_selector_box-> findText("["+PanelTag(panel_selector_box-> @@ -860,15 +862,14 @@ void RDSoundPanel::panelSetupData() QString().sprintf("(TYPE=%d)&&",panel_type)+ "(OWNER=\""+RDEscapeString(PanelOwner(panel_type))+"\")&&"+ QString().sprintf("(PANEL_NO=%d)",panel_number); - q=new RDSqlQuery(sql); - delete q; + RDSqlQuery::apply(sql); + sql=QString("insert into ")+panel_name_tablename+" set "+ QString().sprintf("TYPE=%d,",panel_type)+ "OWNER=\""+RDEscapeString(PanelOwner(panel_type))+"\","+ QString().sprintf("PANEL_NO=%d,",panel_number)+ "NAME=\""+RDEscapeString(panel_name)+"\""; - q=new RDSqlQuery(sql); - delete q; + RDSqlQuery::apply(sql); } delete edn; }