From 6df0729855318b8c5b87d10feb32781c5562227e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 12 Feb 2011 22:15:38 +0000 Subject: [PATCH] Added "Configure attributes" item to Edit menu (?). This feature invokes FileTypes with the Person MIME type selected. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40473 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/people/PeopleApp.cpp | 21 +++++++++++++++++++++ src/apps/people/PeopleApp.h | 7 ++++--- src/apps/people/PersonWindow.cpp | 4 ++++ 3 files changed, 29 insertions(+), 3 deletions(-) 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) {