55#include < QMessageBox>
66#include < QDesktopServices>
77#include < QProcess>
8+ #include < QStyle>
89#include " appui.h"
10+ #include " sqpath.h"
911
1012#include " diagnosticdialog.h"
1113#include " wsserver.h"
@@ -58,7 +60,16 @@ void AppUi::setMenu()
5860#endif
5961
6062 miscMenu->setToolTipsVisible (true );
61- QAction* debugLogAction = miscMenu->addAction (tr (" Enable debug logs" ));
63+ miscMenu->addSeparator ();
64+
65+ miscMenu->addAction (tr (" Diagnostic" ));
66+ miscMenu->addSeparator ();
67+ QObject::connect (miscMenu->addAction (QIcon (" :/img/build.svg" ), tr (" Diagnostic tool" )), &QAction::triggered, this , [=] {
68+ DiagnosticDialog diag;
69+ diag.setWSServer (&wsServer);
70+ diag.exec ();
71+ });
72+ QAction* debugLogAction = miscMenu->addAction (QIcon (" :/img/analytic.svg" ), tr (" Enable debug logs" ));
6273 debugLogAction->setCheckable (true );
6374 debugLogAction->setChecked (globalSettings->value (" debugLog" ).toBool ());
6475 debugLogAction->setToolTip (tr (" Enable the creation of a log file with lot of debug informations" ));
@@ -85,10 +96,14 @@ void AppUi::setMenu()
8596 globalSettings->setValue (" debugLog" , false );
8697 }
8798 });
88- QObject::connect (miscMenu->addAction (tr (" Diagnostic tool" )), &QAction::triggered, this , [=] {
89- DiagnosticDialog diag;
90- diag.setWSServer (&wsServer);
91- diag.exec ();
99+ auto openLogAction = miscMenu->addAction (QIcon (" :/img/file.svg" ), tr (" Open normal logs file" ));
100+ QObject::connect (openLogAction, &QAction::triggered, this , [=] {
101+ QDesktopServices::openUrl (QUrl (SQPath::logDirectoryPath () + " /log.txt" ));
102+ });
103+ auto openDebugLogAction = miscMenu->addAction (QIcon (" :/img/file.svg" ), tr (" Open debug logs file" ));
104+ openDebugLogAction->setEnabled (globalSettings->value (" debugLog" ).toBool ());
105+ QObject::connect (openDebugLogAction, &QAction::triggered, this , [=] {
106+ QDesktopServices::openUrl (QUrl (SQPath::logDirectoryPath () + " /log.txt" ));
92107 });
93108 QObject::connect (menu->addAction (QIcon (" :/img/quiticon.svg" ), tr (" Exit" )), &QAction::triggered, qApp, &QApplication::exit);
94109 appsMenu->addSeparator ();
0 commit comments