Skip to content

Commit e3da357

Browse files
committed
Renamed logger widget
1 parent c767331 commit e3da357

7 files changed

Lines changed: 74 additions & 72 deletions

File tree

JACKSettings.pro

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ DEFINES += QT_DEPRECATED_WARNINGS
2222
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
2323

2424
SOURCES += src/main.cpp \
25-
src/device.cpp \
26-
src/driver.cpp \
27-
src/sysinfo.cpp \
28-
src/servicecontrol.cpp \
29-
src/settings.cpp \
30-
src/ui/debuglogger.cpp \
31-
src/ui/mainwindow.cpp \
32-
src/userinfo.cpp
25+
src/device.cpp \
26+
src/driver.cpp \
27+
src/sysinfo.cpp \
28+
src/servicecontrol.cpp \
29+
src/settings.cpp \
30+
src/ui/servicelogger.cpp \
31+
src/ui/mainwindow.cpp \
32+
src/userinfo.cpp
3333
HEADERS += src/ui/mainwindow.h \
34-
src/device.h \
35-
src/driver.h \
36-
src/sysinfo.h \
37-
src/servicecontrol.h \
38-
src/settings.h \
39-
src/ui/debuglogger.h \
40-
src/userinfo.h
34+
src/device.h \
35+
src/driver.h \
36+
src/sysinfo.h \
37+
src/servicecontrol.h \
38+
src/settings.h \
39+
src/ui/servicelogger.h \
40+
src/userinfo.h
4141
FORMS += src/ui/mainwindow.ui
4242

4343
INCLUDEPATH += $$_PRO_FILE_PWD_/external/CLI11/include
@@ -50,30 +50,30 @@ TRANSLATIONS += resources/translations/jacksettings_it.ts
5050

