Add network icon and update connections view

This commit is contained in:
Simon Stürz 2018-07-05 12:51:04 +02:00
parent 1e9a052999
commit 0e50c481fb
4 changed files with 26 additions and 3 deletions

View File

@ -24,6 +24,9 @@ bool BluetoothServiceDiscovery::discovering() const
bool BluetoothServiceDiscovery::available() const
{
if (!m_localDevice)
return false;
return m_localDevice->isValid() && !m_localDevice->hostMode() != QBluetoothLocalDevice::HostPoweredOff;
}
@ -74,7 +77,7 @@ void BluetoothServiceDiscovery::onHostModeChanged(const QBluetoothLocalDevice::H
void BluetoothServiceDiscovery::onServiceDiscovered(const QBluetoothServiceInfo &serviceInfo)
{
qDebug() << "BluetoothServiceDiscovery: Service [+]" << serviceInfo.device().name() << serviceInfo.serviceName() << serviceInfo.serviceDescription() << serviceInfo.serviceProvider();
qDebug() << "BluetoothServiceDiscovery: Service [+]" << serviceInfo.device().name() << serviceInfo.serviceName() << serviceInfo.serviceProvider();
qDebug() << "Discovered service on"
<< serviceInfo.device().name() << serviceInfo.device().address().toString();
@ -83,6 +86,8 @@ void BluetoothServiceDiscovery::onServiceDiscovered(const QBluetoothServiceInfo
<< serviceInfo.attribute(QBluetoothServiceInfo::ServiceDescription).toString();
qDebug() << "\tProvider:"
<< serviceInfo.attribute(QBluetoothServiceInfo::ServiceProvider).toString();
qDebug() << "\Documentation:"
<< serviceInfo.attribute(QBluetoothServiceInfo::DocumentationUrl).toString();
qDebug() << "\tL2CAP protocol service multiplexer:"
<< serviceInfo.protocolServiceMultiplexer();
qDebug() << "\tRFCOMM server channel:" << serviceInfo.serverChannel();
@ -97,7 +102,7 @@ void BluetoothServiceDiscovery::onServiceDiscovered(const QBluetoothServiceInfo
if (!device) {
device = new DiscoveryDevice(DiscoveryDevice::DeviceTypeBluetooth, this);
qDebug() << "BluetoothServiceDiscovery: Adding new bluetooth host to model";
device->setName(serviceInfo.device().name());
device->setName(QString("%1 (%2)").arg(serviceInfo.serviceName()).arg(serviceInfo.device().name()));
device->setBluetoothAddress(serviceInfo.device().address());
m_discoveryModel->addDevice(device);
}

View File

@ -236,5 +236,6 @@
<file>ui/images/sensors/temperature.svg</file>
<file>ui/components/MainPageTile.qml</file>
<file>ui/images/configure.svg</file>
<file>ui/images/network-wifi-symbolic.svg</file>
</qresource>
</RCC>

View File

@ -172,7 +172,7 @@ Page {
return usedConfigIndex
}
iconName: model.type === DiscoveryDevice.DeviceTypeNetwork ? "../images/network-vpn.svg" : "../images/bluetooth.svg"
iconName: model.type === DiscoveryDevice.DeviceTypeNetwork ? "../images/network-wifi-symbolic.svg" : "../images/bluetooth.svg"
text: model.name
subText: model.type === DiscoveryDevice.DeviceTypeNetwork ? model.hostAddress : model.bluetoothAddress
property bool hasSecurePort: {

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg id="svg4874" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="96" viewBox="0 0 96 96.000001" width="96" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata id="metadata4879">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g id="layer1" transform="translate(67.857 -78.505)">
<rect id="rect4782" style="color:#000000;fill:none" transform="rotate(90)" height="96" width="96" y="-28.143" x="78.505"/>
<path id="path4197" style="color:#000000;fill:#808080" d="m48 12.016c-16.384 0-32.768 6.242-45.254 18.728l3.5352 3.535c23.062-23.062 60.376-23.062 83.438 0l3.537-3.535c-12.486-12.486-28.872-18.728-45.256-18.728zm0 14c-12.801 0-25.603 4.876-35.355 14.629l3.535 3.535c17.594-17.595 46.046-17.595 63.64 0l3.535-3.535c-9.752-9.753-22.554-14.629-35.355-14.629zm0 14c-9.218 0-18.436 3.508-25.455 10.527l3.535 3.535c12.127-12.127 31.713-12.127 43.84 0l3.537-3.535c-7.019-7.019-16.239-10.527-25.457-10.527zm0 14c-5.636 0-11.271 2.142-15.557 6.427l3.536 3.536c6.659-6.66 17.383-6.66 24.042 0l3.536-3.536c-4.286-4.285-9.921-6.427-15.557-6.427zm0 13.984a8 8 0 0 0 -8 8 8 8 0 0 0 8 8 8 8 0 0 0 8 -8 8 8 0 0 0 -8 -8z" transform="translate(-67.857 78.505)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB