* Renamed settings.{cpp|h} to Settings.*.
* Got rid of some superfluous Get*() in method names. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33996 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "EthernetSettingsView.h"
|
#include "EthernetSettingsView.h"
|
||||||
#include "settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
@@ -295,13 +295,13 @@ EthernetSettingsView::_ShowConfiguration(Settings* settings)
|
|||||||
|
|
||||||
if (settings) {
|
if (settings) {
|
||||||
BMenuItem* item = fDeviceMenuField->Menu()->FindItem(
|
BMenuItem* item = fDeviceMenuField->Menu()->FindItem(
|
||||||
settings->GetName());
|
settings->Name());
|
||||||
if (item)
|
if (item)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
|
|
||||||
fIPTextControl->SetText(settings->GetIP());
|
fIPTextControl->SetText(settings->IP());
|
||||||
fGatewayTextControl->SetText(settings->GetGateway());
|
fGatewayTextControl->SetText(settings->Gateway());
|
||||||
fNetMaskTextControl->SetText(settings->GetNetmask());
|
fNetMaskTextControl->SetText(settings->Netmask());
|
||||||
|
|
||||||
if (settings->AutoConfigure() == true)
|
if (settings->AutoConfigure() == true)
|
||||||
item = fTypeMenuField->Menu()->FindItem("DHCP");
|
item = fTypeMenuField->Menu()->FindItem("DHCP");
|
||||||
@@ -369,7 +369,7 @@ EthernetSettingsView::_SaveConfiguration()
|
|||||||
_SaveDNSConfiguration();
|
_SaveDNSConfiguration();
|
||||||
_SaveAdaptersConfiguration();
|
_SaveAdaptersConfiguration();
|
||||||
if (fCurrentSettings->AutoConfigure())
|
if (fCurrentSettings->AutoConfigure())
|
||||||
_TriggerAutoConfig(fCurrentSettings->GetName());
|
_TriggerAutoConfig(fCurrentSettings->Name());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -431,14 +431,14 @@ EthernetSettingsView::_SaveAdaptersConfiguration()
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(fp, "interface %s {\n\t\taddress {\n",
|
fprintf(fp, "interface %s {\n\t\taddress {\n",
|
||||||
fSettings.ItemAt(i)->GetName());
|
fSettings.ItemAt(i)->Name());
|
||||||
fprintf(fp, "\t\t\tfamily\tinet\n");
|
fprintf(fp, "\t\t\tfamily\tinet\n");
|
||||||
fprintf(fp, "\t\t\taddress\t%s\n",
|
fprintf(fp, "\t\t\taddress\t%s\n",
|
||||||
fSettings.ItemAt(i)->GetIP());
|
fSettings.ItemAt(i)->IP());
|
||||||
fprintf(fp, "\t\t\tgateway\t%s\n",
|
fprintf(fp, "\t\t\tgateway\t%s\n",
|
||||||
fSettings.ItemAt(i)->GetGateway());
|
fSettings.ItemAt(i)->Gateway());
|
||||||
fprintf(fp, "\t\t\tmask\t%s\n",
|
fprintf(fp, "\t\t\tmask\t%s\n",
|
||||||
fSettings.ItemAt(i)->GetNetmask());
|
fSettings.ItemAt(i)->Netmask());
|
||||||
fprintf(fp, "\t\t}\n}\n\n");
|
fprintf(fp, "\t\t}\n}\n\n");
|
||||||
}
|
}
|
||||||
if (fp) {
|
if (fp) {
|
||||||
@@ -550,7 +550,7 @@ EthernetSettingsView::MessageReceived(BMessage* message)
|
|||||||
break;
|
break;
|
||||||
for (int32 i = 0; i < fSettings.CountItems(); i++) {
|
for (int32 i = 0; i < fSettings.CountItems(); i++) {
|
||||||
Settings* settings = fSettings.ItemAt(i);
|
Settings* settings = fSettings.ItemAt(i);
|
||||||
if (strcmp(settings->GetName(), name) == 0) {
|
if (strcmp(settings->Name(), name) == 0) {
|
||||||
_ShowConfiguration(settings);
|
_ShowConfiguration(settings);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-2007 Haiku Inc. All rights reserved.
|
* Copyright 2004-2009 Haiku Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Author:
|
* Author:
|
||||||
@@ -11,29 +11,29 @@
|
|||||||
#define ETHERNET_SETTINGS_VIEW_H
|
#define ETHERNET_SETTINGS_VIEW_H
|
||||||
|
|
||||||
|
|
||||||
#include "settings.h"
|
|
||||||
|
|
||||||
#include <ObjectList.h>
|
#include <ObjectList.h>
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
|
|
||||||
#include <posix/regex.h>
|
#include <posix/regex.h>
|
||||||
|
|
||||||
|
|
||||||
class BButton;
|
class BButton;
|
||||||
class BMenuField;
|
class BMenuField;
|
||||||
class BPath;
|
class BPath;
|
||||||
class BTextControl;
|
class BTextControl;
|
||||||
class BStringView;
|
class BStringView;
|
||||||
|
class Settings;
|
||||||
|
|
||||||
|
|
||||||
class EthernetSettingsView : public BView {
|
class EthernetSettingsView : public BView {
|
||||||
public:
|
public:
|
||||||
EthernetSettingsView();
|
EthernetSettingsView();
|
||||||
virtual ~EthernetSettingsView();
|
virtual ~EthernetSettingsView();
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
virtual void DetachedFromWindow();
|
virtual void DetachedFromWindow();
|
||||||
|
|
||||||
void SaveProfile(BString profileName);
|
void SaveProfile(BString profileName);
|
||||||
void LoadProfile(BString profileName);
|
void LoadProfile(BString profileName);
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ private:
|
|||||||
|
|
||||||
bool _ValidateControl(BTextControl* control);
|
bool _ValidateControl(BTextControl* control);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
BButton* fApplyButton;
|
BButton* fApplyButton;
|
||||||
BButton* fRevertButton;
|
BButton* fRevertButton;
|
||||||
// TODO: buttons should be moved to window instead
|
// TODO: buttons should be moved to window instead
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ Preference Network :
|
|||||||
NetworkApp.cpp
|
NetworkApp.cpp
|
||||||
NetworkWindow.cpp
|
NetworkWindow.cpp
|
||||||
EthernetSettingsView.cpp
|
EthernetSettingsView.cpp
|
||||||
settings.cpp
|
Settings.cpp
|
||||||
: be root $(HAIKU_NETWORK_LIBS) $(TARGET_LIBSUPC++)
|
|
||||||
: Network.rdef
|
|
||||||
;
|
|
||||||
|
|
||||||
|
: be $(HAIKU_NETWORK_LIBS) $(TARGET_LIBSUPC++)
|
||||||
|
: Network.rdef
|
||||||
|
;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -24,10 +24,10 @@ public:
|
|||||||
void SetAutoConfigure(bool autoConfigure)
|
void SetAutoConfigure(bool autoConfigure)
|
||||||
{ fAuto = autoConfigure; }
|
{ fAuto = autoConfigure; }
|
||||||
|
|
||||||
const char* GetIP() { return fIP.String(); }
|
const char* IP() { return fIP.String(); }
|
||||||
const char* GetGateway() { return fGateway.String(); }
|
const char* Gateway() { return fGateway.String(); }
|
||||||
const char* GetNetmask() { return fNetmask.String(); }
|
const char* Netmask() { return fNetmask.String(); }
|
||||||
const char* GetName() { return fName.String(); }
|
const char* Name() { return fName.String(); }
|
||||||
bool AutoConfigure() { return fAuto; }
|
bool AutoConfigure() { return fAuto; }
|
||||||
|
|
||||||
BObjectList<BString>& NameServers() { return fNameServers; }
|
BObjectList<BString>& NameServers() { return fNameServers; }
|
||||||
Reference in New Issue
Block a user