5151
# Default rules for deployment.
5252
qnx {
53-
target.path = /tmp/$${TARGET}/bin
53+
target.path = /tmp/$${TARGET}/bin
5454
}
5555
unix:!android {
56-
desktop.files = resources/linux/$${TARGET}.desktop
57-
desktop.path = /usr/share/applications/
56+
desktop.files = resources/linux/$${TARGET}.desktop
57+
desktop.path = /usr/share/applications/
5858

59-
icon.files = resources/icons/icon.png
60-
icon.path = /usr/share/$${TARGET}/icons/
59+
icon.files = resources/icons/icon.png
60+
icon.path = /usr/share/$${TARGET}/icons/
6161

62-
translations.files = resources/translations/*.qm
63-
translations.path = /usr/share/$${TARGET}/translations/
62+
translations.files = resources/translations/*.qm
63+
translations.path = /usr/share/$${TARGET}/translations/
6464

65-
target.files = $${TARGET}
66-
target.path = /usr/bin
65+
target.files = $${TARGET}
66+
target.path = /usr/bin
6767

68-
INSTALLS += desktop icon translations target
68+
INSTALLS += desktop icon translations target
6969
}
7070
win32 {
71-
RC_FILE = resources/icons/icon.rc
71+
RC_FILE = resources/icons/icon.rc
7272
}
7373
mac {
74-
CONFIG += app_bundle
75-
ICON = resources/icons/icon.icns
74+
CONFIG += app_bundle
75+
ICON = resources/icons/icon.icns
7676
}
7777
DISTFILES += .editorconfig \
78-
README.md \
79-
TODO.md
78+
README.md \
79+
TODO.md
2 Bytes
Binary file not shown.

resources/translations/jacksettings_it.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
33
<TS version="2.1" language="it_IT">
4-
<context>
5-
<name>DebugLogger</name>
6-
<message>
7-
<location filename="../../src/ui/debuglogger.cpp" line="25"/>
8-
<source>Clear</source>
9-
<translation>Pulisci</translation>
10-
</message>
11-
</context>
124
<context>
135
<name>MainWindow</name>
146
<message>
@@ -472,63 +464,71 @@
472464
<translation>&amp;Esci</translation>
473465
</message>
474466
<message>
475-
<location filename="../../src/ui/mainwindow.cpp" line="296"/>
467+
<location filename="../../src/ui/mainwindow.cpp" line="304"/>
476468
<source>JACK Settings</source>
477469
<translation>Impostazioni JACK</translation>
478470
</message>
479471
<message>
480-
<location filename="../../src/ui/mainwindow.cpp" line="418"/>
481-
<location filename="../../src/ui/mainwindow.cpp" line="450"/>
472+
<location filename="../../src/ui/mainwindow.cpp" line="426"/>
473+
<location filename="../../src/ui/mainwindow.cpp" line="458"/>
482474
<source>Started</source>
483475
<translation>Avviato</translation>
484476
</message>
485477
<message>
486-
<location filename="../../src/ui/mainwindow.cpp" line="421"/>
487-
<location filename="../../src/ui/mainwindow.cpp" line="453"/>
478+
<location filename="../../src/ui/mainwindow.cpp" line="429"/>
479+
<location filename="../../src/ui/mainwindow.cpp" line="461"/>
488480
<source>Stop</source>
489481
<translation>Ferma</translation>
490482
</message>
491483
<message>
492-
<location filename="../../src/ui/mainwindow.cpp" line="424"/>
484+
<location filename="../../src/ui/mainwindow.cpp" line="432"/>
493485
<source>Stop JACK Server</source>
494486
<translation>Ferma Server JACK</translation>
495487
</message>
496488
<message>
497-
<location filename="../../src/ui/mainwindow.cpp" line="432"/>
498-
<location filename="../../src/ui/mainwindow.cpp" line="460"/>
489+
<location filename="../../src/ui/mainwindow.cpp" line="440"/>
490+
<location filename="../../src/ui/mainwindow.cpp" line="468"/>
499491
<source>Stopped</source>
500492
<translation>Fermato</translation>
501493
</message>
502494
<message>
503-
<location filename="../../src/ui/mainwindow.cpp" line="435"/>
504-
<location filename="../../src/ui/mainwindow.cpp" line="463"/>
495+
<location filename="../../src/ui/mainwindow.cpp" line="443"/>
496+
<location filename="../../src/ui/mainwindow.cpp" line="471"/>
505497
<source>Start</source>
506498
<translation>Avvia</translation>
507499
</message>
508500
<message>
509-
<location filename="../../src/ui/mainwindow.cpp" line="438"/>
501+
<location filename="../../src/ui/mainwindow.cpp" line="446"/>
510502
<source>Start JACK Server</source>
511503
<translation>Avvia Server JACK</translation>
512504
</message>
513505
<message>
514-
<location filename="../../src/ui/mainwindow.cpp" line="456"/>
506+
<location filename="../../src/ui/mainwindow.cpp" line="464"/>
515507
<source>Stop ALSA Bridge</source>
516508
<translation>Ferma ALSA Bridge</translation>
517509
</message>
518510
<message>
519-
<location filename="../../src/ui/mainwindow.cpp" line="466"/>
511+
<location filename="../../src/ui/mainwindow.cpp" line="474"/>
520512
<source>Start ALSA Bridge</source>
521513
<translation>Avvia ALSA Bridge</translation>
522514
</message>
523515
</context>
524516
<context>
525517
<name>QObject</name>
526518
<message>
527-
<location filename="../../src/main.cpp" line="39"/>
519+
<location filename="../../src/main.cpp" line="37"/>
528520
<source>I couldn&apos;t detect any system tray on this system.</source>
529521
<translation>Non riesco a rilevare alcuna system tray in questo sistema.</translation>
530522
</message>
531523
</context>
524+
<context>
525+
<name>ServiceLogger</name>
526+
<message>
527+
<location filename="../../src/ui/servicelogger.cpp" line="24"/>
528+
<source>Clear</source>
529+
<translation>Pulisci</translation>
530+
</message>
531+
</context>
532532
<context>
533533
<name>SysInfo</name>
534534
<message>

src/ui/mainwindow.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
For a full copy of the GNU General Public License see the LICENSE file
1515
*/
1616
#include "mainwindow.h"
17-
#include "debuglogger.h"
17+
#include "servicelogger.h"
1818
#include "ui_mainwindow.h"
1919
#include "src/servicecontrol.h"
2020
#include "src/userinfo.h"
@@ -222,8 +222,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),
222222

223223
updateJackStatus();
224224
}
225-
jackService = new ServiceControl("jack@" + settings->profileName() + ".service", this);
226-
a2jService = new ServiceControl("a2jmidi@" + settings->profileName() + ".service", this);
225+
QString jackSvcName = "jack@" + settings->profileName() + ".service";
226+
QString a2jSvcName = "a2jmidi@" + settings->profileName() + ".service";
227+
jackService = new ServiceControl(jackSvcName, this);
228+
a2jService = new ServiceControl(a2jSvcName, this);
227229
enumerateProfiles();
228230
updateJackSettingsUI();
229231
updateDriverSettingsUI();
@@ -292,7 +294,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),
292294
connect(ui->sbxLatencyIn, QOverload<int>::of(&QSpinBox::valueChanged), this, &MainWindow::onSettingsChanged);
293295
connect(ui->sbxLatencyOut, QOverload<int>::of(&QSpinBox::valueChanged), this, &MainWindow::onSettingsChanged);
294296

