From 822fb1de9205c9d541f6c386f6e668b52d17891c Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Mon, 30 Jan 2023 15:12:42 -0500 Subject: [PATCH] 2023-01-30 Fred Gleason * Removed the 'single instance' requirement from all modules. * Removed the 'Allow Multiple Instances' dropdown from the 'Configure RDLibrary' dialog in rdadmin(1). * Removed the 'Allow Multiple Instances' dropdown from the 'Configure RDLogEdit' dialog in rdadmin(1). * Removed the wmctrl(1) dependency from the 'rivendell' DEB package. * Removed the wmctrl(1) dependency from the 'rivendell' RPM package. Signed-off-by: Fred Gleason --- ChangeLog | 8 +++++ INSTALL | 4 --- debian/control.src | 2 +- lib/rdapplication.cpp | 52 +-------------------------------- lib/rdapplication.h | 1 - rdadmin/edit_rdlibrary.cpp | 17 +---------- rdadmin/edit_rdlibrary.h | 3 +- rdadmin/edit_rdlogedit.cpp | 18 +----------- rdadmin/edit_rdlogedit.h | 3 +- rdairplay/rdairplay.cpp | 11 +------ rdcartslots/rdcartslots.cpp | 11 +------ rdcastmanager/rdcastmanager.cpp | 11 +------ rdcatch/rdcatch.cpp | 11 +------ rdlibrary/rdlibrary.cpp | 13 +-------- rdlogedit/rdlogedit.cpp | 13 +-------- rdlogin/rdlogin.cpp | 11 +------ rdlogmanager/rdlogmanager.cpp | 11 +------ rdpanel/rdpanel.cpp | 11 +------ rivendell.spec.in | 4 +-- 19 files changed, 25 insertions(+), 190 deletions(-) diff --git a/ChangeLog b/ChangeLog index 68fe700c..d72f89cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23962,3 +23962,11 @@ * Fixed a bug in rdlogmanager(1) that would cause the pre-import and post-import event lists to fail to be propagated to the newly created event. +2023-01-30 Fred Gleason + * Removed the 'single instance' requirement from all modules. + * Removed the 'Allow Multiple Instances' dropdown from the + 'Configure RDLibrary' dialog in rdadmin(1). + * Removed the 'Allow Multiple Instances' dropdown from the + 'Configure RDLogEdit' dialog in rdadmin(1). + * Removed the wmctrl(1) dependency from the 'rivendell' DEB package. + * Removed the wmctrl(1) dependency from the 'rivendell' RPM package. diff --git a/INSTALL b/INSTALL index ce2e3eeb..2aa2aa33 100644 --- a/INSTALL +++ b/INSTALL @@ -96,10 +96,6 @@ TagLib Audio Meta-Data Library, v1.8 or better A high-quality C++ library for reading and writing a variety of audio metadata formats. Available at https://taglib.org/. -wmctrl -A UNIX/Linux command line tool to interact with an EWMH/NetWM compatible X -Window Manager. Available in most distros. - X11 Window System Virtually all Linux distros should include this. diff --git a/debian/control.src b/debian/control.src index f36b61cb..9bdb090a 100644 --- a/debian/control.src +++ b/debian/control.src @@ -7,7 +7,7 @@ Standards-Version: 4.4.1 Package: rivendell Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, mariadb-client, libqt5sql5-mysql, qttranslations5-l10n, apache2, curl, rsyslog, python3, python3-pycurl, python3-mysqldb, python3-serial, python3-requests, icedax, wmctrl, qt5-style-plugins, xsltproc +Depends: ${shlibs:Depends}, ${misc:Depends}, mariadb-client, libqt5sql5-mysql, qttranslations5-l10n, apache2, curl, rsyslog, python3, python3-pycurl, python3-mysqldb, python3-serial, python3-requests, icedax, qt5-style-plugins, xsltproc Replaces: rivendell-pypad Description: Radio Broadcast Automation System Rivendell is a complete radio broadcast automation solution, with diff --git a/lib/rdapplication.cpp b/lib/rdapplication.cpp index 9e89993e..e6444a41 100644 --- a/lib/rdapplication.cpp +++ b/lib/rdapplication.cpp @@ -2,7 +2,7 @@ // // Base GUI Application Class // -// (C) Copyright 2021-2022 Fred Gleason +// (C) Copyright 2021-2023 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 @@ -38,56 +38,6 @@ RDApplication::~RDApplication() } -bool RDApplication::makeSingleInstance(QString *err_msg) -{ - // - // If we're already running, then just raise the window. - // - QStringList args; - args.clear(); - args.push_back("-l"); - QProcess *proc=new QProcess(this); - proc->start("wmctrl",args); - proc->waitForFinished(); - if(proc->exitStatus()!=QProcess::NormalExit) { - *err_msg=tr("wmctrl(1) process crashed"); - delete proc; - return false; - } - if(proc->exitCode()!=0) { - QString errs=QString::fromUtf8(proc->readAllStandardError()); - if(errs.isEmpty()) { - *err_msg=tr("wmctrl(1) not found\n"); - } - else { - *err_msg=QString::asprintf("wmctrl(1) process returned error [%s]", - errs.toUtf8().constData()); - } - delete proc; - return false; - } - bool found=false; - QStringList f0=QString::fromUtf8(proc->readAllStandardOutput()). - split("\n",QString::SkipEmptyParts); - for(int i=0;i=6) { - if((f1.at(3).trimmed().toLower()==commandName())&& - (f1.at(4)==(QString("v")+VERSION))&& - (f1.at(5)=="-")) { - Raise(f1.at(0)); - found=true; - } - } - } - delete proc; - if(found) { - exit(0); - } - return true; -} - - RDIconEngine *RDApplication::iconEngine() const { return app_icon_engine; diff --git a/lib/rdapplication.h b/lib/rdapplication.h index 07cb5abc..6f4834b9 100644 --- a/lib/rdapplication.h +++ b/lib/rdapplication.h @@ -31,7 +31,6 @@ class RDApplication : public RDCoreApplication RDApplication(const QString &module_name,const QString &cmdname, const QString &usage,QObject *parent); ~RDApplication(); - bool makeSingleInstance(QString *err_msg); RDIconEngine *iconEngine() const; static QString locale(); diff --git a/rdadmin/edit_rdlibrary.cpp b/rdadmin/edit_rdlibrary.cpp index b10a8d30..c6973ef3 100644 --- a/rdadmin/edit_rdlibrary.cpp +++ b/rdadmin/edit_rdlibrary.cpp @@ -2,7 +2,7 @@ // // Edit an RDLibrary Configuration // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 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 @@ -271,19 +271,6 @@ EditRDLibrary::EditRDLibrary(RDStation *station,RDStation *cae_station, lib_limit_search_label->setGeometry(10,398,175,19); lib_limit_search_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - // - // Allow Multiple Instances - // - lib_singleton_box=new QComboBox(this); - lib_singleton_box->setGeometry(190,422,80,19); - lib_singleton_box->insertItem(0,tr("No")); - lib_singleton_box->insertItem(1,tr("Yes")); - QLabel *lib_singleton_label= - new QLabel(tr("Allow Multiple Instances")+":",this); - lib_singleton_label->setFont(labelFont()); - lib_singleton_label->setGeometry(10,422,175,19); - lib_singleton_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - // // Defaults // @@ -440,7 +427,6 @@ EditRDLibrary::EditRDLibrary(RDStation *station,RDStation *cae_station, lib_editor_box->setCurrentIndex(lib_lib->enableEditor()); lib_converter_box->setCurrentIndex(lib_lib->srcConverter()); lib_limit_search_box->setCurrentIndex((int)lib_lib->limitSearch()); - lib_singleton_box->setCurrentIndex(!lib_lib->isSingleton()); } @@ -565,7 +551,6 @@ void EditRDLibrary::okData() lib_lib->setSrcConverter(lib_converter_box->currentIndex()); lib_lib->setLimitSearch((RDLibraryConf::SearchLimit) lib_limit_search_box->currentIndex()); - lib_lib->setIsSingleton(lib_singleton_box->currentIndex()==0); done(0); } diff --git a/rdadmin/edit_rdlibrary.h b/rdadmin/edit_rdlibrary.h index 030d8ad6..3b64dec3 100644 --- a/rdadmin/edit_rdlibrary.h +++ b/rdadmin/edit_rdlibrary.h @@ -2,7 +2,7 @@ // // Edit an RDLibrry Configuration // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 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 @@ -71,7 +71,6 @@ class EditRDLibrary : public RDDialog QComboBox *lib_editor_box; QComboBox *lib_converter_box; QComboBox *lib_limit_search_box; - QComboBox *lib_singleton_box; }; diff --git a/rdadmin/edit_rdlogedit.cpp b/rdadmin/edit_rdlogedit.cpp index cc0150aa..28f95ffa 100644 --- a/rdadmin/edit_rdlogedit.cpp +++ b/rdadmin/edit_rdlogedit.cpp @@ -2,7 +2,7 @@ // // Edit an RDLogedit Configuration // -// (C) Copyright 2002-2021 Fred Gleason +// (C) Copyright 2002-2023 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 @@ -282,20 +282,6 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station, lib_default_transtype_box->insertItem(1,tr("Segue")); lib_default_transtype_box->insertItem(2,tr("Stop")); - // - // Allow Multiple Instances - // - lib_singleton_box=new QComboBox(this); - lib_singleton_box->setGeometry(180,434,100,19); - QLabel *lib_singleton_label= - new QLabel(tr("Allow Multiple Instances")+":",this); - lib_singleton_label->setFont(labelFont()); - lib_singleton_label->setGeometry(0,434,175,19); - lib_singleton_label-> - setAlignment(Qt::AlignRight|Qt::AlignVCenter); - lib_singleton_box->insertItem(0,tr("No")); - lib_singleton_box->insertItem(1,tr("Yes")); - // // Ok Button // @@ -379,7 +365,6 @@ EditRDLogedit::EditRDLogedit(RDStation *station,RDStation *cae_station, ShowBitRates(lib_format_box->currentIndex(),lib_lib->bitrate()); lib_enable_second_start_box->setCurrentIndex(lib_lib->enableSecondStart()); lib_default_transtype_box->setCurrentIndex(lib_lib->defaultTransType()); - lib_singleton_box->setCurrentIndex(!lib_lib->isSingleton()); } @@ -508,7 +493,6 @@ void EditRDLogedit::okData() lib_lib->setEnableSecondStart(lib_enable_second_start_box->currentIndex()); lib_lib->setDefaultTransType( (RDLogLine::TransType)lib_default_transtype_box->currentIndex()); - lib_lib->setIsSingleton(lib_singleton_box->currentIndex()==0); done(0); } diff --git a/rdadmin/edit_rdlogedit.h b/rdadmin/edit_rdlogedit.h index 5401bafd..9b4811cf 100644 --- a/rdadmin/edit_rdlogedit.h +++ b/rdadmin/edit_rdlogedit.h @@ -2,7 +2,7 @@ // // Edit an RDLogEdit Configuration // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 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 @@ -66,7 +66,6 @@ class EditRDLogedit : public RDDialog QLineEdit *lib_recstartcart_edit; QLineEdit *lib_recendcart_edit; QComboBox *lib_default_transtype_box; - QComboBox *lib_singleton_box; QString lib_filter; QString lib_group; }; diff --git a/rdairplay/rdairplay.cpp b/rdairplay/rdairplay.cpp index a129e189..6f18057d 100644 --- a/rdairplay/rdairplay.cpp +++ b/rdairplay/rdairplay.cpp @@ -70,19 +70,10 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent) // air_startup_datetime=QDateTime(QDate::currentDate(),QTime::currentTime()); - // - // Ensure that we're the only instance - // - rda=new RDApplication("RDAirPlay","rdairplay",RDAIRPLAY_USAGE,this); - if(!rda->makeSingleInstance(&err_msg)) { - QMessageBox::critical(this,"RDAirPlay - "+tr("Error"), - tr("Startup error")+": "+err_msg+"."); - exit(RDCoreApplication::ExitPriorInstance); - } - // // Open the Database // + rda=new RDApplication("RDAirPlay","rdairplay",RDAIRPLAY_USAGE,this); if(!rda->open(&err_msg,NULL,true)) { QMessageBox::critical(this,"RDAirPlay - "+tr("Error"),err_msg); exit(1); diff --git a/rdcartslots/rdcartslots.cpp b/rdcartslots/rdcartslots.cpp index 2b341232..5bef1bdb 100644 --- a/rdcartslots/rdcartslots.cpp +++ b/rdcartslots/rdcartslots.cpp @@ -2,7 +2,7 @@ // // A Dedicated Cart Slot Utility for Rivendell. // -// (C) Copyright 2012-2022 Fred Gleason +// (C) Copyright 2012-2023 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 @@ -40,15 +40,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) exit(1); } - // - // Ensure that we're the only instance - // - if(!rda->makeSingleInstance(&err_msg)) { - QMessageBox::critical(this,"RDCartSlots - "+tr("Error"), - tr("Startup error")+": "+err_msg+"."); - exit(RDCoreApplication::ExitPriorInstance); - } - // // Read Command Options // diff --git a/rdcastmanager/rdcastmanager.cpp b/rdcastmanager/rdcastmanager.cpp index 9689941e..42d0861c 100644 --- a/rdcastmanager/rdcastmanager.cpp +++ b/rdcastmanager/rdcastmanager.cpp @@ -2,7 +2,7 @@ // // A PodCast Management Utility for Rivendell. // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 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 @@ -66,15 +66,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) setWindowIcon(rda->iconEngine()-> applicationIcon(RDIconEngine::RdCastManager,22)); - // - // Ensure that we're the only instance - // - if(!rda->makeSingleInstance(&err_msg)) { - QMessageBox::critical(this,"RDCastManager - "+tr("Error"), - tr("Startup error")+": "+err_msg+"."); - exit(RDCoreApplication::ExitPriorInstance); - } - // // Read Command Options // diff --git a/rdcatch/rdcatch.cpp b/rdcatch/rdcatch.cpp index 43ca574a..53c5e061 100644 --- a/rdcatch/rdcatch.cpp +++ b/rdcatch/rdcatch.cpp @@ -2,7 +2,7 @@ // // The Event Schedule Manager for Rivendell. // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 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 @@ -72,15 +72,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) exit(1); } - // - // Ensure that we're the only instance - // - if(!rda->makeSingleInstance(&err_msg)) { - QMessageBox::critical(this,"RDCatch - "+tr("Error"), - tr("Startup error")+": "+err_msg+"."); - exit(RDCoreApplication::ExitPriorInstance); - } - // // Read Command Options // diff --git a/rdlibrary/rdlibrary.cpp b/rdlibrary/rdlibrary.cpp index 33b59045..44ae3b22 100644 --- a/rdlibrary/rdlibrary.cpp +++ b/rdlibrary/rdlibrary.cpp @@ -2,7 +2,7 @@ // // The Library Utility for Rivendell. // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 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 @@ -93,17 +93,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) } setWindowIcon(rda->iconEngine()->applicationIcon(RDIconEngine::RdLibrary,22)); - if(rda->libraryConf()->isSingleton()) { - // - // Ensure that we're the only instance - // - if(!rda->makeSingleInstance(&err_msg)) { - QMessageBox::critical(this,"RDLibrary - "+tr("Error"), - tr("Startup error")+": "+err_msg+"."); - exit(RDCoreApplication::ExitPriorInstance); - } - } - // // Read Command Options // diff --git a/rdlogedit/rdlogedit.cpp b/rdlogedit/rdlogedit.cpp index ae12a1ea..027010ba 100644 --- a/rdlogedit/rdlogedit.cpp +++ b/rdlogedit/rdlogedit.cpp @@ -2,7 +2,7 @@ // // The Log Editor Utility for Rivendell. // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 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 @@ -67,17 +67,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) } log_import_path=RDGetHomeDir(); - if(rda->logeditConf()->isSingleton()) { - // - // Ensure that we're the only instance - // - if(!rda->makeSingleInstance(&err_msg)) { - QMessageBox::critical(this,"RDLogEdit - "+tr("Error"), - tr("Startup error")+": "+err_msg+"."); - exit(RDCoreApplication::ExitPriorInstance); - } - } - // // Read Command Options // diff --git a/rdlogin/rdlogin.cpp b/rdlogin/rdlogin.cpp index 5e365c9d..e9f2e6e1 100644 --- a/rdlogin/rdlogin.cpp +++ b/rdlogin/rdlogin.cpp @@ -2,7 +2,7 @@ // // The User Login/Logout Utility for Rivendell. // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 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 @@ -54,15 +54,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) } setWindowIcon(rda->iconEngine()->applicationIcon(RDIconEngine::Rivendell,22)); - // - // Ensure that we're the only instance - // - if(!rda->makeSingleInstance(&err_msg)) { - QMessageBox::critical(this,"RDLogin - "+tr("Error"), - tr("Startup error")+": "+err_msg+"."); - exit(RDCoreApplication::ExitPriorInstance); - } - // // Read Command Options // diff --git a/rdlogmanager/rdlogmanager.cpp b/rdlogmanager/rdlogmanager.cpp index beda309c..8d4ffee6 100644 --- a/rdlogmanager/rdlogmanager.cpp +++ b/rdlogmanager/rdlogmanager.cpp @@ -2,7 +2,7 @@ // // The Log Generator Utility for Rivendell. // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 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 @@ -61,15 +61,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) applicationIcon(RDIconEngine::RdLogManager,22)); setWindowTitle(QString("RDLogManager v")+VERSION+" -"); - // - // Ensure that we're the only instance - // - if(!rda->makeSingleInstance(&err_msg)) { - QMessageBox::critical(this,"RDLogManager - "+tr("Error"), - tr("Startup error")+": "+err_msg+"."); - exit(RDCoreApplication::ExitPriorInstance); - } - // // CAE Connection // diff --git a/rdpanel/rdpanel.cpp b/rdpanel/rdpanel.cpp index ee95d396..82c3cf63 100644 --- a/rdpanel/rdpanel.cpp +++ b/rdpanel/rdpanel.cpp @@ -2,7 +2,7 @@ // // A Dedicated Cart Wall Utility for Rivendell. // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 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 @@ -60,15 +60,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) } setWindowIcon(rda->iconEngine()->applicationIcon(RDIconEngine::RdPanel,22)); - // - // Ensure that we're the only instance - // - if(!rda->makeSingleInstance(&err_msg)) { - QMessageBox::critical(this,"RDPanel - "+tr("Error"), - tr("Startup error")+": "+err_msg+"."); - exit(RDCoreApplication::ExitPriorInstance); - } - // // Read Command Options // diff --git a/rivendell.spec.in b/rivendell.spec.in index c7ffb880..dd8e1d03 100644 --- a/rivendell.spec.in +++ b/rivendell.spec.in @@ -3,7 +3,7 @@ @GENERATED_SCRIPT_FILE_WARNING@ ## The Rivendell Radio Automation System -## Copyright (C) 2002-2022 Fred Gleason +## Copyright (C) 2002-2023 Fred Gleason ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of version 2 of the GNU General Public License as @@ -30,7 +30,7 @@ Release: @RPM_RELEASE@ License: GPL Packager: Fred Gleason Source: rivendell-@VERSION@.tar.gz -Requires: @MYSQL_PKG@ @QT_MYSQL_PKG@ @APACHE_PKG@ curl @USERMODE_PKG@ rsyslog qt5-qtstyleplugins qt5-qttranslations @PYPAD_DEPS@ libxslt icedax wmctrl +Requires: @MYSQL_PKG@ @QT_MYSQL_PKG@ @APACHE_PKG@ curl @USERMODE_PKG@ rsyslog qt5-qtstyleplugins qt5-qttranslations @PYPAD_DEPS@ libxslt icedax BuildRequires: qt5-qtbase-devel qt5-linguist BuildRoot: /var/tmp/rivendell-@VERSION@ Obsoletes: rivendell-base < 4.0.0 rivendell-opsguide < 4.0.0 rivendell-pypad < 4.0.0