mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-31 17:42:55 +08:00
Address issue #240
This commit is contained in:
parent
6d568de039
commit
fda2ec9053
@ -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()
|
||||
|
||||
|
@ -98,6 +98,14 @@ Controls.GroupBox {
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onDoubleClicked: {
|
||||
if (root.buttonIcon !== "")
|
||||
root.actionButtonClicked()
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: 4
|
||||
anchors.leftMargin: 0
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user