295-
txtLog = new DebugLogger(this, settings->profileName());
297+
txtLog = new ServiceLogger(jackSvcName, this);
296298
txtLog->setReadOnly(true);
297299
txtLog->setParent(ui->tabLog);
298300
txtLog->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

src/ui/mainwindow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace Ui { class MainWindow; }
2525
QT_END_NAMESPACE
2626

2727
class ServiceControl;
28-
class DebugLogger;
28+
class ServiceLogger;
2929
class QRadioButton;
3030
class QSystemTrayIcon;
3131
class MainWindow : public QMainWindow
@@ -83,7 +83,7 @@ class MainWindow : public QMainWindow
8383
QAction *actQuit;
8484
QMenu *mnuTray;
8585
QSystemTrayIcon *icoTray;
86-
DebugLogger *txtLog;
86+
ServiceLogger *txtLog;
8787

8888
std::array<QRadioButton *, 2> grpClockSource;
8989
std::array<QRadioButton *, 5> grpAutoConnect;
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@
1313
1414
For a full copy of the GNU General Public License see the LICENSE file
1515
*/
16-
#include "debuglogger.h"
16+
#include "servicelogger.h"
1717

1818
#include <QContextMenuEvent>
1919
#include <QCoreApplication>
2020
#include <QMenu>
2121

22-
DebugLogger::DebugLogger(QWidget *parent, QString settingsProfileName)
22+
ServiceLogger::ServiceLogger(QString unitName, QWidget *parent)
2323
: QPlainTextEdit(parent),
2424
actClear(new QAction(QIcon::fromTheme("edit-clear"), tr("Clear"), this)),
2525
journalProcess(new QProcess(this))
2626
{
27-
QString cmd = QString("journalctl -f -S today --user-unit jack@%1").arg(settingsProfileName);
27+
QString cmd = QString("journalctl -f -S today --user-unit %1").arg(unitName);
2828
journalProcess->start(cmd);
2929

3030
setLineWrapMode(QPlainTextEdit::NoWrap);
3131

32-
connect(actClear, &QAction::triggered, this, &DebugLogger::onClearTriggered);
33-
connect(journalProcess, &QProcess::readyRead, this, &DebugLogger::onReadyRead);
32+
connect(actClear, &QAction::triggered, this, &ServiceLogger::onClearTriggered);
33+
connect(journalProcess, &QProcess::readyRead, this, &ServiceLogger::onReadyRead);
3434
connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit,
35-
this, &DebugLogger::onAboutToQuit);
35+
this, &ServiceLogger::onAboutToQuit);
3636
}
37-
DebugLogger::~DebugLogger()
37+
ServiceLogger::~ServiceLogger()
3838
{
3939
}
40-
void DebugLogger::contextMenuEvent(QContextMenuEvent *event)
40+
void ServiceLogger::contextMenuEvent(QContextMenuEvent *event)
4141
{
4242
QMenu *menu = createStandardContextMenu();
4343

@@ -49,15 +49,15 @@ void DebugLogger::contextMenuEvent(QContextMenuEvent *event)
4949
menu->exec(event->globalPos());
5050
delete menu;
5151
}
52-
void DebugLogger::onAboutToQuit()
52+
void ServiceLogger::onAboutToQuit()
5353
{
5454
delete journalProcess;
5555
}
56-
void DebugLogger::onClearTriggered()
56+
void ServiceLogger::onClearTriggered()
5757
{
5858
clear();
5959
}
60-
void DebugLogger::onReadyRead()
60+
void ServiceLogger::onReadyRead()
6161
{
6262
while (journalProcess->canReadLine())
6363
{
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
#include <QPlainTextEdit>
1919
#include <QProcess>
2020

21-
class DebugLogger : public QPlainTextEdit
21+
class ServiceLogger : public QPlainTextEdit
2222
{
2323
Q_OBJECT
2424

2525
public:
26-
DebugLogger(QWidget *parent = nullptr, QString settingsProfileName = "default");
27-
~DebugLogger();
26+
ServiceLogger(QString unitName, QWidget *parent = nullptr);
27+
~ServiceLogger();
2828

2929
private:
3030
void contextMenuEvent(QContextMenuEvent *);

0 commit comments

Comments
 (0)