From e3da357e4c78b0af2491ef370adc2d960cfc4e88 Mon Sep 17 00:00:00 2001 From: redtide Date: Mon, 17 Feb 2020 15:57:18 +0100 Subject: [PATCH] Renamed logger widget --- JACKSettings.pro | 60 +++++++++--------- resources/translations/jacksettings_it.qm | Bin 8949 -> 8951 bytes resources/translations/jacksettings_it.ts | 44 ++++++------- src/ui/mainwindow.cpp | 10 +-- src/ui/mainwindow.h | 4 +- src/ui/{debuglogger.cpp => servicelogger.cpp} | 22 +++---- src/ui/{debuglogger.h => servicelogger.h} | 6 +- 7 files changed, 74 insertions(+), 72 deletions(-) rename src/ui/{debuglogger.cpp => servicelogger.cpp} (72%) rename src/ui/{debuglogger.h => servicelogger.h} (86%) 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 7c7d52abf292576b284648ad8daece72552e276d..27dfa831776b128fbe8931325219e948529a2b5c 100644 GIT binary patch delta 879 zcmWktdrVDn9RHl>z31L@?sfC%cB8g5OxPk@TISKN^uQ+a+Jsy!OuCmg85hZ#H|eo% z%Zw?)JfqBJDas>n@`_EFX-#H?F+TqK?sv}T_xXMv=X`Vbx%UtDcLT!{01N}t<^i^N zU``WYF9R}e0O1zMOLGB1fZVkaFyf(1F6R4DP}1F;9Z+hQ08Ts9@4Po;KB9KZ z@@CG5NRHYDgl#}dQxc%2V`0r9V9+`2?3@euwTZa#IvEf@2<`(Ultp2s?-pQj2?rZq z0(zoQc03N~mnr<6@(Yma#F>$i#LpJf!g!YFidWq0N%&U0(n&n z!5LDPm$-rFq@qj;367SoAHEGJF;e@6k?_M|NFVPI;94a0?t95ac3C|_rTq`du}OP@ z5V!2Hj-}HDa!yJE5E_v49xdSWWA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sc+u}U|6f^+o_$r zdApW6l~LMqH2;ha-m+Q?{z+k!6SexbX3qJwmcsuvR%^A#(rLH$vQZ*loc2{@5^9Ax zA>KjZ=gpo#Klg&>qa6d(T0mXxWlb%S5Uyhw2m(+AKxm_$>%~EENePw$xZ7 zJ4Uhow%(YqiGRm - - 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 *);