diff --git a/src/apps/people/Jamfile b/src/apps/people/Jamfile index 1e92ae6782..a5c34fcd3b 100644 --- a/src/apps/people/Jamfile +++ b/src/apps/people/Jamfile @@ -5,8 +5,8 @@ UsePrivateHeaders shared ; Application People : main.cpp AttributeTextControl.cpp PeopleApp.cpp - PeopleView.cpp - PeopleWindow.cpp + PersonView.cpp + PersonWindow.cpp : libbe.so libtracker.so $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS) : People.rdef ; @@ -15,6 +15,6 @@ DoCatalogs People : x-vnd.Be-PEPL : PeopleApp.cpp - PeopleView.cpp - PeopleWindow.cpp + PersonView.cpp + PersonWindow.cpp ; diff --git a/src/apps/people/People.rdef b/src/apps/people/People.rdef index c90b57bb71..e1c83097cf 100644 --- a/src/apps/people/People.rdef +++ b/src/apps/people/People.rdef @@ -10,7 +10,7 @@ resource app_version { internal = 0, short_info = "People", - long_info = "People ©1999 Be, Inc. ©2005-2009 Haiku, Inc." + long_info = "People ©1999 Be, Inc. ©2005-2011 Haiku, Inc." }; resource app_flags B_SINGLE_LAUNCH; diff --git a/src/apps/people/PeopleApp.cpp b/src/apps/people/PeopleApp.cpp index ba60fbb299..08ddc965be 100644 --- a/src/apps/people/PeopleApp.cpp +++ b/src/apps/people/PeopleApp.cpp @@ -12,6 +12,8 @@ */ +#include "PeopleApp.h" + #include #include #include @@ -25,8 +27,7 @@ #include #include -#include "PeopleApp.h" -#include "PeopleWindow.h" +#include "PersonWindow.h" #include "PersonIcons.h" #include @@ -250,7 +251,7 @@ TPeopleApp::RefsReceived(BMessage* message) entry_ref ref; message->FindRef("refs", index++, &ref); - TPeopleWindow* window = _FindWindow(ref); + PersonWindow* window = _FindWindow(ref); if (window != NULL) window->Activate(true); else { @@ -273,10 +274,10 @@ TPeopleApp::ReadyToRun() // #pragma mark - -TPeopleWindow* +PersonWindow* TPeopleApp::_NewWindow(entry_ref* ref) { - TPeopleWindow* window = new TPeopleWindow(fPosition, + PersonWindow* window = new PersonWindow(fPosition, B_TRANSLATE("New person"), kNameAttribute, kCategoryAttribute, ref); @@ -300,7 +301,7 @@ TPeopleApp::_NewWindow(entry_ref* ref) void -TPeopleApp::_AddAttributes(TPeopleWindow* window) const +TPeopleApp::_AddAttributes(PersonWindow* window) const { int32 count = fAttributes.CountItems(); for (int32 i = 0; i < count; i++) { @@ -314,11 +315,11 @@ TPeopleApp::_AddAttributes(TPeopleWindow* window) const } -TPeopleWindow* +PersonWindow* TPeopleApp::_FindWindow(const entry_ref& ref) const { for (int32 i = 0; BWindow* window = WindowAt(i); i++) { - TPeopleWindow* personWindow = dynamic_cast(window); + PersonWindow* personWindow = dynamic_cast(window); if (personWindow == NULL) continue; if (personWindow->RefersPersonFile(ref)) diff --git a/src/apps/people/PeopleApp.h b/src/apps/people/PeopleApp.h index 204125031c..b8c0634fc7 100644 --- a/src/apps/people/PeopleApp.h +++ b/src/apps/people/PeopleApp.h @@ -30,7 +30,7 @@ enum { M_WINDOW_QUITS = 'wndq' }; -class TPeopleWindow; +class PersonWindow; class TPeopleApp : public BApplication { public: @@ -44,9 +44,9 @@ public: virtual void ReadyToRun(); private: - TPeopleWindow* _FindWindow(const entry_ref&) const; - TPeopleWindow* _NewWindow(entry_ref* = NULL); - void _AddAttributes(TPeopleWindow* window) const; + PersonWindow* _FindWindow(const entry_ref&) const; + PersonWindow* _NewWindow(entry_ref* = NULL); + void _AddAttributes(PersonWindow* window) const; void _SavePreferences(BMessage* message) const; private: diff --git a/src/apps/people/PeopleView.cpp b/src/apps/people/PersonView.cpp similarity index 91% rename from src/apps/people/PeopleView.cpp rename to src/apps/people/PersonView.cpp index df97a4f0bf..f1e308c368 100644 --- a/src/apps/people/PeopleView.cpp +++ b/src/apps/people/PersonView.cpp @@ -11,7 +11,7 @@ */ -#include "PeopleView.h" +#include "PersonView.h" #include #include @@ -37,7 +37,7 @@ #define B_TRANSLATE_CONTEXT "People" -TPeopleView::TPeopleView(const char* name, const char* categoryAttribute, +PersonView::PersonView(const char* name, const char* categoryAttribute, const entry_ref *ref) : BGridView(), @@ -55,14 +55,14 @@ TPeopleView::TPeopleView(const char* name, const char* categoryAttribute, } -TPeopleView::~TPeopleView() +PersonView::~PersonView() { delete fFile; } void -TPeopleView::AddAttribute(const char* label, const char* attribute) +PersonView::AddAttribute(const char* label, const char* attribute) { // TODO: We could check if this attribute has already been added. @@ -95,7 +95,7 @@ TPeopleView::AddAttribute(const char* label, const char* attribute) void -TPeopleView::MakeFocus(bool focus) +PersonView::MakeFocus(bool focus) { if (focus && fControls.CountItems() > 0) fControls.ItemAt(0)->MakeFocus(); @@ -105,7 +105,7 @@ TPeopleView::MakeFocus(bool focus) void -TPeopleView::MessageReceived(BMessage* msg) +PersonView::MessageReceived(BMessage* msg) { switch (msg->what) { case M_SAVE: @@ -140,7 +140,7 @@ TPeopleView::MessageReceived(BMessage* msg) void -TPeopleView::BuildGroupMenu() +PersonView::BuildGroupMenu() { BMenuItem* item; while ((item = fGroups->ItemAt(0)) != NULL) { @@ -219,7 +219,7 @@ TPeopleView::BuildGroupMenu() void -TPeopleView::CreateFile(const entry_ref* ref) +PersonView::CreateFile(const entry_ref* ref) { delete fFile; fFile = new BFile(ref, B_READ_WRITE); @@ -228,7 +228,7 @@ TPeopleView::CreateFile(const entry_ref* ref) bool -TPeopleView::IsSaved() const +PersonView::IsSaved() const { for (int32 i = fControls.CountItems() - 1; i >= 0; i--) { if (fControls.ItemAt(i)->HasChanged()) @@ -240,7 +240,7 @@ TPeopleView::IsSaved() const void -TPeopleView::Save() +PersonView::Save() { int32 count = fControls.CountItems(); for (int32 i = 0; i < count; i++) { @@ -254,7 +254,7 @@ TPeopleView::Save() const char* -TPeopleView::AttributeValue(const char* attribute) const +PersonView::AttributeValue(const char* attribute) const { for (int32 i = fControls.CountItems() - 1; i >= 0; i--) { if (fControls.ItemAt(i)->Attribute() == attribute) @@ -266,7 +266,7 @@ TPeopleView::AttributeValue(const char* attribute) const void -TPeopleView::SetAttribute(const char* attribute, bool update) +PersonView::SetAttribute(const char* attribute, bool update) { char* value = NULL; attr_info info; @@ -282,7 +282,7 @@ TPeopleView::SetAttribute(const char* attribute, bool update) void -TPeopleView::SetAttribute(const char* attribute, const char* value, +PersonView::SetAttribute(const char* attribute, const char* value, bool update) { if (!LockLooper()) @@ -324,7 +324,7 @@ TPeopleView::SetAttribute(const char* attribute, const char* value, bool -TPeopleView::IsTextSelected() const +PersonView::IsTextSelected() const { for (int32 i = fControls.CountItems() - 1; i >= 0; i--) { BTextView* text = fControls.ItemAt(i)->TextView(); diff --git a/src/apps/people/PeopleView.h b/src/apps/people/PersonView.h similarity index 88% rename from src/apps/people/PeopleView.h rename to src/apps/people/PersonView.h index 47e8bffa50..1e4c703904 100644 --- a/src/apps/people/PeopleView.h +++ b/src/apps/people/PersonView.h @@ -9,8 +9,8 @@ * Copyright 1999, Be Incorporated. All Rights Reserved. * This file may be used under the terms of the Be Sample Code License. */ -#ifndef PEOPLE_VIEW_H -#define PEOPLE_VIEW_H +#ifndef PERSON_VIEW_H +#define PERSON_VIEW_H #include @@ -30,12 +30,12 @@ enum { }; -class TPeopleView : public BGridView { +class PersonView : public BGridView { public: - TPeopleView(const char* name, + PersonView(const char* name, const char* categoryAttribute, const entry_ref* ref); - virtual ~TPeopleView(); + virtual ~PersonView(); virtual void MakeFocus(bool focus = true); virtual void MessageReceived(BMessage* message); @@ -66,4 +66,4 @@ private: BString fCategoryAttribute; }; -#endif // PEOPLE_VIEW_H +#endif // PERSON_VIEW_H diff --git a/src/apps/people/PeopleWindow.cpp b/src/apps/people/PersonWindow.cpp similarity index 92% rename from src/apps/people/PeopleWindow.cpp rename to src/apps/people/PersonWindow.cpp index 03cab2e578..aa09e2c1ad 100644 --- a/src/apps/people/PeopleWindow.cpp +++ b/src/apps/people/PersonWindow.cpp @@ -10,7 +10,7 @@ * This file may be used under the terms of the Be Sample Code License. */ -#include "PeopleWindow.h" +#include "PersonWindow.h" #include #include @@ -34,14 +34,14 @@ #include #include "PeopleApp.h" -#include "PeopleView.h" +#include "PersonView.h" #undef B_TRANSLATE_CONTEXT #define B_TRANSLATE_CONTEXT "People" -TPeopleWindow::TPeopleWindow(BRect frame, const char* title, +PersonWindow::PersonWindow(BRect frame, const char* title, const char* nameAttribute, const char* categoryAttribute, const entry_ref* ref) : @@ -100,7 +100,7 @@ TPeopleWindow::TPeopleWindow(BRect frame, const char* title, } else _SetToRef(NULL); - fView = new TPeopleView("PeopleView", categoryAttribute, fRef); + fView = new PersonView("PeopleView", categoryAttribute, fRef); BLayoutBuilder::Group<>(this, B_VERTICAL, 0) .SetInsets(0, 0, 0, 0) @@ -112,14 +112,14 @@ TPeopleWindow::TPeopleWindow(BRect frame, const char* title, } -TPeopleWindow::~TPeopleWindow() +PersonWindow::~PersonWindow() { _SetToRef(NULL); } void -TPeopleWindow::MenusBeginning() +PersonWindow::MenusBeginning() { bool enabled = !fView->IsSaved(); fSave->SetEnabled(enabled); @@ -147,7 +147,7 @@ TPeopleWindow::MenusBeginning() void -TPeopleWindow::MessageReceived(BMessage* msg) +PersonWindow::MessageReceived(BMessage* msg) { char str[256]; BDirectory directory; @@ -263,7 +263,7 @@ TPeopleWindow::MessageReceived(BMessage* msg) bool -TPeopleWindow::QuitRequested() +PersonWindow::QuitRequested() { status_t result; @@ -296,7 +296,7 @@ TPeopleWindow::QuitRequested() void -TPeopleWindow::Show() +PersonWindow::Show() { fView->MakeFocus(); BWindow::Show(); @@ -304,14 +304,14 @@ TPeopleWindow::Show() void -TPeopleWindow::AddAttribute(const char* label, const char* attribute) +PersonWindow::AddAttribute(const char* label, const char* attribute) { fView->AddAttribute(label, attribute); } void -TPeopleWindow::SaveAs() +PersonWindow::SaveAs() { char name[B_FILE_NAME_LENGTH]; _GetDefaultFileName(name); @@ -346,7 +346,7 @@ TPeopleWindow::SaveAs() bool -TPeopleWindow::RefersPersonFile(const entry_ref& ref) const +PersonWindow::RefersPersonFile(const entry_ref& ref) const { if (fRef == NULL) return false; @@ -355,7 +355,7 @@ TPeopleWindow::RefersPersonFile(const entry_ref& ref) const void -TPeopleWindow::_GetDefaultFileName(char* name) +PersonWindow::_GetDefaultFileName(char* name) { strncpy(name, fView->AttributeValue(fNameAttribute), B_FILE_NAME_LENGTH); while (*name) { @@ -367,7 +367,7 @@ TPeopleWindow::_GetDefaultFileName(char* name) void -TPeopleWindow::_SetToRef(entry_ref* ref) +PersonWindow::_SetToRef(entry_ref* ref) { if (fRef != NULL) { _WatchChanges(false); @@ -381,7 +381,7 @@ TPeopleWindow::_SetToRef(entry_ref* ref) void -TPeopleWindow::_WatchChanges(bool enable) +PersonWindow::_WatchChanges(bool enable) { if (fRef == NULL) return; diff --git a/src/apps/people/PeopleWindow.h b/src/apps/people/PersonWindow.h similarity index 83% rename from src/apps/people/PeopleWindow.h rename to src/apps/people/PersonWindow.h index 48fd202ffd..c3e9a37519 100644 --- a/src/apps/people/PeopleWindow.h +++ b/src/apps/people/PersonWindow.h @@ -8,8 +8,8 @@ * Copyright 1999, Be Incorporated. All Rights Reserved. * This file may be used under the terms of the Be Sample Code License. */ -#ifndef PEOPLE_WINDOW_H -#define PEOPLE_WINDOW_H +#ifndef PERSON_WINDOW_H +#define PERSON_WINDOW_H #include @@ -21,19 +21,19 @@ #define WIND_HEIGHT 340 -class TPeopleView; +class PersonView; class BFilePanel; class BMenuItem; -class TPeopleWindow : public BWindow { +class PersonWindow : public BWindow { public: - TPeopleWindow(BRect frame, const char* title, + PersonWindow(BRect frame, const char* title, const char* nameAttribute, const char* categoryAttribute, const entry_ref* ref); - virtual ~TPeopleWindow(); + virtual ~PersonWindow(); virtual void MenusBeginning(); virtual void MessageReceived(BMessage* message); @@ -62,10 +62,10 @@ private: BMenuItem* fRevert; BMenuItem* fSave; BMenuItem* fUndo; - TPeopleView* fView; + PersonView* fView; BString fNameAttribute; }; -#endif // PEOPLE_WINDOW_H +#endif // PERSON_WINDOW_H diff --git a/src/apps/people/README b/src/apps/people/README deleted file mode 100644 index 99f56f0c18..0000000000 --- a/src/apps/people/README +++ /dev/null @@ -1,15 +0,0 @@ -People -- README - -This directory contains the source code for building -the standard People application that ships with BeOS. -You can use this application to create Person records, -which can be dropped into BeMail headers (see the -BeOS User's Guide Chap. 4: Sending Mail) and other -applications. - -Ostensibly, this application reveals how the Person -record is stored, but it also demonstrates how to -use the BeOS file type database in an application. - -Owen Smith -July 1998 \ No newline at end of file