diff --git a/source/CommandIDs.h b/source/CommandIDs.h index ce0a4ad..e799eb0 100644 --- a/source/CommandIDs.h +++ b/source/CommandIDs.h @@ -15,6 +15,7 @@ enum { MSG_FILE_OPEN = 'mOpn', + MSG_FILE_NEW = 'mNew', MSG_FILE_RELOAD = 'mRld', MSG_FILE_QUIT = 'mQit', MSG_FILE_DROPPED = 'mDrp', diff --git a/source/DiffWindow.cpp b/source/DiffWindow.cpp index 6f4a117..e0ef967 100644 --- a/source/DiffWindow.cpp +++ b/source/DiffWindow.cpp @@ -135,6 +135,12 @@ DiffWindow::MessageReceived(BMessage* message) } } break; + case MSG_FILE_NEW: + { + message->what = MSG_FILE_OPEN; + message->AddMessenger("killme", BMessenger(this)); + } // intentional fall-tru + case MSG_FILE_OPEN: { message->AddRect("window_frame", Frame()); @@ -204,6 +210,11 @@ DiffWindow::_CreateMainMenu(BMenuBar* menuBar) menuItem->SetTarget(this); fileMenu->AddItem(menuItem); + menuItem = new BMenuItem(B_TRANSLATE("Close and select files" B_UTF8_ELLIPSIS), + new BMessage(MSG_FILE_NEW), 'N'); + menuItem->SetTarget(this); + fileMenu->AddItem(menuItem); + menuItem = new BMenuItem(B_TRANSLATE("Switch files"), new BMessage(MSG_FILE_SWITCH), B_TAB); menuItem->SetTarget(this); fileMenu->AddItem(menuItem);