NetworkStatus now joins networks by address instead of name.

* This solves part of ticket #10008.
This commit is contained in:
Axel Dörfler 2013-09-27 00:21:04 +02:00
parent 1bc85a38d5
commit 6c7caf44df

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2006-2012, Haiku, Inc. All rights reserved. * Copyright 2006-2013, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@ -288,10 +288,12 @@ NetworkStatusView::MessageReceived(BMessage* message)
{ {
const char* deviceName; const char* deviceName;
const char* name; const char* name;
BNetworkAddress address;
if (message->FindString("device", &deviceName) == B_OK if (message->FindString("device", &deviceName) == B_OK
&& message->FindString("name", &name) == B_OK) { && message->FindString("name", &name) == B_OK
&& message->FindFlat("address", &address) == B_OK) {
BNetworkDevice device(deviceName); BNetworkDevice device(deviceName);
status_t status = device.JoinNetwork(name); status_t status = device.JoinNetwork(address);
if (status != B_OK) { if (status != B_OK) {
BString text BString text
= B_TRANSLATE("Could not join wireless network:\n"); = B_TRANSLATE("Could not join wireless network:\n");
@ -467,6 +469,7 @@ NetworkStatusView::MouseDown(BPoint point)
BMessage* message = new BMessage(kMsgJoinNetwork); BMessage* message = new BMessage(kMsgJoinNetwork);
message->AddString("device", wifiInterface); message->AddString("device", wifiInterface);
message->AddString("name", network.name); message->AddString("name", network.name);
message->AddFlat("address", &network.address);
BMenuItem* item = new WirelessNetworkMenuItem(network.name, BMenuItem* item = new WirelessNetworkMenuItem(network.name,
network.signal_strength, network.signal_strength,
@ -506,7 +509,7 @@ NetworkStatusView::_AboutRequested()
{ {
BAboutWindow* window = new BAboutWindow( BAboutWindow* window = new BAboutWindow(
B_TRANSLATE_SYSTEM_NAME("NetworkStatus"), kSignature); B_TRANSLATE_SYSTEM_NAME("NetworkStatus"), kSignature);
const char* authors[] = { const char* authors[] = {
"Axel Dörfler", "Axel Dörfler",
"Hugo Santos", "Hugo Santos",