Ticket #7275: mediaplayer-about-update.patch
File mediaplayer-about-update.patch, 4.6 KB (added by , 13 years ago) |
---|
-
src/apps/mediaplayer/MainWin.cpp
34 34 #include <Debug.h> 35 35 #include <fs_attr.h> 36 36 #include <Language.h> 37 #include <Locale.h>38 37 #include <Menu.h> 39 38 #include <MenuBar.h> 40 39 #include <MenuItem.h> … … 65 64 #define B_TRANSLATE_CONTEXT "MediaPlayer-Main" 66 65 #define MIN_WIDTH 250 67 66 67 extern const char* PLAYER_NAME; 68 68 69 69 int MainWin::sNoVideoWidth = MIN_WIDTH; 70 70 … … 172 172 173 173 MainWin::MainWin(bool isFirstWindow, BMessage* message) 174 174 : 175 BWindow(BRect(100, 100, 400, 300), NAME, B_TITLED_WINDOW,175 BWindow(BRect(100, 100, 400, 300), PLAYER_NAME, B_TITLED_WINDOW, 176 176 B_ASYNCHRONOUS_CONTROLS /* | B_WILL_ACCEPT_FIRST_CLICK */), 177 177 fCreationTime(system_time()), 178 178 fInfoWin(NULL), … … 1082 1082 if (ret != B_OK) { 1083 1083 fprintf(stderr, "MainWin::OpenPlaylistItem() - Failed to send message " 1084 1084 "to Controller.\n"); 1085 (new BAlert(B_TRANSLATE("error"), 1086 B_TRANSLATE(NAME" encountered an internal error. " 1087 "The file could not be opened."), B_TRANSLATE("OK")))->Go(); 1085 BString errorText(PLAYER_NAME); 1086 errorText << B_TRANSLATE(" encountered an internal error. " 1087 "The file could not be opened."); 1088 errorText << "\n"; 1089 (new BAlert(B_TRANSLATE("Error"), errorText.String(), 1090 B_TRANSLATE("OK")))->Go(); 1088 1091 _PlaylistItemOpened(item, ret); 1089 1092 } else { 1090 1093 BString string; … … 1346 1349 fHasFile = false; 1347 1350 fHasVideo = false; 1348 1351 fHasAudio = false; 1349 SetTitle( NAME);1352 SetTitle(PLAYER_NAME); 1350 1353 } else { 1351 1354 fHasFile = true; 1352 1355 fHasVideo = fController->VideoTrackCount() != 0; … … 1418 1421 void 1419 1422 MainWin::_CreateMenu() 1420 1423 { 1421 fFileMenu = new BMenu( NAME);1424 fFileMenu = new BMenu(PLAYER_NAME); 1422 1425 fPlaylistMenu = new BMenu(B_TRANSLATE("Playlist"B_UTF8_ELLIPSIS)); 1423 1426 fAudioMenu = new BMenu(B_TRANSLATE("Audio")); 1424 1427 fVideoMenu = new BMenu(B_TRANSLATE("Video")); … … 1471 1474 1472 1475 fFileMenu->AddSeparatorItem(); 1473 1476 1474 item = new BMenuItem(B_TRANSLATE("About " NAME B_UTF8_ELLIPSIS), 1477 BString aboutText(B_TRANSLATE("About %1%2")); 1478 aboutText.ReplaceFirst("%1", PLAYER_NAME); 1479 aboutText.ReplaceFirst("%2", B_UTF8_ELLIPSIS); 1480 item = new BMenuItem(aboutText.String(), 1475 1481 new BMessage(B_ABOUT_REQUESTED)); 1476 1482 fFileMenu->AddItem(item); 1477 1483 item->SetTarget(be_app); -
src/apps/mediaplayer/MainApp.cpp
27 27 #include <Catalog.h> 28 28 #include <Entry.h> 29 29 #include <FilePanel.h> 30 #include <Locale.h>31 30 #include <MediaDefs.h> 32 31 #include <MediaRoster.h> 33 32 #include <MimeType.h> 34 33 #include <Path.h> 35 34 #include <Resources.h> 36 35 #include <Roster.h> 36 #include <TextView.h> 37 37 38 38 #include <stdio.h> 39 39 #include <stdlib.h> … … 48 48 #undef B_TRANSLATE_CONTEXT 49 49 #define B_TRANSLATE_CONTEXT "MediaPlayer-Main" 50 50 51 52 51 static const char* kCurrentPlaylistFilename = 53 52 B_TRANSLATE("MediaPlayer Current Playlist"); 54 53 55 54 const char* kAppSig = "application/x-vnd.Haiku-MediaPlayer"; 55 const char* PLAYER_NAME = B_TRANSLATE("MediaPlayer"); 56 56 57 57 MainApp* gMainApp; 58 58 … … 411 411 void 412 412 MainApp::AboutRequested() 413 413 { 414 BAlert* alert = new BAlert("about", B_TRANSLATE( 415 NAME"\n\nWritten by Marcus Overhagen, " 416 "Stephan Aßmus and Frederik Modéen"), 417 B_TRANSLATE("Thanks")); 414 BString aboutText(PLAYER_NAME); 415 aboutText << "\n\n"; 416 aboutText << B_TRANSLATE("Written by Marcus Overhagen, " 417 "Stephan Aßmus and Frederik Modéen\n"); 418 BAlert* alert = new BAlert(B_TRANSLATE("About"), 419 aboutText.String(), B_TRANSLATE("Thanks")); 420 BTextView* view = alert->TextView(); 421 BFont font; 422 423 view->SetStylable(true); 424 425 view->GetFont(&font); 426 font.SetSize(18); 427 font.SetFace(B_BOLD_FACE); 428 view->SetFontAndColor(0, strlen(PLAYER_NAME), &font); 418 429 alert->SetFeel(B_FLOATING_ALL_WINDOW_FEEL); 419 430 // Make sure it is on top of any player windows that may have the 420 431 // floating all window feel. -
src/apps/mediaplayer/MainApp.h
27 27 28 28 #include "MainWin.h" 29 29 30 31 30 enum { 32 31 M_NEW_PLAYER = 'nwpl', 33 32 M_PLAYER_QUIT = 'plqt', … … 53 52 }; 54 53 55 54 56 #define NAME "MediaPlayer"57 58 59 55 class BFilePanel; 60 56 class SettingsWindow; 61 57 … … 118 114 119 115 extern MainApp* gMainApp; 120 116 extern const char* kAppSig; 117 extern const char* PLAYER_NAME; 121 118 122 119 #endif // __MAIN_APP_H