Browse Source

2020-05-12 Fred Gleason <fredg@paravelsystems.com>

* Fixed a regression that broke the ability to scroll through
	Sound Panel panels by means of the mouse wheel.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
pull/607/head
Fred Gleason 3 years ago
parent
commit
40e2081b7a
  1. 3
      ChangeLog
  2. 38
      lib/rdsound_panel.cpp
  3. 5
      lib/rdsound_panel.h
  4. 14
      rdairplay/rdairplay.cpp
  5. 3
      rdairplay/rdairplay.h
  6. 14
      rdpanel/rdpanel.cpp
  7. 3
      rdpanel/rdpanel.h

3
ChangeLog

@ -19832,3 +19832,6 @@
* Cleaned up SQL generation in rdmaint(8).
2020-05-02 Fred Gleason <fredg@paravelsystems.com>
* Incremented the package version to 3.3.0int1.
2020-05-12 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression that broke the ability to scroll through
Sound Panel panels by means of the mouse wheel.

38
lib/rdsound_panel.cpp

@ -2,7 +2,7 @@
//
// The sound panel widget for RDAirPlay
//
// (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2020 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
@ -604,6 +604,28 @@ void RDSoundPanel::tickClock()
}
void RDSoundPanel::panelUp()
{
int index=panel_selector_box->currentIndex();
if(index<(panel_selector_box->count()-1)) {
panelActivatedData(index+1);
panel_selector_box->setCurrentIndex(index+1);
}
}
void RDSoundPanel::panelDown()
{
int index=panel_selector_box->currentIndex();
if(index>0) {
panelActivatedData(index-1);
panel_selector_box->setCurrentIndex(index-1);
}
}
void RDSoundPanel::panelActivatedData(int n)
{
panel_buttons[PanelOffset(panel_type,panel_number)]->hide();
@ -866,6 +888,20 @@ void RDSoundPanel::scanPanelData()
}
void RDSoundPanel::wheelEvent(QWheelEvent *e)
{
if(e->orientation()==Qt::Vertical) {
if(e->delta()>0) {
panelDown();
}
if(e->delta()<0) {
panelUp();
}
}
e->accept();
}
void RDSoundPanel::PlayButton(RDAirPlayConf::PanelType type,int panel,
int row,int col,RDLogLine::StartSource src,bool hookmode,
int mport,bool pause_when_finished)

5
lib/rdsound_panel.h

@ -92,6 +92,8 @@ class RDSoundPanel : public RDWidget
const QString &);
void changeUser();
void tickClock();
void panelUp();
void panelDown();
signals:
void tick();
@ -114,6 +116,9 @@ class RDSoundPanel : public RDWidget
void onairFlagChangedData(bool state);
void scanPanelData();
protected:
void wheelEvent(QWheelEvent *e);
private:
void PlayButton(RDAirPlayConf::PanelType type,int panel,int row,int col,
RDLogLine::StartSource src,bool hookmode,int mport=-1,

14
rdairplay/rdairplay.cpp

@ -2024,6 +2024,20 @@ void MainWidget::paintEvent(QPaintEvent *e)
}
void MainWidget::wheelEvent(QWheelEvent *e)
{
if((air_panel!=NULL)&&(e->orientation()==Qt::Vertical)) {
if(e->delta()>0) {
air_panel->panelDown();
}
if(e->delta()<0) {
air_panel->panelUp();
}
}
e->accept();
}
void SigHandler(int signo)
{
pid_t pLocalPid;

3
rdairplay/rdairplay.h

@ -102,6 +102,9 @@ class MainWidget : public RDWidget
void closeEvent(QCloseEvent *);
void paintEvent(QPaintEvent *e);
protected:
void wheelEvent(QWheelEvent *e);
private:
void RunLocalMacros(RDMacro *rml);
void StopEvent(int button_id);

14
rdpanel/rdpanel.cpp

@ -341,6 +341,20 @@ void MainWidget::masterTimerData()
}
void MainWidget::wheelEvent(QWheelEvent *e)
{
if(e->orientation()==Qt::Vertical) {
if(e->delta()>0) {
panel_panel->panelDown();
}
if(e->delta()<0) {
panel_panel->panelUp();
}
}
e->accept();
}
void MainWidget::closeEvent(QCloseEvent *e)
{
panel_db->removeDatabase(rda->config()->mysqlDbname());

3
rdpanel/rdpanel.h

@ -2,7 +2,7 @@
//
// A Dedicated Cart Wall Utility for Rivendell.
//
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2020 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
@ -51,6 +51,7 @@ class MainWidget : public RDWidget
void rmlReceivedData(RDMacro *rml);
protected:
void wheelEvent(QWheelEvent *e);
void closeEvent(QCloseEvent *e);
private:

Loading…
Cancel
Save