mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-20 15:02:27 +02:00
2021-06-14 Fred Gleason <fredg@paravelsystems.com>
* Reworked the 'ListLog' widget in rdairplay(1) to support dynamic resizing. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
ede949fa1e
commit
a9988e41e3
@ -21884,3 +21884,6 @@
|
||||
2021-06-11 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a bug in rdadmin(1) that threw a SQL error when opening
|
||||
the 'Edit Service' dialog.
|
||||
2021-06-14 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Reworked the 'ListLog' widget in rdairplay(1) to support
|
||||
dynamic resizing.
|
||||
|
@ -105,6 +105,24 @@ void HourSelector::updateHour(int hour,bool state)
|
||||
|
||||
void HourSelector::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
if(size().width()>=(24*HOURSELECTOR_BUTTON_EDGE)) {
|
||||
for(unsigned i=0;i<24;i++) {
|
||||
hour_button[i]->
|
||||
setGeometry(i*HOURSELECTOR_BUTTON_EDGE,0,
|
||||
HOURSELECTOR_BUTTON_EDGE,HOURSELECTOR_BUTTON_EDGE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(unsigned i=0;i<2;i++) {
|
||||
for(unsigned j=0;j<12;j++) {
|
||||
unsigned hour=12*i+j;
|
||||
hour_button[hour]->
|
||||
setGeometry(j*HOURSELECTOR_BUTTON_EDGE,i*HOURSELECTOR_BUTTON_EDGE,
|
||||
HOURSELECTOR_BUTTON_EDGE,HOURSELECTOR_BUTTON_EDGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
for(unsigned i=0;i<2;i++) {
|
||||
for(unsigned j=0;j<12;j++) {
|
||||
unsigned hour=12*i+j;
|
||||
@ -112,6 +130,7 @@ void HourSelector::resizeEvent(QResizeEvent *e)
|
||||
size().width()/12,size().height()/2);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include <rdlogplay.h>
|
||||
#include <rdwidget.h>
|
||||
|
||||
#define HOURSELECTOR_BUTTON_EDGE 41
|
||||
|
||||
class HourSelector : public RDWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -121,7 +121,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
if(rda->airplayConf()->hourSelectorEnabled()) {
|
||||
y+=80;
|
||||
h-=80;
|
||||
list_hour_selector->setGeometry(0,0,sizeHint().width(),80);
|
||||
list_hour_selector->show();
|
||||
}
|
||||
|
||||
@ -129,7 +128,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
// Log View
|
||||
//
|
||||
list_log_view=new LogTableView(this);
|
||||
list_log_view->setGeometry(0,y,sizeHint().width(),h);
|
||||
list_log_view->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
list_log_view->setSelectionMode(QAbstractItemView::ContiguousSelection);
|
||||
list_log_view->setShowGrid(false);
|
||||
@ -160,20 +158,17 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
//
|
||||
// Time Counter Section
|
||||
//
|
||||
QGroupBox *groupbox=new QGroupBox(tr("Run Length"),this);
|
||||
groupbox->setFont(labelFont());
|
||||
groupbox->setGeometry(336,sizeHint().height()-116,146,58);
|
||||
log_groupbox=new QGroupBox(tr("Run Length"),this);
|
||||
log_groupbox->setFont(labelFont());
|
||||
if(!rda->airplayConf()->showCounters()) {
|
||||
groupbox->hide();
|
||||
log_groupbox->hide();
|
||||
}
|
||||
|
||||
//
|
||||
// Stop Time Counter
|
||||
//
|
||||
list_stoptime_edit=new QLineEdit(this);
|
||||
list_stoptime_edit->setGeometry(407,sizeHint().height()-100,70,18);
|
||||
list_stoptime_label=new QLabel(tr("Next Stop:"),this);
|
||||
list_stoptime_label->setGeometry(337,sizeHint().height()-100,65,18);
|
||||
list_stoptime_label->setFont(labelFont());
|
||||
list_stoptime_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
// list_stoptime_label->setBackgroundColor(QColor(system_mid_color));
|
||||
@ -186,9 +181,7 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
// End Time Counter
|
||||
//
|
||||
list_endtime_edit=new QLineEdit(this);
|
||||
list_endtime_edit->setGeometry(407,sizeHint().height()-80,70,18);
|
||||
list_endtime_label=new QLabel(tr("Log End:"),this);
|
||||
list_endtime_label->setGeometry(337,sizeHint().height()-80,65,18);
|
||||
list_endtime_label->setFont(labelFont());
|
||||
list_endtime_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
// list_endtime_label->setBackgroundColor(QColor(system_mid_color));
|
||||
@ -201,7 +194,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
// Select Button
|
||||
//
|
||||
list_take_button=new QPushButton(this);
|
||||
list_take_button->setGeometry(10,sizeHint().height()-55,80,50);
|
||||
list_take_button->setFont(bigButtonFont());
|
||||
list_take_button->
|
||||
setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
|
||||
@ -214,7 +206,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
// Audition Head Button
|
||||
//
|
||||
list_head_button=new QPushButton(this);
|
||||
list_head_button->setGeometry(10,sizeHint().height()-113,80,50);
|
||||
list_head_button->setFont(bigButtonFont());
|
||||
list_head_button->
|
||||
setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
|
||||
@ -229,7 +220,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
// Audition Tail Button
|
||||
//
|
||||
list_tail_button=new QPushButton(this);
|
||||
list_tail_button->setGeometry(90,sizeHint().height()-113,80,50);
|
||||
list_tail_button->setFont(bigButtonFont());
|
||||
list_tail_button->
|
||||
setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
|
||||
@ -244,7 +234,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
// Play Button
|
||||
//
|
||||
list_play_button=new QPushButton(this);
|
||||
list_play_button->setGeometry(10,sizeHint().height()-55,80,50);
|
||||
list_play_button->setFont(bigButtonFont());
|
||||
list_play_button->
|
||||
setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
|
||||
@ -257,7 +246,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
// Next Button
|
||||
//
|
||||
list_next_button=new QPushButton(this);
|
||||
list_next_button->setGeometry(90,sizeHint().height()-55,80,50);
|
||||
list_next_button->setFont(bigButtonFont());
|
||||
list_next_button->
|
||||
setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
|
||||
@ -270,7 +258,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
// Modify Button
|
||||
//
|
||||
list_modify_button=new QPushButton(this);
|
||||
list_modify_button->setGeometry(170,sizeHint().height()-55,80,50);
|
||||
list_modify_button->setFont(bigButtonFont());
|
||||
list_modify_button->
|
||||
setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
|
||||
@ -283,7 +270,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
// Scroll Button
|
||||
//
|
||||
list_scroll_button=new QPushButton(this);
|
||||
list_scroll_button->setGeometry(250,sizeHint().height()-55,80,50);
|
||||
list_scroll_button->setFont(bigButtonFont());
|
||||
list_scroll_button->
|
||||
setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
|
||||
@ -296,7 +282,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
// Refresh Button
|
||||
//
|
||||
list_refresh_button=new QPushButton(this);
|
||||
list_refresh_button->setGeometry(330,sizeHint().height()-55,80,50);
|
||||
list_refresh_button->setFont(bigButtonFont());
|
||||
list_refresh_button->
|
||||
setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
|
||||
@ -310,8 +295,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause,
|
||||
// Log Load
|
||||
//
|
||||
list_load_button=new QPushButton(this);
|
||||
list_load_button->setGeometry(sizeHint().width()-90,sizeHint().height()-55,
|
||||
80,50);
|
||||
list_load_button->setFont(bigButtonFont());
|
||||
list_load_button->
|
||||
setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
|
||||
@ -912,6 +895,96 @@ void ListLog::cartDroppedData(int line,RDLogLine *ll)
|
||||
}
|
||||
|
||||
|
||||
void ListLog::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
//
|
||||
// Hour Selector
|
||||
//
|
||||
if(rda->airplayConf()->hourSelectorEnabled()) {
|
||||
list_hour_selector->setGeometry(0,0,size().width(),80);
|
||||
}
|
||||
|
||||
//
|
||||
// Log Items
|
||||
//
|
||||
int list_y=0;
|
||||
int list_h=size().height()-60;
|
||||
if(rda->airplayConf()->showCounters()) {
|
||||
list_h-=60;
|
||||
}
|
||||
|
||||
if(size().width()>=850) {
|
||||
//
|
||||
// Audition Head/Tail Buttons
|
||||
//
|
||||
list_head_button->setGeometry(510,size().height()-55,90,50);
|
||||
list_tail_button->setGeometry(600,size().height()-55,90,50);
|
||||
|
||||
//
|
||||
// Counters
|
||||
//
|
||||
log_groupbox->setGeometry(695,size().height()-61,153,58);
|
||||
list_stoptime_edit->setGeometry(773,size().height()-45,70,18);
|
||||
list_stoptime_label->setGeometry(703,size().height()-45,65,18);
|
||||
list_endtime_edit->setGeometry(773,size().height()-25,70,18);
|
||||
list_endtime_label->setGeometry(703,size().height()-25,65,18);
|
||||
|
||||
//
|
||||
// Bottom Buttons
|
||||
//
|
||||
list_take_button->setGeometry(10,size().height()-55,80,50);
|
||||
list_play_button->setGeometry(10,size().height()-55,80,50);
|
||||
list_next_button->setGeometry(90,size().height()-55,80,50);
|
||||
list_modify_button->setGeometry(170,size().height()-55,80,50);
|
||||
list_scroll_button->setGeometry(250,size().height()-55,80,50);
|
||||
list_refresh_button->setGeometry(330,size().height()-55,80,50);
|
||||
list_load_button->setGeometry(410,size().height()-55,
|
||||
80,50);
|
||||
list_h+=60;
|
||||
}
|
||||
else {
|
||||
//
|
||||
// Audition Head/Tail Buttons
|
||||
//
|
||||
list_head_button->setGeometry(10,size().height()-113,90,50);
|
||||
list_tail_button->setGeometry(100,size().height()-113,90,50);
|
||||
|
||||
//
|
||||
// Counters
|
||||
//
|
||||
log_groupbox->setGeometry(333,size().height()-116,158,58);
|
||||
list_stoptime_edit->setGeometry(412,size().height()-100,70,18);
|
||||
list_stoptime_label->setGeometry(342,size().height()-100,65,18);
|
||||
list_endtime_edit->setGeometry(412,size().height()-80,70,18);
|
||||
list_endtime_label->setGeometry(342,size().height()-80,65,18);
|
||||
|
||||
//
|
||||
// Bottom Buttons
|
||||
//
|
||||
list_take_button->setGeometry(10,size().height()-55,80,50);
|
||||
list_play_button->setGeometry(10,size().height()-55,80,50);
|
||||
list_next_button->setGeometry(90,size().height()-55,80,50);
|
||||
list_modify_button->setGeometry(170,size().height()-55,80,50);
|
||||
list_scroll_button->setGeometry(250,size().height()-55,80,50);
|
||||
list_refresh_button->setGeometry(330,size().height()-55,80,50);
|
||||
list_load_button->setGeometry(size().width()-90,size().height()-55,80,50);
|
||||
}
|
||||
|
||||
if(rda->airplayConf()->hourSelectorEnabled()) {
|
||||
if(size().width()>=(24*HOURSELECTOR_BUTTON_EDGE)) {
|
||||
list_y+=HOURSELECTOR_BUTTON_EDGE;
|
||||
list_h-=HOURSELECTOR_BUTTON_EDGE;
|
||||
}
|
||||
else {
|
||||
list_y+=2*HOURSELECTOR_BUTTON_EDGE;
|
||||
list_h-=2*HOURSELECTOR_BUTTON_EDGE;
|
||||
}
|
||||
}
|
||||
list_log_view->setGeometry(0,list_y,size().width(),list_h);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int ListLog::CurrentLine()
|
||||
{
|
||||
QModelIndexList rows=list_log_view->selectionModel()->selectedRows();
|
||||
|
@ -70,6 +70,9 @@ class ListLog : public RDWidget
|
||||
void refreshabilityChangedData(bool state);
|
||||
void cartDroppedData(int line,RDLogLine *ll);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
|
||||
private:
|
||||
enum PlayButtonMode {ButtonDisabled=0,ButtonPlay=1,ButtonStop=2};
|
||||
int CurrentLine();
|
||||
@ -113,6 +116,8 @@ class ListLog : public RDWidget
|
||||
bool list_pause_allowed;
|
||||
bool list_audition_head_playing;
|
||||
bool list_audition_tail_playing;
|
||||
|
||||
QGroupBox *log_groupbox;
|
||||
};
|
||||
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include <rdescape_string.h>
|
||||
|
||||
#include "rdairplay.h"
|
||||
#include "wall_clock.h"
|
||||
|
||||
//
|
||||
// Prototypes
|
||||
@ -118,12 +117,8 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
//
|
||||
// Fix the Window Size
|
||||
//
|
||||
#ifndef RESIZABLE
|
||||
setMinimumWidth(sizeHint().width());
|
||||
setMaximumWidth(sizeHint().width());
|
||||
setMinimumHeight(sizeHint().height());
|
||||
setMaximumHeight(sizeHint().height());
|
||||
#endif // RESIZABLE
|
||||
setMinimumSize(sizeHint());
|
||||
// setMaximumSize(sizeHint());
|
||||
|
||||
//
|
||||
// Initialize the Random Number Generator
|
||||
@ -319,21 +314,17 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
//
|
||||
// Wall Clock
|
||||
//
|
||||
WallClock *clock=new WallClock(this);
|
||||
clock->
|
||||
setGeometry(10,5,clock->sizeHint().width(),clock->sizeHint().height());
|
||||
clock->setCheckSyncEnabled(rda->airplayConf()->checkTimesync());
|
||||
connect(air_master_timer,SIGNAL(timeout()),clock,SLOT(tickClock()));
|
||||
clock->setFocusPolicy(Qt::NoFocus);
|
||||
connect(clock,SIGNAL(timeModeChanged(RDAirPlayConf::TimeMode)),
|
||||
air_clock=new WallClock(this);
|
||||
air_clock->setCheckSyncEnabled(rda->airplayConf()->checkTimesync());
|
||||
connect(air_master_timer,SIGNAL(timeout()),air_clock,SLOT(tickClock()));
|
||||
air_clock->setFocusPolicy(Qt::NoFocus);
|
||||
connect(air_clock,SIGNAL(timeModeChanged(RDAirPlayConf::TimeMode)),
|
||||
this,SLOT(timeModeData(RDAirPlayConf::TimeMode)));
|
||||
|
||||
//
|
||||
// Post Counter
|
||||
//
|
||||
air_post_counter=new PostCounter(this);
|
||||
air_post_counter->setGeometry(220,5,air_post_counter->sizeHint().width(),
|
||||
air_post_counter->sizeHint().height());
|
||||
air_post_counter->setPostPoint(QTime(),0,false,false);
|
||||
air_post_counter->setFocusPolicy(Qt::NoFocus);
|
||||
connect(air_master_timer,SIGNAL(timeout()),
|
||||
@ -345,8 +336,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
// Pie Counter
|
||||
//
|
||||
air_pie_counter=new PieCounter(rda->airplayConf()->pieCountLength(),this);
|
||||
air_pie_counter->setGeometry(426,5,air_pie_counter->sizeHint().width(),
|
||||
air_pie_counter->sizeHint().height());
|
||||
air_pie_counter->setCountLength(rda->airplayConf()->pieCountLength());
|
||||
air_pie_end=rda->airplayConf()->pieEndPoint();
|
||||
air_pie_counter->setOpMode(air_op_mode[0]);
|
||||
@ -360,8 +349,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
// Audio Meter
|
||||
//
|
||||
air_stereo_meter=new RDStereoMeter(this);
|
||||
air_stereo_meter->setGeometry(50,70,air_stereo_meter->sizeHint().width(),
|
||||
air_stereo_meter->sizeHint().height());
|
||||
air_stereo_meter->setMode(RDSegMeter::Peak);
|
||||
air_stereo_meter->setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
@ -369,8 +356,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
// Message Label
|
||||
//
|
||||
air_message_label=new QLabel(this);
|
||||
air_message_label->setGeometry(sizeHint().width()-425,70,
|
||||
MESSAGE_WIDGET_WIDTH,air_stereo_meter->sizeHint().height());
|
||||
air_message_label->setStyleSheet("background-color: "+
|
||||
QColor(LOGLINEBOX_BACKGROUND_COLOR).name());
|
||||
air_message_label->setWordWrap(true);
|
||||
@ -384,8 +369,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
// Stop Counter
|
||||
//
|
||||
air_stop_counter=new StopCounter(this);
|
||||
air_stop_counter->setGeometry(600,5,air_stop_counter->sizeHint().width(),
|
||||
air_stop_counter->sizeHint().height());
|
||||
air_stop_counter->setTime(QTime(0,0,0));
|
||||
air_stop_counter->setFocusPolicy(Qt::NoFocus);
|
||||
connect(air_master_timer,SIGNAL(timeout()),
|
||||
@ -397,10 +380,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
// Mode Display/Button
|
||||
//
|
||||
air_mode_display=new ModeDisplay(this);
|
||||
air_mode_display->
|
||||
setGeometry(sizeHint().width()-air_mode_display->sizeHint().width()-10,
|
||||
5,air_mode_display->sizeHint().width(),
|
||||
air_mode_display->sizeHint().height());
|
||||
air_mode_display->setFocusPolicy(Qt::NoFocus);
|
||||
air_mode_display->setOpModeStyle(air_op_mode_style);
|
||||
connect(air_mode_display,SIGNAL(clicked()),this,SLOT(modeButtonData()));
|
||||
@ -430,7 +409,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
// Add Button
|
||||
//
|
||||
air_add_button=new RDPushButton(this);
|
||||
air_add_button->setGeometry(10,sizeHint().height()-65,80,60);
|
||||
air_add_button->setFont(bigButtonFont());
|
||||
air_add_button->setText(tr("ADD"));
|
||||
air_add_button->setFocusPolicy(Qt::NoFocus);
|
||||
@ -440,7 +418,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
// Delete Button
|
||||
//
|
||||
air_delete_button=new RDPushButton(this);
|
||||
air_delete_button->setGeometry(100,sizeHint().height()-65,80,60);
|
||||
air_delete_button->setFont(bigButtonFont());
|
||||
air_delete_button->setText(tr("DEL"));
|
||||
air_delete_button->setFlashColor(AIR_FLASH_COLOR);
|
||||
@ -451,7 +428,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
// Move Button
|
||||
//
|
||||
air_move_button=new RDPushButton(this);
|
||||
air_move_button->setGeometry(190,sizeHint().height()-65,80,60);
|
||||
air_move_button->setFont(bigButtonFont());
|
||||
air_move_button->setText(tr("MOVE"));
|
||||
air_move_button->setFlashColor(AIR_FLASH_COLOR);
|
||||
@ -462,7 +438,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
// Copy Button
|
||||
//
|
||||
air_copy_button=new RDPushButton(this);
|
||||
air_copy_button->setGeometry(280,sizeHint().height()-65,80,60);
|
||||
air_copy_button->setFont(bigButtonFont());
|
||||
air_copy_button->setText(tr("COPY"));
|
||||
air_copy_button->setFlashColor(AIR_FLASH_COLOR);
|
||||
@ -490,8 +465,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
"RDAirPlay",
|
||||
rda->airplayConf()->buttonLabelTemplate(),false,
|
||||
air_event_player,air_cart_dialog,this);
|
||||
air_panel->setGeometry(510,140,air_panel->sizeHint().width(),
|
||||
air_panel->sizeHint().height());
|
||||
air_panel->setPauseEnabled(rda->airplayConf()->panelPauseEnabled());
|
||||
air_panel->setCard(0,rda->airplayConf()->card(RDAirPlayConf::SoundPanel1Channel));
|
||||
air_panel->setPort(0,rda->airplayConf()->port(RDAirPlayConf::SoundPanel1Channel));
|
||||
@ -599,8 +572,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
air_pause_enabled=rda->airplayConf()->pauseEnabled();
|
||||
for(int i=0;i<RDAIRPLAY_LOG_QUANTITY;i++) {
|
||||
air_log_list[i]=new ListLog(air_log[i],i,air_pause_enabled,this);
|
||||
air_log_list[i]->setGeometry(510,140,air_log_list[i]->sizeHint().width(),
|
||||
air_log_list[i]->sizeHint().height());
|
||||
air_log_list[i]->hide();
|
||||
connect(air_log_list[i],SIGNAL(selectClicked(int,int,RDLogLine::Status)),
|
||||
this,SLOT(selectClickedData(int,int,RDLogLine::Status)));
|
||||
@ -615,7 +586,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
connect(mapper,SIGNAL(mapped(int)),this,SLOT(fullLogButtonData(int)));
|
||||
for(int i=0;i<RDAIRPLAY_LOG_QUANTITY;i++) {
|
||||
air_log_button[i]=new QPushButton(this);
|
||||
air_log_button[i]->setGeometry(647+i*123,sizeHint().height()-65,118,60);
|
||||
air_log_button[i]->setFont(bigButtonFont());
|
||||
air_log_button[i]->setFocusPolicy(Qt::NoFocus);
|
||||
mapper->setMapping(air_log_button[i],i);
|
||||
@ -637,7 +607,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
// Empty Cart
|
||||
//
|
||||
air_empty_cart=new RDEmptyCart(this);
|
||||
air_empty_cart->setGeometry(520,sizeHint().height()-51,32,32);
|
||||
if(!rda->station()->enableDragdrop()) {
|
||||
air_empty_cart->hide();
|
||||
}
|
||||
@ -646,7 +615,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
// SoundPanel Button
|
||||
//
|
||||
air_panel_button=new QPushButton(this);
|
||||
air_panel_button->setGeometry(562,sizeHint().height()-65,80,60);
|
||||
air_panel_button->setFont(bigButtonFont());
|
||||
air_panel_button->setText(tr("Sound\nPanel"));
|
||||
air_panel_button->setPalette(active_color);
|
||||
@ -667,8 +635,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
||||
//
|
||||
air_button_list=
|
||||
new ButtonLog(air_log[0],0,rda->airplayConf(),air_pause_enabled,this);
|
||||
air_button_list->setGeometry(10,140,air_button_list->sizeHint().width(),
|
||||
air_button_list->sizeHint().height());
|
||||
connect(air_button_list,SIGNAL(selectClicked(int,int,RDLogLine::Status)),
|
||||
this,SLOT(selectClickedData(int,int,RDLogLine::Status)));
|
||||
connect(air_button_list,SIGNAL(cartDropped(int,int,RDLogLine *)),
|
||||
@ -1985,6 +1951,73 @@ void MainWidget::closeEvent(QCloseEvent *e)
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
int w=width();
|
||||
int h=height();
|
||||
|
||||
//
|
||||
// Top Row
|
||||
//
|
||||
air_clock->setGeometry(10,5,air_clock->sizeHint().width(),
|
||||
air_clock->sizeHint().height());
|
||||
air_post_counter->setGeometry(220,5,air_post_counter->sizeHint().width(),
|
||||
air_post_counter->sizeHint().height());
|
||||
air_pie_counter->setGeometry(426,5,air_pie_counter->sizeHint().width(),
|
||||
air_pie_counter->sizeHint().height());
|
||||
air_stop_counter->setGeometry(600,5,air_stop_counter->sizeHint().width(),
|
||||
air_stop_counter->sizeHint().height());
|
||||
air_mode_display->
|
||||
setGeometry(sizeHint().width()-air_mode_display->sizeHint().width()-10,
|
||||
5,air_mode_display->sizeHint().width(),
|
||||
air_mode_display->sizeHint().height());
|
||||
|
||||
//
|
||||
// Meter Row
|
||||
//
|
||||
air_stereo_meter->setGeometry(50,70,air_stereo_meter->sizeHint().width(),
|
||||
air_stereo_meter->sizeHint().height());
|
||||
air_message_label->setGeometry(sizeHint().width()-425,70,
|
||||
MESSAGE_WIDGET_WIDTH,air_stereo_meter->sizeHint().height());
|
||||
|
||||
//
|
||||
// Button Log
|
||||
//
|
||||
air_button_list->setGeometry(10,140,air_button_list->sizeHint().width(),
|
||||
air_button_list->sizeHint().height());
|
||||
|
||||
//
|
||||
// Sound Panel
|
||||
//
|
||||
air_panel->setGeometry(510,140,air_panel->sizeHint().width(),
|
||||
air_panel->sizeHint().height());
|
||||
//
|
||||
// Full Log Widgets
|
||||
//
|
||||
for(int i=0;i<RDAIRPLAY_LOG_QUANTITY;i++) {
|
||||
air_log_list[i]->setGeometry(510,140,w-530,h-210);
|
||||
// air_log_list[i]->setGeometry(510,140,air_log_list[i]->sizeHint().width(),
|
||||
// air_log_list[i]->sizeHint().height());
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Bottom Button Row
|
||||
//
|
||||
air_add_button->setGeometry(10,size().height()-65,80,60);
|
||||
air_delete_button->setGeometry(100,size().height()-65,80,60);
|
||||
air_move_button->setGeometry(190,size().height()-65,80,60);
|
||||
air_copy_button->setGeometry(280,size().height()-65,80,60);
|
||||
|
||||
air_empty_cart->setGeometry(520,size().height()-51,32,32);
|
||||
|
||||
air_panel_button->setGeometry(562,size().height()-65,80,60);
|
||||
for(int i=0;i<RDAIRPLAY_LOG_QUANTITY;i++) {
|
||||
air_log_button[i]->setGeometry(647+i*123,size().height()-65,118,60);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
QPainter *p=new QPainter(this);
|
||||
|
@ -35,11 +35,7 @@
|
||||
#include "post_counter.h"
|
||||
#include "pie_counter.h"
|
||||
#include "stop_counter.h"
|
||||
|
||||
//
|
||||
// Debug Settings
|
||||
//
|
||||
//#define RESIZABLE
|
||||
#include "wall_clock.h"
|
||||
|
||||
//
|
||||
// Widget Settings
|
||||
@ -94,12 +90,13 @@ class MainWidget : public RDWidget
|
||||
void masterTimerData();
|
||||
void transportChangedData();
|
||||
void timeModeData(RDAirPlayConf::TimeMode mode);
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *e);
|
||||
void keyReleaseEvent(QKeyEvent *e);
|
||||
void closeEvent(QCloseEvent *);
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
void paintEvent(QPaintEvent *e);
|
||||
|
||||
protected:
|
||||
void wheelEvent(QWheelEvent *e);
|
||||
|
||||
private:
|
||||
@ -192,6 +189,9 @@ class MainWidget : public RDWidget
|
||||
RDEventPlayer *air_event_player;
|
||||
RDHotKeyList *air_keylist;
|
||||
RDHotkeys *air_hotkeys;
|
||||
|
||||
|
||||
WallClock *air_clock;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user