2018-01-31 Fred Gleason <fredg@paravelsystems.com>

* Converted rdairplay(1) to use RDApplication.
This commit is contained in:
Fred Gleason
2018-01-30 18:18:57 -05:00
parent f692a3ac0d
commit a8ac305bdd
22 changed files with 410 additions and 412 deletions

View File

@@ -2,7 +2,7 @@
//
// The full log list for RDAirPlay
//
// (C) Copyright 2002-2006,2016-2017 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2006,2016-2018 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
@@ -22,17 +22,19 @@
#include <qpixmap.h>
#include <qpainter.h>
#include <qmessagebox.h>
#include <rddb.h>
#include <rdconf.h>
#include <rdlistviewitem.h>
#include <rddebug.h>
#include <rdlog.h>
#include <rdcreate_log.h>
#include <list_log.h>
#include <button_log.h>
#include <colors.h>
#include <globals.h>
#include <rdapplication.h>
#include <rdconf.h>
#include <rdcreate_log.h>
#include <rddb.h>
#include <rddebug.h>
#include <rdlistviewitem.h>
#include <rdlog.h>
#include "button_log.h"
#include "colors.h"
#include "globals.h"
#include "list_log.h"
#include "../icons/play.xpm"
#include "../icons/rml5.xpm"
@@ -162,10 +164,10 @@ ListLog::ListLog(LogPlay *log,RDCae *cae,int id,bool allow_pause,
list_log_list->setFont(list_font);
int y=0;
int h=sizeHint().height()-60;
if(rdairplay_conf->showCounters()) {
if(rda->airplayConf()->showCounters()) {
h-=60;
}
if(rdairplay_conf->hourSelectorEnabled()) {
if(rda->airplayConf()->hourSelectorEnabled()) {
y+=80;
h-=80;
list_hour_selector->setGeometry(0,0,sizeHint().width(),80);
@@ -233,7 +235,7 @@ ListLog::ListLog(LogPlay *log,RDCae *cae,int id,bool allow_pause,
label->setFont(label_font);
label->setAlignment(AlignCenter);
label->setBackgroundColor(QColor(system_mid_color));
if(!rdairplay_conf->showCounters()) {
if(!rda->airplayConf()->showCounters()) {
label->hide();
}
@@ -247,7 +249,7 @@ ListLog::ListLog(LogPlay *log,RDCae *cae,int id,bool allow_pause,
list_stoptime_label->setFont(label_font);
list_stoptime_label->setAlignment(AlignRight|AlignVCenter);
list_stoptime_label->setBackgroundColor(QColor(system_mid_color));
if(!rdairplay_conf->showCounters()) {
if(!rda->airplayConf()->showCounters()) {
list_stoptime_edit->hide();
list_stoptime_label->hide();
}
@@ -262,7 +264,7 @@ ListLog::ListLog(LogPlay *log,RDCae *cae,int id,bool allow_pause,
list_endtime_label->setFont(label_font);
list_endtime_label->setAlignment(AlignRight|AlignVCenter);
list_endtime_label->setBackgroundColor(QColor(system_mid_color));
if(!rdairplay_conf->showCounters()) {
if(!rda->airplayConf()->showCounters()) {
list_endtime_edit->hide();
list_endtime_label->hide();
}
@@ -289,7 +291,7 @@ ListLog::ListLog(LogPlay *log,RDCae *cae,int id,bool allow_pause,
list_head_button->setText(tr("Audition\nHead"));
list_head_button->setFocusPolicy(QWidget::NoFocus);
connect(list_head_button,SIGNAL(clicked()),this,SLOT(headButtonData()));
if(!rdairplay_conf->showCounters()) {
if(!rda->airplayConf()->showCounters()) {
list_head_button->hide();
}
@@ -303,7 +305,7 @@ ListLog::ListLog(LogPlay *log,RDCae *cae,int id,bool allow_pause,
list_tail_button->setText(tr("Audition\nTail"));
list_tail_button->setFocusPolicy(QWidget::NoFocus);
connect(list_tail_button,SIGNAL(clicked()),this,SLOT(tailButtonData()));
if(!rdairplay_conf->showCounters()) {
if(!rda->airplayConf()->showCounters()) {
list_tail_button->hide();
}
@@ -872,7 +874,7 @@ void ListLog::loadButtonData()
break;
case ListLogs::SaveAs:
if(!RDLog::create(name,svcname,rdripc->user(),&err_msg,air_config)) {
if(!RDLog::create(name,svcname,rda->ripc()->user(),&err_msg,rda->config())) {
QMessageBox::warning(this,"RDAirPlay - "+tr("Error"),err_msg);
return;
}
@@ -1085,7 +1087,7 @@ void ListLog::cartDroppedData(int line,RDLogLine *ll)
void ListLog::paintEvent(QPaintEvent *e)
{
if(!rdairplay_conf->showCounters()) {
if(!rda->airplayConf()->showCounters()) {
return;
}
int x=336;