Address issue #240

This commit is contained in:
Alex Spataru 2024-12-06 10:09:58 -05:00
parent 6d568de039
commit fda2ec9053
5 changed files with 43 additions and 13 deletions

View File

@ -318,11 +318,11 @@ set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_FILE_LICENSE})
set(CPACK_MONOLITHIC_INSTALL ON)
if(WIN32)
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\deploy\\\\windows\\\\icon.ico")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\deploy\\\\windows\\\\icon.ico")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
else()
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/deploy/icon.png")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/deploy/icon.png")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
endif()
if(NOT CPACK_GENERATOR)
@ -340,9 +340,9 @@ if(NOT CPACK_GENERATOR)
set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_EXECUTABLE} "${PROJECT_DISPNAME}")
elseif(APPLE)
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_GENERATOR "DragNDrop")
else()
set(CPACK_GENERATOR "TGZ")
set(CPACK_GENERATOR "TGZ")
endif()
endif()

View File

@ -98,6 +98,14 @@ Controls.GroupBox {
}
}
MouseArea {
anchors.fill: parent
onDoubleClicked: {
if (root.buttonIcon !== "")
root.actionButtonClicked()
}
}
RowLayout {
spacing: 4
anchors.leftMargin: 0

View File

@ -52,6 +52,12 @@ IO::Drivers::Network::Network()
connect(this, &IO::Drivers::Network::portChanged, this,
&IO::Drivers::Network::configurationChanged);
// Update open state when socket states change
connect(&m_tcpSocket, &QUdpSocket::stateChanged, this,
[=] { Q_EMIT configurationChanged(); });
connect(&m_udpSocket, &QUdpSocket::stateChanged, this,
[=] { Q_EMIT configurationChanged(); });
// Report socket errors
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
connect(&m_tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)), this,
@ -105,12 +111,24 @@ void IO::Drivers::Network::close()
*/
bool IO::Drivers::Network::isOpen() const
{
if (socketType() == QAbstractSocket::UdpSocket)
return m_udpSocket.isOpen();
else if (socketType() == QAbstractSocket::TcpSocket)
return m_tcpSocket.isOpen();
bool open = false;
auto state = QAbstractSocket::UnconnectedState;
return false;
if (socketType() == QAbstractSocket::UdpSocket)
{
open = m_udpSocket.isOpen();
state = m_udpSocket.state();
}
else if (socketType() == QAbstractSocket::TcpSocket)
{
open = m_tcpSocket.isOpen();
state = m_tcpSocket.state();
}
return open
&& (state == QUdpSocket::ConnectedState
|| state == QUdpSocket::BoundState);
}
/**

View File

@ -78,6 +78,10 @@ IO::Manager::Manager()
connect(this, &IO::Manager::busTypeChanged, this,
&IO::Manager::configurationChanged);
// Automatically check/unckeck connected button when configuration changes
connect(this, &IO::Manager::configurationChanged, this,
&IO::Manager::connectedChanged);
// Avoid crashing the app when quitting
connect(qApp, &QApplication::aboutToQuit, this, [=] {
disconnect(&m_frameReader);

View File

@ -177,8 +177,8 @@ void Misc::ThemeManager::setTheme(const int index)
m_colors = m_themeData.value("colors").toObject();
// Tell OS if we prefer dark mode or light mode
auto bg = getColor("base");
auto fg = getColor("text");
const auto bg = getColor(QStringLiteral("base"));
const auto fg = getColor(QStringLiteral("text"));
if (fg.lightness() > bg.lightness())
qApp->styleHints()->setColorScheme(Qt::ColorScheme::Dark);
else