diff --git a/src/apps/people/PeopleApp.cpp b/src/apps/people/PeopleApp.cpp index 08ddc965be..0f0be2b9f2 100644 --- a/src/apps/people/PeopleApp.cpp +++ b/src/apps/people/PeopleApp.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -237,6 +238,26 @@ TPeopleApp::MessageReceived(BMessage* message) PostMessage(B_QUIT_REQUESTED); break; + case M_CONFIGURE_ATTRIBUTES: + { + const char* arguments[] = { "-type", B_PERSON_MIMETYPE, 0 }; + status_t ret = be_roster->Launch( + "application/x-vnd.Haiku-FileTypes", + sizeof(arguments) / sizeof(const char*) - 1, + const_cast(arguments)); + if (ret != B_OK && ret != B_ALREADY_RUNNING) { + BString errorMsg(B_TRANSLATE("Launching the FileTypes " + "preflet to configure Person attributes has failed." + "\n\nError: ")); + errorMsg << strerror(ret); + BAlert* alert = new BAlert(B_TRANSLATE("Error"), + errorMsg.String(), B_TRANSLATE("OK"), NULL, NULL, + B_WIDTH_AS_USUAL, B_STOP_ALERT); + alert->Go(NULL); + } + break; + } + default: BApplication::MessageReceived(message); } diff --git a/src/apps/people/PeopleApp.h b/src/apps/people/PeopleApp.h index b8c0634fc7..9af0544225 100644 --- a/src/apps/people/PeopleApp.h +++ b/src/apps/people/PeopleApp.h @@ -25,9 +25,10 @@ class BFile; enum { - M_NEW = 'newp', - M_SAVE_AS = 'svas', - M_WINDOW_QUITS = 'wndq' + M_NEW = 'newp', + M_SAVE_AS = 'svas', + M_WINDOW_QUITS = 'wndq', + M_CONFIGURE_ATTRIBUTES = 'catr' }; class PersonWindow; diff --git a/src/apps/people/PersonWindow.cpp b/src/apps/people/PersonWindow.cpp index aa09e2c1ad..4160a6283e 100644 --- a/src/apps/people/PersonWindow.cpp +++ b/src/apps/people/PersonWindow.cpp @@ -92,6 +92,10 @@ PersonWindow::PersonWindow(BRect frame, const char* title, BMenuItem* selectAllItem = new BMenuItem(B_TRANSLATE("Select all"), new BMessage(M_SELECT), 'A'); menu->AddItem(selectAllItem); + menu->AddSeparatorItem(); + menu->AddItem(item = new BMenuItem(B_TRANSLATE("Configure attributes"), + new BMessage(M_CONFIGURE_ATTRIBUTES), 'F')); + item->SetTarget(be_app); menuBar->AddItem(menu); if (ref != NULL) {