style tab cleanup; start using classy kMsg style BMessage vars; no functional change

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40599 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander von Gluck IV
2011-02-21 16:02:17 +00:00
parent 03683e642c
commit cdd15f8478
2 changed files with 58 additions and 63 deletions
@@ -35,7 +35,7 @@ NetworkSetupWindow::NetworkSetupWindow(const char *title)
{ {
// ---- Profiles section // ---- Profiles section
BMenu *profilesPopup = new BPopUpMenu("<none>"); BMenu *profilesPopup = new BPopUpMenu("<none>");
_BuildProfilesMenu(profilesPopup, SELECT_PROFILE_MSG); _BuildProfilesMenu(profilesPopup, kMsgProfileSelected);
BMenuField *profilesMenuField = new BMenuField("profiles_menu", BMenuField *profilesMenuField = new BMenuField("profiles_menu",
B_TRANSLATE("Profile:"), profilesPopup); B_TRANSLATE("Profile:"), profilesPopup);
@@ -51,10 +51,10 @@ NetworkSetupWindow::NetworkSetupWindow(const char *title)
bottomDivider->SetBorder(B_PLAIN_BORDER); bottomDivider->SetBorder(B_PLAIN_BORDER);
fApplyButton = new BButton("apply", B_TRANSLATE("Apply"), fApplyButton = new BButton("apply", B_TRANSLATE("Apply"),
new BMessage(APPLY_NOW_MSG)); new BMessage(kMsgApply));
fRevertButton = new BButton("revert", B_TRANSLATE("Revert"), fRevertButton = new BButton("revert", B_TRANSLATE("Revert"),
new BMessage(REVERT_MSG)); new BMessage(kMsgRevert));
fRevertButton->SetEnabled(false); fRevertButton->SetEnabled(false);
// Enable boxes resizing modes // Enable boxes resizing modes
@@ -78,7 +78,7 @@ NetworkSetupWindow::NetworkSetupWindow(const char *title)
.SetInsets(10, 10, 10, 10) .SetInsets(10, 10, 10, 10)
); );
_BuildShowTabView(SHOW_MSG); _BuildShowTabView(kMsgAddonShow);
bottomDivider->SetExplicitMaxSize(BSize(B_SIZE_UNSET, 1)); bottomDivider->SetExplicitMaxSize(BSize(B_SIZE_UNSET, 1));
fPanel->SetExplicitMinSize(BSize(fMinAddonViewRect.Width(), fPanel->SetExplicitMinSize(BSize(fMinAddonViewRect.Width(),
@@ -107,11 +107,10 @@ void
NetworkSetupWindow::MessageReceived(BMessage* msg) NetworkSetupWindow::MessageReceived(BMessage* msg)
{ {
switch (msg->what) { switch (msg->what) {
case kMsgProfileNew:
case NEW_PROFILE_MSG:
break; break;
case SELECT_PROFILE_MSG: { case kMsgProfileSelected: {
BPath name; BPath name;
const char *path; const char *path;
bool is_default; bool is_default;
@@ -129,7 +128,7 @@ NetworkSetupWindow::MessageReceived(BMessage* msg)
break; break;
} }
case SHOW_MSG: { case kMsgAddonShow: {
if (fAddonView) if (fAddonView)
fAddonView->RemoveSelf(); fAddonView->RemoveSelf();
@@ -193,9 +192,9 @@ NetworkSetupWindow::_BuildProfilesMenu(BMenu* menu, int32 msg_what)
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(B_TRANSLATE("New" B_UTF8_ELLIPSIS), menu->AddItem(new BMenuItem(B_TRANSLATE("New" B_UTF8_ELLIPSIS),
new BMessage(NEW_PROFILE_MSG))); new BMessage(kMsgProfileNew)));
menu->AddItem(new BMenuItem(B_TRANSLATE("Manage" B_UTF8_ELLIPSIS), menu->AddItem(new BMenuItem(B_TRANSLATE("Manage" B_UTF8_ELLIPSIS),
new BMessage(MANAGE_PROFILES_MSG))); new BMessage(kMsgProfileManage)));
if (strlen(current_profile)) { if (strlen(current_profile)) {
item = menu->FindItem(current_profile); item = menu->FindItem(current_profile);
@@ -23,18 +23,12 @@ class NetworkSetupWindow : public BWindow
typedef BWindow inherited; typedef BWindow inherited;
enum { static const uint32 kMsgAddonShow = 'show';
SELECT_PROFILE_MSG = 'prof', static const uint32 kMsgProfileSelected = 'prof';
MANAGE_PROFILES_MSG = 'mngp', static const uint32 kMsgProfileManage = 'mngp';
NEW_PROFILE_MSG = 'newp', static const uint32 kMsgProfileNew = 'newp';
COPY_PROFILE_MSG = 'cpyp', static const uint32 kMsgApply = 'aply';
DELETE_PROFILE_MSG = 'delp', static const uint32 kMsgRevert = 'rvrt';
SHOW_MSG = 'show',
HELP_MSG = 'help',
DONT_TOUCH_MSG = 'lock',
APPLY_NOW_MSG = 'aply',
REVERT_MSG = 'rvrt'
};
bool QuitRequested(); bool QuitRequested();
void MessageReceived(BMessage* msg); void MessageReceived(BMessage* msg);
@@ -52,4 +46,6 @@ class NetworkSetupWindow : public BWindow
BRect fMinAddonViewRect; BRect fMinAddonViewRect;
}; };
#endif // ifdef NETWORKSETUPWINDOW_H #endif // ifdef NETWORKSETUPWINDOW_H