chore: just update code

This commit is contained in:
x-tools-author 2024-03-19 18:10:13 +08:00
parent 6c1e2c49d2
commit b9e15c20cb
38 changed files with 230 additions and 262 deletions

View File

@ -38,11 +38,11 @@ file(GLOB_RECURSE X_TOOLS_TOOLS_SOURCE_CPP "${CMAKE_SOURCE_DIR}/Source/Tools/*.c
file(GLOB_RECURSE X_TOOLS_TOOLBOX_SOURCE_H "${CMAKE_SOURCE_DIR}/Source/ToolBox/*.h") file(GLOB_RECURSE X_TOOLS_TOOLBOX_SOURCE_H "${CMAKE_SOURCE_DIR}/Source/ToolBox/*.h")
file(GLOB_RECURSE X_TOOLS_TOOLBOX_SOURCE_UI "${CMAKE_SOURCE_DIR}/Source/ToolBox/*.ui") file(GLOB_RECURSE X_TOOLS_TOOLBOX_SOURCE_UI "${CMAKE_SOURCE_DIR}/Source/ToolBox/*.ui")
file(GLOB_RECURSE X_TOOLS_TOOLBOX_SOURCE_CPP "${CMAKE_SOURCE_DIR}/Source/ToolBox/*.cc") file(GLOB_RECURSE X_TOOLS_TOOLBOX_SOURCE_CPP "${CMAKE_SOURCE_DIR}/Source/ToolBox/*.cpp")
file(GLOB X_TOOLS_SOURCE_H "${CMAKE_SOURCE_DIR}/Source/*.h") file(GLOB X_TOOLS_SOURCE_H "${CMAKE_SOURCE_DIR}/Source/*.h")
file(GLOB X_TOOLS_SOURCE_UI "${CMAKE_SOURCE_DIR}/Source/*.ui") file(GLOB X_TOOLS_SOURCE_UI "${CMAKE_SOURCE_DIR}/Source/*.ui")
file(GLOB X_TOOLS_SOURCE_CPP "${CMAKE_SOURCE_DIR}/Source/*.cc") file(GLOB X_TOOLS_SOURCE_CPP "${CMAKE_SOURCE_DIR}/Source/*.cpp")
file(GLOB X_TOOLS_ASSISTANT_SOURCE_H "${CMAKE_SOURCE_DIR}/Source/Assistants/*/Source/*.h") file(GLOB X_TOOLS_ASSISTANT_SOURCE_H "${CMAKE_SOURCE_DIR}/Source/Assistants/*/Source/*.h")
file(GLOB X_TOOLS_ASSISTANT_SOURCE_UI "${CMAKE_SOURCE_DIR}/Source/Assistants/*/Source/*.ui") file(GLOB X_TOOLS_ASSISTANT_SOURCE_UI "${CMAKE_SOURCE_DIR}/Source/Assistants/*/Source/*.ui")
@ -86,10 +86,10 @@ set(BUILD_TESTING OFF)
set(BUILD_SHARED_LIBS OFF) set(BUILD_SHARED_LIBS OFF)
sak_add_subdirectory("glog-0.7.0") sak_add_subdirectory("glog-0.7.0")
sak_add_subdirectory("Qt-AES-master")
sak_add_subdirectory("nodeeditor-3.0.10")
sak_add_subdirectory("qmdnsengine-master") sak_add_subdirectory("qmdnsengine-master")
#add_subdirectory(${CMAKE_SOURCE_DIR}/Source/Assistants)
qt_add_executable(xTools ${X_TOOLS_SOURCE}) qt_add_executable(xTools ${X_TOOLS_SOURCE})
sak_git_get_last_commit(${CMAKE_SOURCE_DIR} "SAK") sak_git_get_last_commit(${CMAKE_SOURCE_DIR} "SAK")
sak_git_get_last_commit_time(${CMAKE_SOURCE_DIR} "SAK") sak_git_get_last_commit_time(${CMAKE_SOURCE_DIR} "SAK")
@ -104,5 +104,3 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
endif() endif()
target_link_libraries(xTools PRIVATE qmdnsengine) target_link_libraries(xTools PRIVATE qmdnsengine)
target_link_libraries(xTools PRIVATE glog::glog) target_link_libraries(xTools PRIVATE glog::glog)
target_link_libraries(xTools PRIVATE QtAES::QtAES)
target_link_libraries(xTools PRIVATE QtNodes::QtNodes)

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "application.h" #include "Application.h"
#include <QFile> #include <QFile>
#include <QPushButton> #include <QPushButton>
@ -17,12 +17,12 @@
#include <QTranslator> #include <QTranslator>
#include "sakdatastructure.h" #include "sakdatastructure.h"
#include "mainwindow.h" #include "MainWindow.h"
#include "saksettings.h" #include "saksettings.h"
#include "saktranslator.h" #include "saktranslator.h"
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include "systemtrayicon.h" #include "SystemTrayIcon.h"
#endif #endif
Application::Application(int argc, char** argv) Application::Application(int argc, char** argv)

View File

@ -6,8 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef APPLICATION_H #pragma once
#define APPLICATION_H
#include <QApplication> #include <QApplication>
#include <QSplashScreen> #include <QSplashScreen>
@ -30,5 +29,3 @@ private:
private: private:
static void setupPalette(const QString &fileName); static void setupPalette(const QString &fileName);
}; };
#endif

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QMap> #include <QMap>
#include <QWidget> #include <QWidget>

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QWidget> #include <QWidget>

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QWidget> #include <QWidget>

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QMutex> #include <QMutex>
#include <QThread> #include <QThread>

View File

@ -1,4 +1,4 @@
macro(sak_add_assistant dir_name app_name) macro(x_tools_add_assistant dir_name app_name)
string(TOUPPER ${app_name} upper_app_name) string(TOUPPER ${app_name} upper_app_name)
option(SAK_ENABLE_APP_${upper_app_name} "" ON) option(SAK_ENABLE_APP_${upper_app_name} "" ON)
if(SAK_ENABLE_APP_${upper_app_name}) if(SAK_ENABLE_APP_${upper_app_name})
@ -33,16 +33,12 @@ macro(sak_add_assistant dir_name app_name)
endif() endif()
endmacro() endmacro()
add_subdirectory(crc) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mDNS)
add_subdirectory(mdns) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Ping)
add_subdirectory(ping) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ASCII)
add_subdirectory(ascii) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Base64)
add_subdirectory(base64) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Number)
add_subdirectory(number) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/String)
add_subdirectory(string) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Broadcast)
add_subdirectory(broadcast) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Filechecker)
add_subdirectory(filecheck) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/CRCCalculator)
if(SAK_ENABLE_MODULE_FONTAWESOMEASSISTANT)
add_subdirectory(fontawesome)
endif()

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QCheckBox> #include <QCheckBox>
#include <QComboBox> #include <QComboBox>

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QThread> #include <QThread>

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QCheckBox> #include <QCheckBox>
#include <QComboBox> #include <QComboBox>

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QWidget> #include <QWidget>

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QLabel> #include <QLabel>
#include <QSettings> #include <QSettings>

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QWidget> #include <QWidget>

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QTreeWidgetItem> #include <QTreeWidgetItem>
#include <QWidget> #include <QWidget>

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QByteArray> #include <QByteArray>
#include <QThread> #include <QThread>

View File

@ -6,7 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#pragma onece #pragma once
#include <QMap> #include <QMap>
#include <QObject> #include <QObject>

View File

