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
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <fs_index.h>
|
||||
#include <Locale.h>
|
||||
#include <Path.h>
|
||||
#include <Roster.h>
|
||||
#include <Screen.h>
|
||||
#include <Volume.h>
|
||||
#include <VolumeRoster.h>
|
||||
@@ -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<char**>(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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user