Skip to content

Commit

Permalink
hide sidebar, build on windows with tcp (still giving errors)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle committed Sep 30, 2023
1 parent 1253402 commit 4a20933
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/telemetry/connection/tcp_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ void TCPConnection::send_message(const mavlink_message_t &msg)

// TODO: remove this assert again
assert(buffer_len <= MAVLINK_MAX_PACKET_LEN);
#ifdef MSG_NOSIGNAL
auto flags = MSG_NOSIGNAL;
#else
auto flags = 0; // No MSG_NOSIGNAL available, handle it accordingly
#endif
const auto send_len = sendto(
m_socket_fd,
reinterpret_cast<char*>(buffer),
Expand Down Expand Up @@ -146,7 +150,7 @@ void TCPConnection::connect_once()
// Enough for MTU 1500 bytes.
uint8_t buffer[2048];
while (m_keep_receiving) {
const auto recv_len = recv(m_socket_fd, buffer, sizeof(buffer), 0);
const auto recv_len = recv(m_socket_fd, reinterpret_cast<char*>(buffer), sizeof(buffer), 0);

if (recv_len == 0) {
// This can happen when shutdown is called on the socket,
Expand Down
29 changes: 29 additions & 0 deletions qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,35 @@ ScrollView {
onCheckedChanged: settings.show_record_widget = checked
}
}

Rectangle {
width: parent.width
height: rowHeight
color: (Positioner.index % 2 == 0) ? "#8cbfd7f3" : "#00000000"

Text {
text: qsTr("Show Sidebar ProofOfConcept")
font.weight: Font.Bold
font.pixelSize: 13
anchors.leftMargin: 8
verticalAlignment: Text.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
width: 224
height: elementHeight
anchors.left: parent.left
}

Switch {
width: 32
height: elementHeight
anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36

anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
checked: settings.show_sidebar
onCheckedChanged: settings.show_sidebar = checked
}
}

SettingBaseElement{
m_short_description: "Show distance sensor widget"
Expand Down
2 changes: 2 additions & 0 deletions qml/ui/elements/AppSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,6 @@ Settings {

property double hide_identity_latitude_offset: 0.0
property double hide_identity_longitude_offset: 0.0

property bool show_sidebar: false
}
2 changes: 1 addition & 1 deletion qml/ui/widgets/Sidebar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "../elements"
BaseWidget {
id: sidebar
y: (applicationWindow.height/2) - (googleUI.height/2)
visible: true
visible: settings.show_sidebar
widgetIdentifier: "sidebar"
bw_verbose_name: "SIDEBAR"
property int secondaryUiWidth: 335
Expand Down

0 comments on commit 4a20933

Please sign in to comment.