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

* Added an 'RDApplication::userChanged() signal.
This commit is contained in:
Fred Gleason 2018-01-31 17:17:31 -05:00
parent b1d43dde69
commit 0e47266a4d
13 changed files with 26 additions and 33 deletions

View File

@ -16625,3 +16625,5 @@
* Converted rdclilogedit(1) to use RDApplication.
2018-02-01 Fred Gleason <fredg@paravelsystems.com>
* Converted rddelete(1) to use RDApplication.
2018-02-01 Fred Gleason <fredg@paravelsystems.com>
* Added an 'RDApplication::userChanged() signal.

View File

@ -147,6 +147,7 @@ bool RDApplication::open(QString *err_msg)
app_user=new RDUser();
app_cae=new RDCae(app_station,app_config,this);
app_ripc=new RDRipc(app_station,app_config,this);
connect(app_ripc,SIGNAL(userChanged()),this,SLOT(userChangedData()));
return true;
}
@ -216,3 +217,10 @@ RDUser *RDApplication::user()
{
return app_user;
}
void RDApplication::userChangedData()
{
app_user->setName(app_ripc->user());
emit userChanged();
}

View File

@ -56,6 +56,12 @@ class RDApplication : public QObject
RDSystem *system();
RDUser *user();
private slots:
void userChangedData();
signals:
void userChanged();
private:
RDAirPlayConf *app_airplay_conf;
RDAirPlayConf *app_panel_conf;

View File

@ -316,7 +316,7 @@ MainWidget::MainWidget(QWidget *parent)
// RIPC Connection
//
connect(rda->ripc(),SIGNAL(connected(bool)),this,SLOT(ripcConnected(bool)));
connect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda->ripc(),SIGNAL(rmlReceived(RDMacro *)),
this,SLOT(rmlReceivedData(RDMacro *)));
connect(rda->ripc(),SIGNAL(gpiStateChanged(int,int,bool)),
@ -1434,13 +1434,6 @@ void MainWidget::logReloadedData(int log)
void MainWidget::userData()
{
/*
if(rduser!=NULL) {
delete rduser;
}
rduser=new RDUser(rda->ripc()->user());
*/
rda->user()->setName(rda->ripc()->user());
LogLine(RDConfig::LogInfo,QString().
sprintf("user changed to '%s'",(const char *)rda->ripc()->user()));
SetCaption();

View File

@ -97,7 +97,7 @@ MainWidget::MainWidget(QWidget *parent)
//
// RIPC Connection
//
connect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda->ripc(),SIGNAL(rmlReceived(RDMacro *)),
this,SLOT(rmlReceivedData(RDMacro *)));
@ -182,7 +182,6 @@ QSizePolicy MainWidget::sizePolicy() const
void MainWidget::userData()
{
rda->user()->setName(rda->ripc()->user());
for(unsigned i=0;i<panel_slots.size();i++) {
panel_slots[i]->setUser(rda->user());
}

View File

@ -106,7 +106,7 @@ MainWidget::MainWidget(QWidget *parent)
// RIPC Connection
//
#ifndef WIN32
connect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userChangedData()));
connect(rda,SIGNAL(userChanged()),this,SLOT(userChangedData()));
rda->ripc()->connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
#endif // WIN32
@ -193,7 +193,6 @@ void MainWidget::userChangedData()
QString str1;
QString str2;
rda->user()->setName(rda->ripc()->user());
str1=QString("RDCastManager")+" v"+VERSION+" - "+tr("Host");
str2=QString(tr("User"));
setCaption(str1+": "+rda->config()->stationName()+" "+str2+" "+rda->ripc()->user());

View File

@ -227,7 +227,7 @@ MainWidget::MainWidget(QWidget *parent)
//
connect(rda->ripc(),SIGNAL(connected(bool)),
this,SLOT(ripcConnectedData(bool)));
connect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(ripcUserData()));
connect(rda,SIGNAL(userChanged()),this,SLOT(ripcUserData()));
rda->ripc()->connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
//
@ -922,13 +922,6 @@ void MainWidget::ripcUserData()
str=QString("RDCatch")+" v"+VERSION+" - "+tr("Host")+":";
setCaption(str+" "+rda->config()->stationName()+", "+tr("User")+": "+
rda->ripc()->user());
/*
if(catch_user!=NULL) {
delete catch_user;
}
catch_user=new RDUser(rda->ripc()->user());
*/
rda->user()->setName(rda->ripc()->user());
//
// Set Control Perms

View File

@ -179,7 +179,7 @@ MainWidget::MainWidget(QWidget *parent)
rdaudioport_conf=new RDAudioPort(rda->config()->stationName(),
rda->libraryConf()->inputCard());
connect(rda->ripc(),SIGNAL(connected(bool)),this,SLOT(connectedData(bool)));
connect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
rda->ripc()->
connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
cut_clipboard=NULL;
@ -498,7 +498,6 @@ void MainWidget::userData()
}
SetCaption(rda->ripc()->user());
rda->user()->setName(rda->ripc()->user());
lib_group_box->clear();
lib_group_box->insertItem(tr("ALL"));

View File

@ -153,7 +153,7 @@ MainWidget::MainWidget(QWidget *parent)
//
#ifndef WIN32
connect(rda->ripc(),SIGNAL(connected(bool)),this,SLOT(connectedData(bool)));
connect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
rda->ripc()->connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
#else
rdripc=NULL;
@ -336,8 +336,6 @@ void MainWidget::userData()
str2=QString(tr("User"));
setCaption(str1+": "+rda->config()->stationName()+", "+str2+": "+
rda->ripc()->user());
rda->user()->setName(rda->ripc()->user());
log_filter_widget->setUser(rda->user());
RefreshList();

View File

@ -130,7 +130,7 @@ MainWidget::MainWidget(QWidget *parent)
//
// RIPC Connection
//
connect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
rda->ripc()->connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
//
@ -249,7 +249,6 @@ void MainWidget::userData()
QString str1=tr("RDLogManager - User: ");
setCaption(QString().sprintf("%s%s",(const char *)str1,
(const char *)rda->ripc()->user()));
rda->user()->setName(rda->ripc()->user());
//
// Set Control Perms

View File

@ -150,7 +150,7 @@ MainWidget::MainWidget(QWidget *parent)
//
// RIPC Connection
//
connect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda->ripc(),SIGNAL(rmlReceived(RDMacro *)),
this,SLOT(rmlReceivedData(RDMacro *)));
@ -345,7 +345,6 @@ QSizePolicy MainWidget::sizePolicy() const
void MainWidget::userData()
{
rda->user()->setName(rda->ripc()->user());
SetCaption();
rda->ripc()->sendOnairFlag();
}

View File

@ -75,7 +75,7 @@ MainObject::MainObject(QObject *parent)
//
// RIPC Connection
//
connect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
rda->ripc()->
connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
}
@ -90,7 +90,6 @@ void MainObject::userData()
// Get User Context
//
disconnect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userData()));
rda->user()->setName(rda->ripc()->user());
//
// Start up command processor

View File

@ -110,7 +110,7 @@ MainObject::MainObject(QObject *parent)
//
// RIPC Connection
//
connect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
rda->ripc()->connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
//
@ -149,7 +149,6 @@ void MainObject::userData()
// Get User Context
//
disconnect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userData()));
rda->user()->setName(rda->ripc()->user());
//
// Process Objects