Fixed some bugs. Setting a default interface now actually works, but the functionality is hidden because we do not yet have kernel-side IPCP support for ConnectOnDemand (COD).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10690 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2004, Waldemar Kornewald <[email protected]>
|
||||
* Copyright 2003-2005, Waldemar Kornewald <[email protected]>
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
@@ -226,6 +226,9 @@ DialUpView::AttachedToWindow()
|
||||
fInterfaceMenu->SetTargetForItems(this);
|
||||
fCreateNewButton->SetTarget(this);
|
||||
fConnectButton->SetTarget(this);
|
||||
fDefaultInterface->SetTarget(this);
|
||||
fDefaultInterface->Hide();
|
||||
// TODO: remove this when we have full COD support
|
||||
|
||||
if(fListener.InitCheck() != B_OK) {
|
||||
(new BAlert(kErrorTitle, kErrorNoPPPStack, kLabelOK,
|
||||
@@ -675,9 +678,10 @@ DialUpView::FindInterface(const char *name)
|
||||
return NULL;
|
||||
|
||||
BMenuItem *item;
|
||||
for(int32 index = 0; index < fInterfaceMenu->CountItems(); index++) {
|
||||
for(int32 index = 0; index < CountInterfaces(); index++) {
|
||||
item = fInterfaceMenu->ItemAt(index);
|
||||
if(item && !strcmp(item->Message()->FindString("name"), name))
|
||||
if(item && item->Message() && item->Message()->HasString("name")
|
||||
&& !strcmp(item->Message()->FindString("name"), name))
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2004, Waldemar Kornewald <[email protected]>
|
||||
* Copyright 2003-2005, Waldemar Kornewald <[email protected]>
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
@@ -414,12 +414,7 @@ GeneralView::GeneralView(GeneralAddon *addon, BRect frame)
|
||||
fAuthenticationBox->SetLabel(fAuthenticatorField);
|
||||
|
||||
rect = fAuthenticationBox->Bounds();
|
||||
rect.InsetBy(10, 5);
|
||||
rect.top = 25;
|
||||
BView *authenticationView = new BView(rect, "authenticationView",
|
||||
B_FOLLOW_NONE, 0);
|
||||
authenticationView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
rect = authenticationView->Bounds();
|
||||
rect.InsetBy(10, 25);
|
||||
rect.bottom = rect.top + 20;
|
||||
fUsername = new BTextControl(rect, "username", kLabelName, NULL, NULL);
|
||||
rect.top = rect.bottom + 5;
|
||||
@@ -437,10 +432,9 @@ GeneralView::GeneralView(GeneralAddon *addon, BRect frame)
|
||||
rect.bottom = rect.top + 20;
|
||||
fSavePassword = new BCheckBox(rect, "SavePassword", kLabelSavePassword, NULL);
|
||||
|
||||
authenticationView->AddChild(fUsername);
|
||||
authenticationView->AddChild(fPassword);
|
||||
authenticationView->AddChild(fSavePassword);
|
||||
fAuthenticationBox->AddChild(authenticationView);
|
||||
fAuthenticationBox->AddChild(fUsername);
|
||||
fAuthenticationBox->AddChild(fPassword);
|
||||
fAuthenticationBox->AddChild(fSavePassword);
|
||||
|
||||
AddChild(fDeviceBox);
|
||||
AddChild(fAuthenticationBox);
|
||||
|
||||
@@ -49,7 +49,7 @@ PTPSettings::SetDefaultInterface(const char *name)
|
||||
// load current settings and replace value of "default" with <name>
|
||||
BMessage settings;
|
||||
if(!ReadMessageDriverSettings("ptpnet.settings", &settings))
|
||||
return false;
|
||||
settings.MakeEmpty();
|
||||
|
||||
BMessage parameter;
|
||||
int32 index = 0;
|
||||
@@ -58,6 +58,7 @@ PTPSettings::SetDefaultInterface(const char *name)
|
||||
|
||||
parameter.MakeEmpty();
|
||||
if(name) {
|
||||
parameter.AddString(MDSU_NAME, "default");
|
||||
parameter.AddString(MDSU_VALUES, name);
|
||||
settings.AddMessage(MDSU_PARAMETERS, ¶meter);
|
||||
}
|
||||
@@ -273,6 +274,5 @@ PTPSettings::LoadAddons(bool loadGeneralAddon = true)
|
||||
fAddons.AddMessage(DUN_AUTHENTICATOR_ADDON_TYPE, &addon);
|
||||
// addon.MakeEmpty(); // for next authenticator
|
||||
|
||||
// TODO:
|
||||
// load all add-ons from the add-ons folder
|
||||
// TODO: load all add-ons from the add-ons folder
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user