@ -6,8 +6,8 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "mainwindow.h" #include "MainWindow.h"
#include "ui_mainwindow.h" #include "ui_MainWindow.h"
#include <QAction> #include <QAction>
#include <QActionGroup> #include <QActionGroup>
@ -38,7 +38,7 @@
#include "sakdatastructure.h" #include "sakdatastructure.h"
#include "sakinterface.h" #include "sakinterface.h"
#include "saksettings.h" #include "saksettings.h"
#include "saktoolboxui.h" #include "xToolsToolBoxUi.h"
#include "saktranslator.h" #include "saktranslator.h"
#include "sakuiinterface.h" #include "sakuiinterface.h"
#include "xToolsAssistantFactory.h" #include "xToolsAssistantFactory.h"
@ -151,13 +151,13 @@ void MainWindow::initFileMenu()
// Tool box // Tool box
QMenu* windowMenu = new QMenu(tr("New Window"), this); QMenu* windowMenu = new QMenu(tr("New Window"), this);
fileMenu->addMenu(windowMenu); fileMenu->addMenu(windowMenu);
QList<int> toolTypeList = SAKToolBoxUi::supportedCommunicationTools(); QList<int> toolTypeList = xToolsToolBoxUi::supportedCommunicationTools();
for (auto& toolType : toolTypeList) { for (auto& toolType : toolTypeList) {
const QString name = SAKToolBoxUi::communicationToolName(toolType); const QString name = xToolsToolBoxUi::communicationToolName(toolType);
QAction* action = new QAction(name, this); QAction* action = new QAction(name, this);
windowMenu->addAction(action); windowMenu->addAction(action);
connect(action, &QAction::triggered, this, [=]() { connect(action, &QAction::triggered, this, [=]() {
SAKToolBoxUi* w = new SAKToolBoxUi(); xToolsToolBoxUi* w = new xToolsToolBoxUi();
w->setContentsMargins(9, 9, 9, 9); w->setContentsMargins(9, 9, 9, 9);
w->setAttribute(Qt::WA_DeleteOnClose, true); w->setAttribute(Qt::WA_DeleteOnClose, true);
w->initialize(toolType); w->initialize(toolType);
@ -635,10 +635,10 @@ void MainWindow::initNav()
tb->setAllowedAreas(Qt::LeftToolBarArea); tb->setAllowedAreas(Qt::LeftToolBarArea);
static QButtonGroup navButtonGroup; static QButtonGroup navButtonGroup;
QList<int> types = SAKToolBoxUi::supportedCommunicationTools(); QList<int> types = xToolsToolBoxUi::supportedCommunicationTools();
for (int i = 0; i < types.count(); i++) { for (int i = 0; i < types.count(); i++) {
int type = types.at(i); int type = types.at(i);
SAKToolBoxUi* toolBoxUi = new SAKToolBoxUi(this); xToolsToolBoxUi* toolBoxUi = new xToolsToolBoxUi(this);
toolBoxUi->initialize(type); toolBoxUi->initialize(type);
initNav({&navButtonGroup, initNav({&navButtonGroup,

View File

@ -6,8 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef MAINWINDOW_H #pragma once
#define MAINWINDOW_H
#include <QAction> #include <QAction>
#include <QButtonGroup> #include <QButtonGroup>
@ -89,5 +88,3 @@ private slots:
void onImportActionTriggered(); void onImportActionTriggered();
void onExportActionTriggered(); void onExportActionTriggered();
}; };
#endif // MAINWINDOW_H

View File

@ -6,7 +6,8 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "systemtrayicon.h" #include "SystemTrayIcon.h"
#include <QAction> #include <QAction>
#include <QDir> #include <QDir>
#include <QMenu> #include <QMenu>

View File

@ -6,8 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SYSTEMTRAYICON_H #pragma once
#define SYSTEMTRAYICON_H
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
@ -21,5 +20,3 @@ signals:
void invokeExit(); void invokeExit();
void invokeShowMainWindow(); void invokeShowMainWindow();
}; };
#endif // SYSTEMTRAYICON_H

View File

@ -6,11 +6,11 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "saktoolbox.h" #include "xToolsToolBox.h"
#include "saktoolfactory.h" #include "saktoolfactory.h"
SAKToolBox::SAKToolBox(QObject* parent) xToolsToolBox::xToolsToolBox(QObject* parent)
: QObject{parent} : QObject{parent}
{ {
auto createTool = [](int type) -> SAKBaseTool* { auto createTool = [](int type) -> SAKBaseTool* {
@ -43,14 +43,14 @@ SAKToolBox::SAKToolBox(QObject* parent)
connect(tool, connect(tool,
&SAKBaseTool::errorOccurred, &SAKBaseTool::errorOccurred,
this, this,
&SAKToolBox::errorOccurred, &xToolsToolBox::errorOccurred,
Qt::ConnectionType(flag)); Qt::ConnectionType(flag));
} }
connect(this, &SAKToolBox::errorOccurred, this, [=]() { this->close(); }); connect(this, &xToolsToolBox::errorOccurred, this, [=]() { this->close(); });
} }
SAKToolBox::~SAKToolBox() xToolsToolBox::~xToolsToolBox()
{ {
if (m_comunicator) { if (m_comunicator) {
m_comunicator->exit(); m_comunicator->exit();
@ -65,7 +65,7 @@ SAKToolBox::~SAKToolBox()
} }
} }
void SAKToolBox::initialize(int type) void xToolsToolBox::initialize(int type)
{ {
if (m_comunicator) { if (m_comunicator) {
m_comunicator->exit(); m_comunicator->exit();
@ -83,8 +83,8 @@ void SAKToolBox::initialize(int type)
} }
// clang-format off // clang-format off
connect(m_comunicator, &SAKCommunicationTool::bytesWritten, this, &SAKToolBox::onCommunicatorBytesWritten); connect(m_comunicator, &SAKCommunicationTool::bytesWritten, this, &xToolsToolBox::onCommunicatorBytesWritten);
connect(m_comunicator, &SAKCommunicationTool::bytesRead, this, &SAKToolBox::onCommunicatorBytesRead); connect(m_comunicator, &SAKCommunicationTool::bytesRead, this, &xToolsToolBox::onCommunicatorBytesRead);
// emiiter,responser,prestorer->tx // emiiter,responser,prestorer->tx
connect(m_emitter, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes); connect(m_emitter, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes);
connect(m_responser, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes); connect(m_responser, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes);
@ -96,13 +96,13 @@ void SAKToolBox::initialize(int type)
connect(m_tcpTransmitter, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes); connect(m_tcpTransmitter, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes);
connect(m_webSocketTransmitter, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes); connect(m_webSocketTransmitter, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes);
connect(m_comunicator, &SAKCommunicationTool::errorOccurred, this, &SAKToolBox::errorOccurred); connect(m_comunicator, &SAKCommunicationTool::errorOccurred, this, &xToolsToolBox::errorOccurred);
// clang-format on // clang-format on
emit communicatorChanged(); emit communicatorChanged();
} }
void SAKToolBox::open() void xToolsToolBox::open()
{ {
if (m_comunicator) { if (m_comunicator) {
for (auto tool : m_tools) { for (auto tool : m_tools) {
@ -117,7 +117,7 @@ void SAKToolBox::open()
} }
} }
void SAKToolBox::close() void xToolsToolBox::close()
{ {
if (m_comunicator) { if (m_comunicator) {
m_comunicator->exit(); m_comunicator->exit();
@ -135,82 +135,82 @@ void SAKToolBox::close()
} }
} }
void SAKToolBox::send(const QByteArray& bytes) void xToolsToolBox::send(const QByteArray& bytes)
{ {
m_comunicator->inputBytes(bytes); m_comunicator->inputBytes(bytes);
} }
bool SAKToolBox::isWorking() bool xToolsToolBox::isWorking()
{ {
return m_isWorking; return m_isWorking;
} }
SAKCommunicationTool* SAKToolBox::getCommunicationTool() SAKCommunicationTool* xToolsToolBox::getCommunicationTool()
{ {
return m_comunicator; return m_comunicator;
} }
SAKEmitterTool* SAKToolBox::getEmitterTool() SAKEmitterTool* xToolsToolBox::getEmitterTool()
{ {
return m_emitter; return m_emitter;
} }
SAKResponserTool* SAKToolBox::getResponserTool() SAKResponserTool* xToolsToolBox::getResponserTool()
{ {
return m_responser; return m_responser;
} }
SAKStorerTool* SAKToolBox::getStorerTool() SAKStorerTool* xToolsToolBox::getStorerTool()
{ {
return m_storer; return m_storer;
} }
SAKPrestorerTool* SAKToolBox::getPrestorerTool() SAKPrestorerTool* xToolsToolBox::getPrestorerTool()
{ {
return m_prestorer; return m_prestorer;
} }
SAKVelometerTool* SAKToolBox::getRxVelometerTool() SAKVelometerTool* xToolsToolBox::getRxVelometerTool()
{ {
return m_rxVelometer; return m_rxVelometer;
} }
SAKVelometerTool* SAKToolBox::getTxVelometerTool() SAKVelometerTool* xToolsToolBox::getTxVelometerTool()
{ {
return m_txVelometer; return m_txVelometer;
} }
SAKStatisticianTool* SAKToolBox::getRxStatisticianTool() SAKStatisticianTool* xToolsToolBox::getRxStatisticianTool()
{ {
return m_rxCounter; return m_rxCounter;
} }
SAKStatisticianTool* SAKToolBox::getTxStatisticianTool() SAKStatisticianTool* xToolsToolBox::getTxStatisticianTool()
{ {
return m_txCounter; return m_txCounter;
} }
SAKUdpTransmitterTool* SAKToolBox::getUdpTransmitterTool() SAKUdpTransmitterTool* xToolsToolBox::getUdpTransmitterTool()
{ {
return m_udpTransmitter; return m_udpTransmitter;
} }
SAKTcpTransmitterTool* SAKToolBox::getTcpTransmitterTool() SAKTcpTransmitterTool* xToolsToolBox::getTcpTransmitterTool()
{ {
return m_tcpTransmitter; return m_tcpTransmitter;
} }
SAKWebSocketTransmitterTool* SAKToolBox::getWebSocketTransmitterTool() SAKWebSocketTransmitterTool* xToolsToolBox::getWebSocketTransmitterTool()
{ {
return m_webSocketTransmitter; return m_webSocketTransmitter;
} }
SAKSerialPortTransmitterTool* SAKToolBox::getSerialPortTransmitterTool() SAKSerialPortTransmitterTool* xToolsToolBox::getSerialPortTransmitterTool()
{ {
return m_serialPortTransmitter; return m_serialPortTransmitter;
} }
void SAKToolBox::uninitializedTips() void xToolsToolBox::uninitializedTips()
{ {
static QByteArray tips("You must call the interface name initialize()" static QByteArray tips("You must call the interface name initialize()"
" before using the object."); " before using the object.");
@ -219,72 +219,72 @@ void SAKToolBox::uninitializedTips()
emit errorOccurred(QString::fromLatin1(tips)); emit errorOccurred(QString::fromLatin1(tips));
} }
QVariant SAKToolBox::communicator() QVariant xToolsToolBox::communicator()
{ {
return QVariant::fromValue(m_comunicator); return QVariant::fromValue(m_comunicator);
} }
QVariant SAKToolBox::emitter() QVariant xToolsToolBox::emitter()
{ {
return QVariant::fromValue(m_emitter); return QVariant::fromValue(m_emitter);
} }
QVariant SAKToolBox::responser() QVariant xToolsToolBox::responser()
{ {
return QVariant::fromValue(m_responser); return QVariant::fromValue(m_responser);
} }
QVariant SAKToolBox::storer() QVariant xToolsToolBox::storer()
{ {
return QVariant::fromValue(m_storer); return QVariant::fromValue(m_storer);
} }
QVariant SAKToolBox::prestorer() QVariant xToolsToolBox::prestorer()
{ {
return QVariant::fromValue(m_prestorer); return QVariant::fromValue(m_prestorer);
} }
QVariant SAKToolBox::rxVelometer() QVariant xToolsToolBox::rxVelometer()
{ {
return QVariant::fromValue(m_rxVelometer); return QVariant::fromValue(m_rxVelometer);
} }
QVariant SAKToolBox::txVelometer() QVariant xToolsToolBox::txVelometer()
{ {
return QVariant::fromValue(m_txVelometer); return QVariant::fromValue(m_txVelometer);
} }
QVariant SAKToolBox::rxStatistician() QVariant xToolsToolBox::rxStatistician()
{ {
return QVariant::fromValue(m_rxCounter); return QVariant::fromValue(m_rxCounter);
} }
QVariant SAKToolBox::txStatistician() QVariant xToolsToolBox::txStatistician()
{ {
return QVariant::fromValue(m_txCounter); return QVariant::fromValue(m_txCounter);
} }
QVariant SAKToolBox::udpTransmitter() QVariant xToolsToolBox::udpTransmitter()
{ {
return QVariant::fromValue(m_udpTransmitter); return QVariant::fromValue(m_udpTransmitter);
} }
QVariant SAKToolBox::tcpTransmitter() QVariant xToolsToolBox::tcpTransmitter()
{ {
return QVariant::fromValue(m_tcpTransmitter); return QVariant::fromValue(m_tcpTransmitter);
} }
QVariant SAKToolBox::webSocketTransmitter() QVariant xToolsToolBox::webSocketTransmitter()
{ {
return QVariant::fromValue(m_webSocketTransmitter); return QVariant::fromValue(m_webSocketTransmitter);
} }
QVariant SAKToolBox::serialPortTransmitter() QVariant xToolsToolBox::serialPortTransmitter()
{ {
return QVariant::fromValue(m_serialPortTransmitter); return QVariant::fromValue(m_serialPortTransmitter);
} }
void SAKToolBox::onCommunicatorBytesWritten(const QByteArray& bytes, const QString& to) void xToolsToolBox::onCommunicatorBytesWritten(const QByteArray& bytes, const QString& to)
{ {
Q_UNUSED(to) Q_UNUSED(to)
m_txVelometer->inputBytes(bytes); m_txVelometer->inputBytes(bytes);
@ -292,7 +292,7 @@ void SAKToolBox::onCommunicatorBytesWritten(const QByteArray& bytes, const QStri
m_storer->inputBytes(bytes); m_storer->inputBytes(bytes);
} }
void SAKToolBox::onCommunicatorBytesRead(const QByteArray& bytes, const QString& to) void xToolsToolBox::onCommunicatorBytesRead(const QByteArray& bytes, const QString& to)
{ {
Q_UNUSED(to) Q_UNUSED(to)
m_rxVelometer->inputBytes(bytes); m_rxVelometer->inputBytes(bytes);

View File

@ -6,8 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKTOOLBOX_H #pragma once
#define SAKTOOLBOX_H
#include <QObject> #include <QObject>
#include <QVariant> #include <QVariant>
@ -25,7 +24,7 @@
#include "sakvelometertool.h" #include "sakvelometertool.h"
#include "sakwebsockettransmittertool.h" #include "sakwebsockettransmittertool.h"
class SAKToolBox : public QObject class xToolsToolBox : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QVariant communicator READ communicator NOTIFY communicatorChanged) Q_PROPERTY(QVariant communicator READ communicator NOTIFY communicatorChanged)
@ -45,8 +44,8 @@ class SAKToolBox : public QObject
Q_PROPERTY(bool isWorking READ isWorking NOTIFY isWorkingChanged) Q_PROPERTY(bool isWorking READ isWorking NOTIFY isWorkingChanged)
public: public:
explicit SAKToolBox(QObject* parent = nullptr); explicit xToolsToolBox(QObject* parent = nullptr);
~SAKToolBox(); ~xToolsToolBox();
/// You must call the interface before useing. /// You must call the interface before useing.
Q_INVOKABLE void initialize(int type); Q_INVOKABLE void initialize(int type);
@ -115,5 +114,3 @@ private:
void onCommunicatorBytesWritten(const QByteArray& bytes, const QString& to); void onCommunicatorBytesWritten(const QByteArray& bytes, const QString& to);
void onCommunicatorBytesRead(const QByteArray& bytes, const QString& to); void onCommunicatorBytesRead(const QByteArray& bytes, const QString& to);
}; };
#endif // SAKTOOLBOX_H

View File

@ -6,7 +6,8 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "saktoolboxui.h" #include "xToolsToolBoxUi.h"
#include "ui_xToolsToolBoxUi.h"
#include <QDateTime> #include <QDateTime>
#include <QJsonArray> #include <QJsonArray>
@ -30,25 +31,24 @@
#include "saksocketclienttoolui.h" #include "saksocketclienttoolui.h"
#include "saksocketservertoolui.h" #include "saksocketservertoolui.h"
#include "saktcptransmittertoolti.h" #include "saktcptransmittertoolti.h"
#include "saktoolboxuicommunicationmenu.h" #include "xToolsToolBoxUiCommunicationMenu.h"
#include "saktoolboxuiinputmenu.h" #include "xToolsToolBoxUiInputMenu.h"
#include "saktoolboxuioutputmenu.h" #include "xToolsToolBoxUiOutputMenu.h"
#include "saktoolfactory.h" #include "saktoolfactory.h"
#include "sakudptransmittertoolui.h" #include "sakudptransmittertoolui.h"
#include "sakuiinterface.h" #include "sakuiinterface.h"
#include "sakwebsockettransmittertoolui.h" #include "sakwebsockettransmittertoolui.h"
#include "ui_saktoolboxui.h"
#ifdef SAK_IMPORT_MODULE_BLUETOOTH #ifdef SAK_IMPORT_MODULE_BLUETOOTH
#include "sakblecentraltoolui.h" #include "sakblecentraltoolui.h"
#endif #endif
SAKToolBoxUi::SAKToolBoxUi(QWidget* parent) xToolsToolBoxUi::xToolsToolBoxUi(QWidget* parent)
: QWidget{parent} : QWidget{parent}
, ui(new Ui::SAKToolBoxUi) , ui(new Ui::xToolsToolBoxUi)
{ {
ui->setupUi(this); ui->setupUi(this);
m_toolBox = new SAKToolBox(this); m_toolBox = new xToolsToolBox(this);
m_cycleSendingTimer = new QTimer(this); m_cycleSendingTimer = new QTimer(this);
connect(m_cycleSendingTimer, &QTimer::timeout, this, [=]() { connect(m_cycleSendingTimer, &QTimer::timeout, this, [=]() {
@ -60,12 +60,12 @@ SAKToolBoxUi::SAKToolBoxUi(QWidget* parent)
}); });
} }
SAKToolBoxUi::~SAKToolBoxUi() xToolsToolBoxUi::~xToolsToolBoxUi()
{ {
delete ui; delete ui;
} }
QList<int> SAKToolBoxUi::supportedCommunicationTools() QList<int> xToolsToolBoxUi::supportedCommunicationTools()
{ {
QList<int> list; QList<int> list;
list << SAKToolFactory::SerialportTool list << SAKToolFactory::SerialportTool
@ -78,7 +78,7 @@ QList<int> SAKToolBoxUi::supportedCommunicationTools()
return list; return list;
} }
QString SAKToolBoxUi::communicationToolName(int type) QString xToolsToolBoxUi::communicationToolName(int type)
{ {
if (type == SAKToolFactory::SerialportTool) { if (type == SAKToolFactory::SerialportTool) {
return tr("SerialPort"); return tr("SerialPort");
@ -101,7 +101,7 @@ QString SAKToolBoxUi::communicationToolName(int type)
} }
} }
QIcon SAKToolBoxUi::communicationToolIcon(int type) QIcon xToolsToolBoxUi::communicationToolIcon(int type)
{ {
QString fileName; QString fileName;
if (type == SAKToolFactory::SerialportTool) { if (type == SAKToolFactory::SerialportTool) {
@ -126,7 +126,7 @@ QIcon SAKToolBoxUi::communicationToolIcon(int type)
return icon; return icon;
} }
void SAKToolBoxUi::initialize(int type) void xToolsToolBoxUi::initialize(int type)
{ {
if (m_communication) { if (m_communication) {
m_communication->deleteLater(); m_communication->deleteLater();
@ -151,7 +151,7 @@ void SAKToolBoxUi::initialize(int type)
init(); init();
} }
SAKCommunicationToolUi* SAKToolBoxUi::communicationToolUi(int type) SAKCommunicationToolUi* xToolsToolBoxUi::communicationToolUi(int type)
{ {
SAKCommunicationToolUi* w = nullptr; SAKCommunicationToolUi* w = nullptr;
if (type == SAKToolFactory::SerialportTool) { if (type == SAKToolFactory::SerialportTool) {
@ -181,7 +181,7 @@ SAKCommunicationToolUi* SAKToolBoxUi::communicationToolUi(int type)
return w; return w;
} }
void SAKToolBoxUi::try2send() void xToolsToolBoxUi::try2send()
{ {
auto ctx = m_inputMenu->parameters(); auto ctx = m_inputMenu->parameters();
int prefix = ctx.prefix; int prefix = ctx.prefix;
@ -205,7 +205,7 @@ void SAKToolBoxUi::try2send()
m_toolBox->getCommunicationTool()->inputBytes(bytes); m_toolBox->getCommunicationTool()->inputBytes(bytes);
} }
QString SAKToolBoxUi::dateTimeFormat() QString xToolsToolBoxUi::dateTimeFormat()
{ {
static QString dateFormat = QLocale::system().dateFormat(); static QString dateFormat = QLocale::system().dateFormat();
@ -237,7 +237,7 @@ QString SAKToolBoxUi::dateTimeFormat()
return QDateTime::currentDateTime().toString(dateTimeFormat); return QDateTime::currentDateTime().toString(dateTimeFormat);
} }
void SAKToolBoxUi::output2ui(const QByteArray& bytes, const QString& flag, bool isRx) void xToolsToolBoxUi::output2ui(const QByteArray& bytes, const QString& flag, bool isRx)
{ {
int format = ui->comboBoxOutputFormat->currentData().toInt(); int format = ui->comboBoxOutputFormat->currentData().toInt();
QString str = SAKInterface::arrayToString(bytes, format); QString str = SAKInterface::arrayToString(bytes, format);
@ -264,7 +264,7 @@ void SAKToolBoxUi::output2ui(const QByteArray& bytes, const QString& flag, bool
ui->textBrowserOutput->append(info + " " + str); ui->textBrowserOutput->append(info + " " + str);
} }
QString SAKToolBoxUi::settingsGroup() QString xToolsToolBoxUi::settingsGroup()
{ {
if (m_communicationType == SAKToolFactory::SerialportTool) { if (m_communicationType == SAKToolFactory::SerialportTool) {
return "SerialportToolBox"; return "SerialportToolBox";
@ -288,7 +288,7 @@ QString SAKToolBoxUi::settingsGroup()
} }
} }
QByteArray SAKToolBoxUi::calculateCrc(const QByteArray& bytes, bool fixedOriginOrder) QByteArray xToolsToolBoxUi::calculateCrc(const QByteArray& bytes, bool fixedOriginOrder)
{ {
auto ctx = m_inputMenu->parameters(); auto ctx = m_inputMenu->parameters();
QByteArray inputBytes = bytes; QByteArray inputBytes = bytes;
@ -310,7 +310,7 @@ QByteArray SAKToolBoxUi::calculateCrc(const QByteArray& bytes, bool fixedOriginO
return crc; return crc;
} }
void SAKToolBoxUi::setDefaultText() void xToolsToolBoxUi::setDefaultText()
{ {
QByteArray ba("(null)"); QByteArray ba("(null)");
int format = ui->comboBoxInputFormat->currentData().toInt(); int format = ui->comboBoxInputFormat->currentData().toInt();
@ -318,7 +318,7 @@ void SAKToolBoxUi::setDefaultText()
ui->comboBoxInputText->setCurrentText(str); ui->comboBoxInputText->setCurrentText(str);
} }
void SAKToolBoxUi::onIsWorkingChanged() void xToolsToolBoxUi::onIsWorkingChanged()
{ {
bool isWorking = m_toolBox->isWorking(); bool isWorking = m_toolBox->isWorking();
ui->pushButtonInputSend->setEnabled(isWorking); ui->pushButtonInputSend->setEnabled(isWorking);
@ -336,7 +336,7 @@ void SAKToolBoxUi::onIsWorkingChanged()
} }
} }
void SAKToolBoxUi::onBytesWritten(const QByteArray& bytes, const QString& from) void xToolsToolBoxUi::onBytesWritten(const QByteArray& bytes, const QString& from)
{ {
if (!ui->checkBoxOutputTx->isChecked()) { if (!ui->checkBoxOutputTx->isChecked()) {
return; return;
@ -345,7 +345,7 @@ void SAKToolBoxUi::onBytesWritten(const QByteArray& bytes, const QString& from)
output2ui(bytes, from, false); output2ui(bytes, from, false);
} }
void SAKToolBoxUi::onBytesRead(const QByteArray& bytes, const QString& to) void xToolsToolBoxUi::onBytesRead(const QByteArray& bytes, const QString& to)
{ {
if (!ui->checkBoxOutputRx->isChecked()) { if (!ui->checkBoxOutputRx->isChecked()) {
return; return;
@ -354,7 +354,7 @@ void SAKToolBoxUi::onBytesRead(const QByteArray& bytes, const QString& to)
output2ui(bytes, to, true); output2ui(bytes, to, true);
} }
void SAKToolBoxUi::onInputTextChanged() void xToolsToolBoxUi::onInputTextChanged()
{ {
QByteArray b = calculateCrc(QByteArray(), true); QByteArray b = calculateCrc(QByteArray(), true);
QString crc = QString::fromLatin1(b.toHex()); QString crc = QString::fromLatin1(b.toHex());
@ -363,7 +363,7 @@ void SAKToolBoxUi::onInputTextChanged()
ui->labelAlgorithm->setText(m_inputMenu->parameters().algorithmName); ui->labelAlgorithm->setText(m_inputMenu->parameters().algorithmName);
} }
void SAKToolBoxUi::init() void xToolsToolBoxUi::init()
{ {
m_settingsKey.tabIndex = settingsGroup() + "/tabIndex"; m_settingsKey.tabIndex = settingsGroup() + "/tabIndex";
m_settingsKey.items = settingsGroup() + "/items"; m_settingsKey.items = settingsGroup() + "/items";
@ -379,7 +379,7 @@ void SAKToolBoxUi::init()
onComboBoxInputFormatActivated(); onComboBoxInputFormatActivated();
} }
void SAKToolBoxUi::initUi() void xToolsToolBoxUi::initUi()
{ {
initUiCommunication(); initUiCommunication();
initUiInput(); initUiInput();
@ -392,7 +392,7 @@ void SAKToolBoxUi::initUi()
} }
} }
void SAKToolBoxUi::initUiCommunication() void xToolsToolBoxUi::initUiCommunication()
{ {
// Setup communication tool. // Setup communication tool.
m_communicationUi = communicationToolUi(m_communicationType); m_communicationUi = communicationToolUi(m_communicationType);
@ -417,7 +417,7 @@ void SAKToolBoxUi::initUiCommunication()
ui->widgetCommunicationToolUi->layout()->addWidget(m_communicationUi); ui->widgetCommunicationToolUi->layout()->addWidget(m_communicationUi);
} }
void SAKToolBoxUi::initUiInput() void xToolsToolBoxUi::initUiInput()
{ {
ui->comboBoxInputIntervel->addItem(tr("Disable"), -1); ui->comboBoxInputIntervel->addItem(tr("Disable"), -1);
for (int i = 10; i <= 100; i += 10) { for (int i = 10; i <= 100; i += 10) {
@ -443,47 +443,47 @@ void SAKToolBoxUi::initUiInput()
} }
} }
m_inputMenu = new SAKToolBoxUiInputMenu(settingsGroup(), this); m_inputMenu = new xToolsToolBoxUiInputMenu(settingsGroup(), this);
connect(m_inputMenu, connect(m_inputMenu,
&SAKToolBoxUiInputMenu::parametersChanged, &xToolsToolBoxUiInputMenu::parametersChanged,
this, this,
&SAKToolBoxUi::onInputTextChanged); &xToolsToolBoxUi::onInputTextChanged);
ui->pushButtonInputSettings->setMenu(m_inputMenu); ui->pushButtonInputSettings->setMenu(m_inputMenu);
} }
void SAKToolBoxUi::initUiOutput() void xToolsToolBoxUi::initUiOutput()
{ {
ui->checkBoxOutputRx->setChecked(true); ui->checkBoxOutputRx->setChecked(true);
ui->checkBoxOutputTx->setChecked(true); ui->checkBoxOutputTx->setChecked(true);
ui->textBrowserOutput->document()->setMaximumBlockCount(2000); ui->textBrowserOutput->document()->setMaximumBlockCount(2000);
m_outputMenu = new SAKToolBoxUiOutputMenu(settingsGroup(), m_outputMenu = new xToolsToolBoxUiOutputMenu(settingsGroup(),
ui->textBrowserOutput->document(), ui->textBrowserOutput->document(),
this); this);
ui->pushButtonOutputSettings->setMenu(m_outputMenu); ui->pushButtonOutputSettings->setMenu(m_outputMenu);
} }
void SAKToolBoxUi::initSettings() void xToolsToolBoxUi::initSettings()
{ {
initSettingsCommunication(); initSettingsCommunication();
initSettingsInput(); initSettingsInput();
initSettingsOutput(); initSettingsOutput();
} }
void SAKToolBoxUi::initSettingsCommunication() void xToolsToolBoxUi::initSettingsCommunication()
{ {
const QString key = settingsGroup() + "/communication"; const QString key = settingsGroup() + "/communication";
m_communicationUi->initialize(m_communication, key); m_communicationUi->initialize(m_communication, key);
} }
void SAKToolBoxUi::initSettingsInput() void xToolsToolBoxUi::initSettingsInput()
{ {
QString group = settingsGroup(); QString group = settingsGroup();
ui->comboBoxInputFormat->setGroupKey(group + "/input", "fromat"); ui->comboBoxInputFormat->setGroupKey(group + "/input", "fromat");
ui->comboBoxInputText->setGroupKey(group + "/input", "text", false); ui->comboBoxInputText->setGroupKey(group + "/input", "text", false);
} }
void SAKToolBoxUi::initSettingsOutput() void xToolsToolBoxUi::initSettingsOutput()
{ {
QString group = settingsGroup(); QString group = settingsGroup();
ui->comboBoxOutputFormat->setGroupKey(group + "/output", "outputFormat"); ui->comboBoxOutputFormat->setGroupKey(group + "/output", "outputFormat");
@ -501,7 +501,7 @@ void SAKToolBoxUi::initSettingsOutput()
#endif #endif
} }
void SAKToolBoxUi::initSignals() void xToolsToolBoxUi::initSignals()
{ {
initSignalsCommunication(); initSignalsCommunication();
initSignalsInput(); initSignalsInput();
@ -510,52 +510,52 @@ void SAKToolBoxUi::initSignals()
connect(ui->tabWidget, connect(ui->tabWidget,
&QTabWidget::currentChanged, &QTabWidget::currentChanged,
this, this,
&SAKToolBoxUi::onTabWidgetCurrentChanged); &xToolsToolBoxUi::onTabWidgetCurrentChanged);
} }
void SAKToolBoxUi::initSignalsCommunication() void xToolsToolBoxUi::initSignalsCommunication()
{ {
connect(ui->pushButtonCommunicationOpen, connect(ui->pushButtonCommunicationOpen,
&QPushButton::clicked, &QPushButton::clicked,
this, this,
&SAKToolBoxUi::onPushButtonCommunicationOpenClicked); &xToolsToolBoxUi::onPushButtonCommunicationOpenClicked);
} }
void SAKToolBoxUi::initSignalsInput() void xToolsToolBoxUi::initSignalsInput()
{ {
connect(ui->comboBoxInputIntervel, connect(ui->comboBoxInputIntervel,
static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, this,
&SAKToolBoxUi::onComboBoxInputIntervalActivated); &xToolsToolBoxUi::onComboBoxInputIntervalActivated);
connect(ui->pushButtonInputSend, connect(ui->pushButtonInputSend,
&QPushButton::clicked, &QPushButton::clicked,
this, this,
&SAKToolBoxUi::onPushButtonInputSendClicked); &xToolsToolBoxUi::onPushButtonInputSendClicked);
connect(ui->comboBoxInputFormat, connect(ui->comboBoxInputFormat,
static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, this,
&SAKToolBoxUi::onComboBoxInputFormatActivated); &xToolsToolBoxUi::onComboBoxInputFormatActivated);
connect(ui->comboBoxInputText, connect(ui->comboBoxInputText,
static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, this,
&SAKToolBoxUi::onComboBoxInputTextActivated); &xToolsToolBoxUi::onComboBoxInputTextActivated);
connect(ui->comboBoxInputText, connect(ui->comboBoxInputText,
&QComboBox::currentTextChanged, &QComboBox::currentTextChanged,
this, this,
&SAKToolBoxUi::onInputTextChanged); &xToolsToolBoxUi::onInputTextChanged);
} }
void SAKToolBoxUi::initSignalsOutput() void xToolsToolBoxUi::initSignalsOutput()
{ {
connect(ui->checkBoxOutputWrap, connect(ui->checkBoxOutputWrap,
&QCheckBox::clicked, &QCheckBox::clicked,
this, this,
&SAKToolBoxUi::onCheckBoxOutputWrapClicked); &xToolsToolBoxUi::onCheckBoxOutputWrapClicked);
} }
void SAKToolBoxUi::initTools() void xToolsToolBoxUi::initTools()
{ {
m_communicationMenu = new SAKToolBoxUiCommunicationMenu(this); m_communicationMenu = new xToolsToolBoxUiCommunicationMenu(this);
m_communicationMenu->initialize(m_toolBox, settingsGroup()); m_communicationMenu->initialize(m_toolBox, settingsGroup());
ui->pushButtonCommunicationSettings->setMenu(m_communicationMenu); ui->pushButtonCommunicationSettings->setMenu(m_communicationMenu);
@ -622,21 +622,21 @@ void SAKToolBoxUi::initTools()
SAKSettings::instance()->setValue(key, index); SAKSettings::instance()->setValue(key, index);
}); });
connect(m_toolBox, &SAKToolBox::isWorkingChanged, this, &SAKToolBoxUi::onIsWorkingChanged); connect(m_toolBox, &xToolsToolBox::isWorkingChanged, this, &xToolsToolBoxUi::onIsWorkingChanged);
connect(m_toolBox, &SAKToolBox::errorOccurred, this, [=](const QString& err) { connect(m_toolBox, &xToolsToolBox::errorOccurred, this, [=](const QString& err) {
QMessageBox::warning(this, tr("Error Occured"), err); QMessageBox::warning(this, tr("Error Occured"), err);
}); });
connect(m_communication, connect(m_communication,
&SAKCommunicationTool::bytesWritten, &SAKCommunicationTool::bytesWritten,
this, this,
&SAKToolBoxUi::onBytesWritten); &xToolsToolBoxUi::onBytesWritten);
connect(m_communication, &SAKCommunicationTool::bytesRead, this, &SAKToolBoxUi::onBytesRead); connect(m_communication, &SAKCommunicationTool::bytesRead, this, &xToolsToolBoxUi::onBytesRead);
ui->pushButtonPrestorer->setMenu(m_prestorerUi->menu()); ui->pushButtonPrestorer->setMenu(m_prestorerUi->menu());
} }
void SAKToolBoxUi::onTabWidgetCurrentChanged(int index) void xToolsToolBoxUi::onTabWidgetCurrentChanged(int index)
{ {
if (m_settingsKey.tabIndex.isEmpty()) { if (m_settingsKey.tabIndex.isEmpty()) {
return; return;
@ -645,7 +645,7 @@ void SAKToolBoxUi::onTabWidgetCurrentChanged(int index)
SAKSettings::instance()->setValue(m_settingsKey.tabIndex, index); SAKSettings::instance()->setValue(m_settingsKey.tabIndex, index);
} }
void SAKToolBoxUi::onPushButtonCommunicationOpenClicked() void xToolsToolBoxUi::onPushButtonCommunicationOpenClicked()
{ {
ui->pushButtonCommunicationOpen->setEnabled(false); ui->pushButtonCommunicationOpen->setEnabled(false);
if (m_toolBox->isWorking()) { if (m_toolBox->isWorking()) {
@ -655,7 +655,7 @@ void SAKToolBoxUi::onPushButtonCommunicationOpenClicked()
} }
} }
void SAKToolBoxUi::onCheckBoxOutputWrapClicked() void xToolsToolBoxUi::onCheckBoxOutputWrapClicked()
{ {
if (ui->checkBoxOutputWrap->isChecked()) { if (ui->checkBoxOutputWrap->isChecked()) {
ui->textBrowserOutput->setWordWrapMode(QTextOption::WrapAnywhere); ui->textBrowserOutput->setWordWrapMode(QTextOption::WrapAnywhere);
@ -664,7 +664,7 @@ void SAKToolBoxUi::onCheckBoxOutputWrapClicked()
} }
} }
void SAKToolBoxUi::onPushButtonInputSendClicked() void xToolsToolBoxUi::onPushButtonInputSendClicked()
{ {
if (ui->comboBoxInputText->currentText().isEmpty()) { if (ui->comboBoxInputText->currentText().isEmpty()) {
qInfo() << "input text is empty," qInfo() << "input text is empty,"
@ -713,7 +713,7 @@ void SAKToolBoxUi::onPushButtonInputSendClicked()
try2send(); try2send();
} }
void SAKToolBoxUi::onComboBoxInputIntervalActivated() void xToolsToolBoxUi::onComboBoxInputIntervalActivated()
{ {
int interval = ui->comboBoxInputIntervel->currentText().toInt(); int interval = ui->comboBoxInputIntervel->currentText().toInt();
interval = interval < 10 ? 10 : interval; interval = interval < 10 ? 10 : interval;
@ -726,7 +726,7 @@ void SAKToolBoxUi::onComboBoxInputIntervalActivated()
} }
} }
void SAKToolBoxUi::onComboBoxInputFormatActivated() void xToolsToolBoxUi::onComboBoxInputFormatActivated()
{ {
int format = ui->comboBoxInputFormat->currentData().toInt(); int format = ui->comboBoxInputFormat->currentData().toInt();
auto lineEdit = ui->comboBoxInputText->lineEdit(); auto lineEdit = ui->comboBoxInputText->lineEdit();
@ -734,7 +734,7 @@ void SAKToolBoxUi::onComboBoxInputFormatActivated()
SAKUiInterface::setValidator(lineEdit, format); SAKUiInterface::setValidator(lineEdit, format);
} }
void SAKToolBoxUi::onComboBoxInputTextActivated() void xToolsToolBoxUi::onComboBoxInputTextActivated()
{ {
int format = ui->comboBoxInputText->currentData().toInt(); int format = ui->comboBoxInputText->currentData().toInt();
ui->comboBoxInputFormat->setCurrentIndexFromData(format); ui->comboBoxInputFormat->setCurrentIndexFromData(format);

View File

@ -6,8 +6,7 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKTOOLBOXUI_H #pragma once
#define SAKTOOLBOXUI_H
#include <QIcon> #include <QIcon>
#include <QList> #include <QList>
@ -16,30 +15,30 @@
#include <QWidget> #include <QWidget>
#include "sakcommunicationtoolui.h" #include "sakcommunicationtoolui.h"
#include "saktoolbox.h" #include "xToolsToolBox.h"
namespace Ui { namespace Ui {
class SAKToolBoxUi; class xToolsToolBoxUi;
} }
class SAKEmitterToolUi; class SAKEmitterToolUi;
class SAKResponserToolUi; class SAKResponserToolUi;
class SAKPrestorerToolUi; class SAKPrestorerToolUi;
class SAKCommunicationTool; class SAKCommunicationTool;
class SAKToolBoxUiInputMenu; class xToolsToolBoxUiInputMenu;
class SAKToolBoxUiOutputMenu; class xToolsToolBoxUiOutputMenu;
class SAKCommunicationToolUi; class SAKCommunicationToolUi;
class SAKTcpTransmitterToolUi; class SAKTcpTransmitterToolUi;
class SAKUdpTransmitterToolUi; class SAKUdpTransmitterToolUi;
class SAKToolBoxUiCommunicationMenu; class xToolsToolBoxUiCommunicationMenu;
class SAKWebSocketTransmitterToolUi; class SAKWebSocketTransmitterToolUi;
class SAKSerialPortTransmitterToolUi; class SAKSerialPortTransmitterToolUi;
class SAKToolBoxUi : public QWidget class xToolsToolBoxUi : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit SAKToolBoxUi(QWidget *parent = nullptr); explicit xToolsToolBoxUi(QWidget *parent = nullptr);
~SAKToolBoxUi() override; ~xToolsToolBoxUi() override;
static QList<int> supportedCommunicationTools(); static QList<int> supportedCommunicationTools();
static QString communicationToolName(int type); static QString communicationToolName(int type);
@ -48,7 +47,7 @@ public:
void initialize(int type); void initialize(int type);
private: private:
SAKToolBox *m_toolBox{nullptr}; xToolsToolBox *m_toolBox{nullptr};
SAKCommunicationTool *m_communication{nullptr}; SAKCommunicationTool *m_communication{nullptr};
SAKCommunicationToolUi *m_communicationUi{nullptr}; SAKCommunicationToolUi *m_communicationUi{nullptr};
SAKEmitterToolUi *m_emitterUi{nullptr}; SAKEmitterToolUi *m_emitterUi{nullptr};
@ -60,9 +59,9 @@ private:
SAKSerialPortTransmitterToolUi *m_serialPortTransmitterUi{nullptr}; SAKSerialPortTransmitterToolUi *m_serialPortTransmitterUi{nullptr};
QTimer *m_cycleSendingTimer{nullptr}; QTimer *m_cycleSendingTimer{nullptr};
int m_communicationType; int m_communicationType;
SAKToolBoxUiCommunicationMenu *m_communicationMenu{nullptr}; xToolsToolBoxUiCommunicationMenu *m_communicationMenu{nullptr};
SAKToolBoxUiInputMenu *m_inputMenu{nullptr}; xToolsToolBoxUiInputMenu *m_inputMenu{nullptr};
SAKToolBoxUiOutputMenu *m_outputMenu{nullptr}; xToolsToolBoxUiOutputMenu *m_outputMenu{nullptr};
struct struct
{ {
@ -107,7 +106,7 @@ private:
void initTools(); void initTools();
private: private:
Ui::SAKToolBoxUi *ui; Ui::xToolsToolBoxUi *ui;
void onTabWidgetCurrentChanged(int index); void onTabWidgetCurrentChanged(int index);
// communication // communication
@ -122,5 +121,3 @@ private:
// output // output
void onCheckBoxOutputWrapClicked(); void onCheckBoxOutputWrapClicked();
}; };
#endif // SAKTOOLBOXUI_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>SAKToolBoxUi</class> <class>xToolsToolBoxUi</class>
<widget class="QWidget" name="SAKToolBoxUi"> <widget class="QWidget" name="xToolsToolBoxUi">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View File

@ -6,16 +6,16 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "saktoolboxuicommunicationmenu.h" #include "xToolsToolBoxUiCommunicationMenu.h"
#include "ui_xToolsToolBoxUiCommunicationMenu.h"
#include <QWidgetAction> #include <QWidgetAction>
#include "saktoolbox.h" #include "xToolsToolBox.h"
#include "ui_saktoolboxuicommunicationmenu.h"
SAKToolBoxUiCommunicationMenu::SAKToolBoxUiCommunicationMenu(QWidget* parent) xToolsToolBoxUiCommunicationMenu::xToolsToolBoxUiCommunicationMenu(QWidget* parent)
: QMenu(parent) : QMenu(parent)
, ui(new Ui::SAKToolBoxUiCommunicationMenu) , ui(new Ui::xToolsToolBoxUiCommunicationMenu)
{ {
QWidget* w = new QWidget(this); QWidget* w = new QWidget(this);
ui->setupUi(w); ui->setupUi(w);
@ -24,12 +24,12 @@ SAKToolBoxUiCommunicationMenu::SAKToolBoxUiCommunicationMenu(QWidget* parent)
addAction(action); addAction(action);
} }
SAKToolBoxUiCommunicationMenu::~SAKToolBoxUiCommunicationMenu() xToolsToolBoxUiCommunicationMenu::~xToolsToolBoxUiCommunicationMenu()
{ {
delete ui; delete ui;
} }
void SAKToolBoxUiCommunicationMenu::initialize(SAKToolBox* toolBox, const QString& settingsGroup) void xToolsToolBoxUiCommunicationMenu::initialize(xToolsToolBox* toolBox, const QString& settingsGroup)
{ {
auto storer = toolBox->getStorerTool(); auto storer = toolBox->getStorerTool();
auto storerGroup = settingsGroup + "/storer"; auto storerGroup = settingsGroup + "/storer";

View File

@ -6,33 +6,30 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKTOOLBOXUICOMMUNICATIONMENU_H #pragma once
#define SAKTOOLBOXUICOMMUNICATIONMENU_H
#include <QLoggingCategory> #include <QLoggingCategory>
#include <QMenu> #include <QMenu>
#include <QTextDocument> #include <QTextDocument>
namespace Ui { namespace Ui {
class SAKToolBoxUiCommunicationMenu; class xToolsToolBoxUiCommunicationMenu;
} }
class SAKToolBox; class xToolsToolBox;
class SAKHighlighter; class SAKHighlighter;
class SAKToolBoxUiCommunicationMenu : public QMenu class xToolsToolBoxUiCommunicationMenu : public QMenu
{ {
Q_OBJECT Q_OBJECT
public: public:
SAKToolBoxUiCommunicationMenu(QWidget *parent = nullptr); xToolsToolBoxUiCommunicationMenu(QWidget *parent = nullptr);
~SAKToolBoxUiCommunicationMenu(); ~xToolsToolBoxUiCommunicationMenu();
void initialize(SAKToolBox *toolBox, const QString &settingsGroup); void initialize(xToolsToolBox *toolBox, const QString &settingsGroup);
private: private:
const QLoggingCategory mLoggingCategory{"SAK.CustomBoxUiParameters"}; const QLoggingCategory mLoggingCategory{"SAK.CustomBoxUiParameters"};
private: private:
Ui::SAKToolBoxUiCommunicationMenu *ui; Ui::xToolsToolBoxUiCommunicationMenu *ui;
}; };
#endif // SAKTOOLBOXUICOMMUNICATIONMENU_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>SAKToolBoxUiCommunicationMenu</class> <class>xToolsToolBoxUiCommunicationMenu</class>
<widget class="QWidget" name="SAKToolBoxUiCommunicationMenu"> <widget class="QWidget" name="xToolsToolBoxUiCommunicationMenu">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View File

@ -1,12 +1,12 @@
/*************************************************************************************************** /***************************************************************************************************
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved. * Copyright 2023-2024 x-tools-author(x-tools@outlook.com). All rights reserved.
* *
* The file is encoded using "utf8 with bom", it is a part of xTools project. * The file is encoded using "utf8 with bom", it is a part of xTools project.
* *
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "saktoolboxuifactory.h" #include "xToolsToolBoxUiFactory.h"
#include "saktoolfactory.h" #include "saktoolfactory.h"
#if 0 #if 0
@ -21,17 +21,17 @@
#include "SAKWebSocketServerToolBoxUi.h" #include "SAKWebSocketServerToolBoxUi.h"
#endif #endif
SAKToolBoxUiFactory::SAKToolBoxUiFactory(QObject* parent) xToolsToolBoxUiFactory::xToolsToolBoxUiFactory(QObject* parent)
: QObject{parent} : QObject{parent}
{} {}
SAKToolBoxUiFactory* SAKToolBoxUiFactory::instance() xToolsToolBoxUiFactory* xToolsToolBoxUiFactory::instance()
{ {
static SAKToolBoxUiFactory factory; static xToolsToolBoxUiFactory factory;
return &factory; return &factory;
} }
QList<int> SAKToolBoxUiFactory::supportedTools() QList<int> xToolsToolBoxUiFactory::supportedTools()
{ {
QList<int> list; QList<int> list;
list << SAKToolFactory::SerialportTool << SAKToolFactory::UdpClientTool list << SAKToolFactory::SerialportTool << SAKToolFactory::UdpClientTool
@ -42,7 +42,7 @@ QList<int> SAKToolBoxUiFactory::supportedTools()
return list; return list;
} }
SAKToolBoxUi* SAKToolBoxUiFactory::createToolBoxUi(int type) xToolsToolBoxUi* xToolsToolBoxUiFactory::createToolBoxUi(int type)
{ {
#if 0 #if 0
if (type == SAKToolFactory::SerialportTool) { if (type == SAKToolFactory::SerialportTool) {

View File

@ -1,29 +1,26 @@
/*************************************************************************************************** /***************************************************************************************************
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved. * Copyright 2023-2024 x-tools-author(x-tools@outlook.com). All rights reserved.
* *
* The file is encoded using "utf8 with bom", it is a part of xTools project. * The file is encoded using "utf8 with bom", it is a part of xTools project.
* *
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKTOOLBOXUIFACTORY_H #pragma once
#define SAKTOOLBOXUIFACTORY_H
#include <QObject> #include <QObject>
class SAKToolBoxUi; class xToolsToolBoxUi;
class SAKToolBoxUiFactory : public QObject class xToolsToolBoxUiFactory : public QObject
{ {
Q_OBJECT Q_OBJECT
private: private:
explicit SAKToolBoxUiFactory(QObject *parent = nullptr); explicit xToolsToolBoxUiFactory(QObject *parent = nullptr);
public: public:
static SAKToolBoxUiFactory *instance(); static xToolsToolBoxUiFactory *instance();
QList<int> supportedTools(); QList<int> supportedTools();
SAKToolBoxUi *createToolBoxUi(int type); xToolsToolBoxUi *createToolBoxUi(int type);
private: private:
}; };
#endif // SAKTOOLBOXUIFACTORY_H

View File

@ -6,17 +6,16 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "saktoolboxuiinputmenu.h" #include "xToolsToolBoxUiInputMenu.h"
#include "ui_xToolsToolBoxUiInputMenu.h"
#include <QWidgetAction> #include <QWidgetAction>
#include "ui_saktoolboxuiinputmenu.h"
#define SAK_CB_ACTIVATED static_cast<void (QComboBox::*)(int)>(&QComboBox::activated) #define SAK_CB_ACTIVATED static_cast<void (QComboBox::*)(int)>(&QComboBox::activated)
SAKToolBoxUiInputMenu::SAKToolBoxUiInputMenu(const QString& settingsGroup, QWidget* parent) xToolsToolBoxUiInputMenu::xToolsToolBoxUiInputMenu(const QString& settingsGroup, QWidget* parent)
: QMenu{parent} : QMenu{parent}
, ui(new Ui::SAKToolBoxUiInputMenu) , ui(new Ui::xToolsToolBoxUiInputMenu)
{ {
QWidget* w = new QWidget(this); QWidget* w = new QWidget(this);
ui->setupUi(w); ui->setupUi(w);
@ -88,12 +87,12 @@ SAKToolBoxUiInputMenu::SAKToolBoxUiInputMenu(const QString& settingsGroup, QWidg
}); });
} }
SAKToolBoxUiInputMenu::~SAKToolBoxUiInputMenu() xToolsToolBoxUiInputMenu::~xToolsToolBoxUiInputMenu()
{ {
delete ui; delete ui;
} }
SAKToolBoxUiInputMenu::Parameters SAKToolBoxUiInputMenu::parameters() xToolsToolBoxUiInputMenu::Parameters xToolsToolBoxUiInputMenu::parameters()
{ {
return mParameters; return mParameters;
} }

View File

@ -6,21 +6,20 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKTOOLBOXUIINPUTMENU_H #pragma once
#define SAKTOOLBOXUIINPUTMENU_H
#include <QMenu> #include <QMenu>
namespace Ui { namespace Ui {
class SAKToolBoxUiInputMenu; class xToolsToolBoxUiInputMenu;
} }
class SAKToolBoxUiInputMenu : public QMenu class xToolsToolBoxUiInputMenu : public QMenu
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit SAKToolBoxUiInputMenu(const QString &settingsGroup, QWidget *parent = nullptr); explicit xToolsToolBoxUiInputMenu(const QString &settingsGroup, QWidget *parent = nullptr);
~SAKToolBoxUiInputMenu(); ~xToolsToolBoxUiInputMenu();
struct Parameters struct Parameters
{ {
@ -46,7 +45,5 @@ private:
Parameters mParameters; Parameters mParameters;
private: private:
Ui::SAKToolBoxUiInputMenu *ui; Ui::xToolsToolBoxUiInputMenu *ui;
}; };
#endif // SAKTOOLBOXUIINPUTMENU_H

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>SAKToolBoxUiInputMenu</class> <class>xToolsToolBoxUiInputMenu</class>
<widget class="QWidget" name="SAKToolBoxUiInputMenu"> <widget class="QWidget" name="xToolsToolBoxUiInputMenu">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>232</width> <width>244</width>
<height>240</height> <height>240</height>
</rect> </rect>
</property> </property>

View File

@ -6,19 +6,20 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "saktoolboxuioutputmenu.h" #include "xToolsToolBoxUiOutputMenu.h"
#include "ui_xToolsToolBoxUiOutputMenu.h"
#include <QWidgetAction> #include <QWidgetAction>
#include "sakhighlighter.h" #include "sakhighlighter.h"
#include "saksettings.h" #include "saksettings.h"
#include "ui_saktoolboxuioutputmenu.h"
SAKToolBoxUiOutputMenu::SAKToolBoxUiOutputMenu(const QString& settingsGroup,
xToolsToolBoxUiOutputMenu::xToolsToolBoxUiOutputMenu(const QString& settingsGroup,
QTextDocument* doc, QTextDocument* doc,
QWidget* parent) QWidget* parent)
: QMenu(parent) : QMenu(parent)
, ui(new Ui::SAKToolBoxUiOutputMenu) , ui(new Ui::xToolsToolBoxUiOutputMenu)
{ {
QWidget* w = new QWidget(this); QWidget* w = new QWidget(this);
ui->setupUi(w); ui->setupUi(w);
@ -62,12 +63,12 @@ SAKToolBoxUiOutputMenu::SAKToolBoxUiOutputMenu(const QString& settingsGroup,
}); });
} }
SAKToolBoxUiOutputMenu::~SAKToolBoxUiOutputMenu() xToolsToolBoxUiOutputMenu::~xToolsToolBoxUiOutputMenu()
{ {
delete ui; delete ui;
} }
QString SAKToolBoxUiOutputMenu::filter() QString xToolsToolBoxUiOutputMenu::filter()
{ {
return ui->filter->text().trimmed(); return ui->filter->text().trimmed();
} }

View File

@ -6,30 +6,27 @@
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKTOOLBOXUIOUTPUTMENU_H #pragma once
#define SAKTOOLBOXUIOUTPUTMENU_H
#include <QMenu> #include <QMenu>
#include <QTextDocument> #include <QTextDocument>
#include <QWidget> #include <QWidget>
namespace Ui { namespace Ui {
class SAKToolBoxUiOutputMenu; class xToolsToolBoxUiOutputMenu;
} }
class SAKToolBoxUiOutputMenu : public QMenu class xToolsToolBoxUiOutputMenu : public QMenu
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit SAKToolBoxUiOutputMenu(const QString &settingsGroup, explicit xToolsToolBoxUiOutputMenu(const QString &settingsGroup,
QTextDocument *doc, QTextDocument *doc,
QWidget *parent = nullptr); QWidget *parent = nullptr);
~SAKToolBoxUiOutputMenu(); ~xToolsToolBoxUiOutputMenu();
QString filter(); QString filter();
private: private:
Ui::SAKToolBoxUiOutputMenu *ui; Ui::xToolsToolBoxUiOutputMenu *ui;
}; };
#endif // SAKTOOLBOXUIOUTPUTMENU_H

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>SAKToolBoxUiOutputMenu</class> <class>xToolsToolBoxUiOutputMenu</class>
<widget class="QWidget" name="SAKToolBoxUiOutputMenu"> <widget class="QWidget" name="xToolsToolBoxUiOutputMenu">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>224</width> <width>236</width>
<height>114</height> <height>114</height>
</rect> </rect>
</property> </property>

View File

@ -7,7 +7,7 @@
* code directory. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "sak.h" #include "sak.h"
#include "application.h" #include "Application.h"
int main(const int argc, char *argv[]) int main(const int argc, char *argv[])
{ {