diff --git a/JACKSettings.pro b/JACKSettings.pro index fbf0141..8afaa1f 100644 --- a/JACKSettings.pro +++ b/JACKSettings.pro @@ -22,22 +22,22 @@ DEFINES += QT_DEPRECATED_WARNINGS #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += src/main.cpp \ - src/device.cpp \ - src/driver.cpp \ - src/sysinfo.cpp \ - src/servicecontrol.cpp \ - src/settings.cpp \ - src/ui/debuglogger.cpp \ - src/ui/mainwindow.cpp \ - src/userinfo.cpp + src/device.cpp \ + src/driver.cpp \ + src/sysinfo.cpp \ + src/servicecontrol.cpp \ + src/settings.cpp \ + src/ui/servicelogger.cpp \ + src/ui/mainwindow.cpp \ + src/userinfo.cpp HEADERS += src/ui/mainwindow.h \ - src/device.h \ - src/driver.h \ - src/sysinfo.h \ - src/servicecontrol.h \ - src/settings.h \ - src/ui/debuglogger.h \ - src/userinfo.h + src/device.h \ + src/driver.h \ + src/sysinfo.h \ + src/servicecontrol.h \ + src/settings.h \ + src/ui/servicelogger.h \ + src/userinfo.h FORMS += src/ui/mainwindow.ui INCLUDEPATH += $$_PRO_FILE_PWD_/external/CLI11/include @@ -50,30 +50,30 @@ TRANSLATIONS += resources/translations/jacksettings_it.ts # Default rules for deployment. qnx { - target.path = /tmp/$${TARGET}/bin + target.path = /tmp/$${TARGET}/bin } unix:!android { - desktop.files = resources/linux/$${TARGET}.desktop - desktop.path = /usr/share/applications/ + desktop.files = resources/linux/$${TARGET}.desktop + desktop.path = /usr/share/applications/ - icon.files = resources/icons/icon.png - icon.path = /usr/share/$${TARGET}/icons/ + icon.files = resources/icons/icon.png + icon.path = /usr/share/$${TARGET}/icons/ - translations.files = resources/translations/*.qm - translations.path = /usr/share/$${TARGET}/translations/ + translations.files = resources/translations/*.qm + translations.path = /usr/share/$${TARGET}/translations/ - target.files = $${TARGET} - target.path = /usr/bin + target.files = $${TARGET} + target.path = /usr/bin - INSTALLS += desktop icon translations target + INSTALLS += desktop icon translations target } win32 { - RC_FILE = resources/icons/icon.rc + RC_FILE = resources/icons/icon.rc } mac { - CONFIG += app_bundle - ICON = resources/icons/icon.icns + CONFIG += app_bundle + ICON = resources/icons/icon.icns } DISTFILES += .editorconfig \ - README.md \ - TODO.md + README.md \ + TODO.md diff --git a/resources/translations/jacksettings_it.qm b/resources/translations/jacksettings_it.qm index 7c7d52a..27dfa83 100644 Binary files a/resources/translations/jacksettings_it.qm and b/resources/translations/jacksettings_it.qm differ diff --git a/resources/translations/jacksettings_it.ts b/resources/translations/jacksettings_it.ts index e54ef0c..9574738 100644 --- a/resources/translations/jacksettings_it.ts +++ b/resources/translations/jacksettings_it.ts @@ -1,14 +1,6 @@ - - DebugLogger - - - Clear - Pulisci - - MainWindow @@ -472,51 +464,51 @@ &Esci - + JACK Settings Impostazioni JACK - - + + Started Avviato - - + + Stop Ferma - + Stop JACK Server Ferma Server JACK - - + + Stopped Fermato - - + + Start Avvia - + Start JACK Server Avvia Server JACK - + Stop ALSA Bridge Ferma ALSA Bridge - + Start ALSA Bridge Avvia ALSA Bridge @@ -524,11 +516,19 @@ QObject - + I couldn't detect any system tray on this system. Non riesco a rilevare alcuna system tray in questo sistema. + + ServiceLogger + + + Clear + Pulisci + + SysInfo diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 797959e..9f35ccd 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -14,7 +14,7 @@ For a full copy of the GNU General Public License see the LICENSE file */ #include "mainwindow.h" -#include "debuglogger.h" +#include "servicelogger.h" #include "ui_mainwindow.h" #include "src/servicecontrol.h" #include "src/userinfo.h" @@ -222,8 +222,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), updateJackStatus(); } - jackService = new ServiceControl("jack@" + settings->profileName() + ".service", this); - a2jService = new ServiceControl("a2jmidi@" + settings->profileName() + ".service", this); + QString jackSvcName = "jack@" + settings->profileName() + ".service"; + QString a2jSvcName = "a2jmidi@" + settings->profileName() + ".service"; + jackService = new ServiceControl(jackSvcName, this); + a2jService = new ServiceControl(a2jSvcName, this); enumerateProfiles(); updateJackSettingsUI(); updateDriverSettingsUI(); @@ -292,7 +294,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), connect(ui->sbxLatencyIn, QOverload::of(&QSpinBox::valueChanged), this, &MainWindow::onSettingsChanged); connect(ui->sbxLatencyOut, QOverload::of(&QSpinBox::valueChanged), this, &MainWindow::onSettingsChanged); - txtLog = new DebugLogger(this, settings->profileName()); + txtLog = new ServiceLogger(jackSvcName, this); txtLog->setReadOnly(true); txtLog->setParent(ui->tabLog); txtLog->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); diff --git a/src/ui/mainwindow.h b/src/ui/mainwindow.h index 22f2429..414cb05 100644 --- a/src/ui/mainwindow.h +++ b/src/ui/mainwindow.h @@ -25,7 +25,7 @@ namespace Ui { class MainWindow; } QT_END_NAMESPACE class ServiceControl; -class DebugLogger; +class ServiceLogger; class QRadioButton; class QSystemTrayIcon; class MainWindow : public QMainWindow @@ -83,7 +83,7 @@ class MainWindow : public QMainWindow QAction *actQuit; QMenu *mnuTray; QSystemTrayIcon *icoTray; - DebugLogger *txtLog; + ServiceLogger *txtLog; std::array grpClockSource; std::array grpAutoConnect; diff --git a/src/ui/debuglogger.cpp b/src/ui/servicelogger.cpp similarity index 72% rename from src/ui/debuglogger.cpp rename to src/ui/servicelogger.cpp index 70c2004..dd84225 100644 --- a/src/ui/debuglogger.cpp +++ b/src/ui/servicelogger.cpp @@ -13,31 +13,31 @@ For a full copy of the GNU General Public License see the LICENSE file */ -#include "debuglogger.h" +#include "servicelogger.h" #include #include #include -DebugLogger::DebugLogger(QWidget *parent, QString settingsProfileName) +ServiceLogger::ServiceLogger(QString unitName, QWidget *parent) : QPlainTextEdit(parent), actClear(new QAction(QIcon::fromTheme("edit-clear"), tr("Clear"), this)), journalProcess(new QProcess(this)) { - QString cmd = QString("journalctl -f -S today --user-unit jack@%1").arg(settingsProfileName); + QString cmd = QString("journalctl -f -S today --user-unit %1").arg(unitName); journalProcess->start(cmd); setLineWrapMode(QPlainTextEdit::NoWrap); - connect(actClear, &QAction::triggered, this, &DebugLogger::onClearTriggered); - connect(journalProcess, &QProcess::readyRead, this, &DebugLogger::onReadyRead); + connect(actClear, &QAction::triggered, this, &ServiceLogger::onClearTriggered); + connect(journalProcess, &QProcess::readyRead, this, &ServiceLogger::onReadyRead); connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, - this, &DebugLogger::onAboutToQuit); + this, &ServiceLogger::onAboutToQuit); } -DebugLogger::~DebugLogger() +ServiceLogger::~ServiceLogger() { } -void DebugLogger::contextMenuEvent(QContextMenuEvent *event) +void ServiceLogger::contextMenuEvent(QContextMenuEvent *event) { QMenu *menu = createStandardContextMenu(); @@ -49,15 +49,15 @@ void DebugLogger::contextMenuEvent(QContextMenuEvent *event) menu->exec(event->globalPos()); delete menu; } -void DebugLogger::onAboutToQuit() +void ServiceLogger::onAboutToQuit() { delete journalProcess; } -void DebugLogger::onClearTriggered() +void ServiceLogger::onClearTriggered() { clear(); } -void DebugLogger::onReadyRead() +void ServiceLogger::onReadyRead() { while (journalProcess->canReadLine()) { diff --git a/src/ui/debuglogger.h b/src/ui/servicelogger.h similarity index 86% rename from src/ui/debuglogger.h rename to src/ui/servicelogger.h index 7c0757a..7a50fb1 100644 --- a/src/ui/debuglogger.h +++ b/src/ui/servicelogger.h @@ -18,13 +18,13 @@ #include #include -class DebugLogger : public QPlainTextEdit +class ServiceLogger : public QPlainTextEdit { Q_OBJECT public: - DebugLogger(QWidget *parent = nullptr, QString settingsProfileName = "default"); - ~DebugLogger(); + ServiceLogger(QString unitName, QWidget *parent = nullptr); + ~ServiceLogger(); private: void contextMenuEvent(QContextMenuEvent *);