New player windows returned from NewWindow() are not

automatically shown anymore since the playlist restore
changes. Unbreak opening a new player, let the application
thread open it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38596 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-09-10 10:07:13 +00:00
parent 8f25594c11
commit 811aedf9c2
3 changed files with 13 additions and 7 deletions

View File

@ -273,6 +273,13 @@ void
MainApp::MessageReceived(BMessage* message)
{
switch (message->what) {
case M_NEW_PLAYER:
{
MainWin* window = NewWindow();
if (window != NULL)
window->Show();
break;
}
case M_PLAYER_QUIT:
{
// store the window settings of this instance

View File

@ -29,6 +29,7 @@
enum {
M_NEW_PLAYER = 'nwpl',
M_PLAYER_QUIT = 'plqt',
M_SETTINGS = 'stng',

View File

@ -68,7 +68,6 @@ int MainWin::sNoVideoWidth = MIN_WIDTH;
enum {
M_DUMMY = 0x100,
M_FILE_OPEN = 0x1000,
M_FILE_NEWPLAYER,
M_FILE_INFO,
M_FILE_PLAYLIST,
M_FILE_CLOSE,
@ -700,9 +699,6 @@ MainWin::MessageReceived(BMessage* msg)
}
// menu item messages
case M_FILE_NEWPLAYER:
gMainApp->NewWindow();
break;
case M_FILE_OPEN:
{
BMessenger target(this);
@ -1364,8 +1360,10 @@ MainWin::_CreateMenu()
fMenuBar->AddItem(fVideoMenu);
fMenuBar->AddItem(fSettingsMenu);
fFileMenu->AddItem(new BMenuItem("New player"B_UTF8_ELLIPSIS,
new BMessage(M_FILE_NEWPLAYER), 'N'));
BMenuItem* item = new BMenuItem("New player"B_UTF8_ELLIPSIS,
new BMessage(M_NEW_PLAYER), 'N');
fFileMenu->AddItem(item);
item->SetTarget(be_app);
fFileMenu->AddSeparatorItem();
#if 0
@ -1375,7 +1373,7 @@ MainWin::_CreateMenu()
#else
// Add recent files to "Open File" entry as sub-menu.
BRecentFilesList recentFiles(10, false, NULL, kAppSig);
BMenuItem* item = new BMenuItem(recentFiles.NewFileListMenu(
item = new BMenuItem(recentFiles.NewFileListMenu(
"Open file"B_UTF8_ELLIPSIS, new BMessage(B_REFS_RECEIVED),
NULL, this, 10, false, NULL, 0, kAppSig), new BMessage(M_FILE_OPEN));
item->SetShortcut('O', 0);