Author: stippi Date: 2010-09-10 12:07:13 +0200 (Fri, 10 Sep 2010) New Revision: 38596 Changeset: http://dev.haiku-os.org/changeset/38596 Modified: haiku/trunk/src/apps/mediaplayer/MainApp.cpp haiku/trunk/src/apps/mediaplayer/MainApp.h haiku/trunk/src/apps/mediaplayer/MainWin.cpp Log: 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. Modified: haiku/trunk/src/apps/mediaplayer/MainApp.cpp =================================================================== --- haiku/trunk/src/apps/mediaplayer/MainApp.cpp 2010-09-10 01:41:29 UTC (rev 38595) +++ haiku/trunk/src/apps/mediaplayer/MainApp.cpp 2010-09-10 10:07:13 UTC (rev 38596) @@ -273,6 +273,13 @@ 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 Modified: haiku/trunk/src/apps/mediaplayer/MainApp.h =================================================================== --- haiku/trunk/src/apps/mediaplayer/MainApp.h 2010-09-10 01:41:29 UTC (rev 38595) +++ haiku/trunk/src/apps/mediaplayer/MainApp.h 2010-09-10 10:07:13 UTC (rev 38596) @@ -29,6 +29,7 @@ enum { + M_NEW_PLAYER = 'nwpl', M_PLAYER_QUIT = 'plqt', M_SETTINGS = 'stng', Modified: haiku/trunk/src/apps/mediaplayer/MainWin.cpp =================================================================== --- haiku/trunk/src/apps/mediaplayer/MainWin.cpp 2010-09-10 01:41:29 UTC (rev 38595) +++ haiku/trunk/src/apps/mediaplayer/MainWin.cpp 2010-09-10 10:07:13 UTC (rev 38596) @@ -68,7 +68,6 @@ enum { M_DUMMY = 0x100, M_FILE_OPEN = 0x1000, - M_FILE_NEWPLAYER, M_FILE_INFO, M_FILE_PLAYLIST, M_FILE_CLOSE, @@ -700,9 +699,6 @@ } // menu item messages - case M_FILE_NEWPLAYER: - gMainApp->NewWindow(); - break; case M_FILE_OPEN: { BMessenger target(this); @@ -1364,8 +1360,10 @@ 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 @@ #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);