Ticket #7271: tv.diff
File tv.diff, 5.7 KB (added by , 13 years ago) |
---|
-
src/apps/tv/MainWin.cpp
22 22 * OTHER DEALINGS IN THE SOFTWARE. 23 23 */ 24 24 25 #include "MainWin.h"26 #include "MainApp.h"27 25 #include "Controller.h" 28 #include "config.h"29 26 #include "DeviceRoster.h" 27 #include "MainApp.h" 28 #include "MainWin.h" 30 29 31 30 #include <stdio.h> 32 31 #include <string.h> 33 32 34 #include <Application.h>35 33 #include <Alert.h> 34 #include <Application.h> 35 #include <Catalog.h> 36 #include <Font.h> 36 37 #include <Menu.h> 37 38 #include <MenuBar.h> 38 39 #include <MenuItem.h> … … 40 41 #include <PopUpMenu.h> 41 42 #include <Screen.h> 42 43 #include <String.h> 44 #include <TextView.h> 43 45 #include <View.h> 44 46 45 47 46 48 #undef B_TRANSLATE_CONTEXT 47 49 #define B_TRANSLATE_CONTEXT "MainWin" 48 50 49 static const char* fLocalizedName = B_TRANSLATE_MARK("TV");50 static const char* fLocalizedRevision = B_TRANSLATE_MARK("unknown");51 static const char* fLocalizedInfo1 = B_TRANSLATE_MARK("DVB - Digital Video Broadcasting TV");52 51 53 52 enum 54 53 { … … 85 84 86 85 87 86 MainWin::MainWin(BRect frame_rect) 88 : BWindow(frame_rect, NAME, B_TITLED_WINDOW,87 : BWindow(frame_rect, B_TRANSLATE("TV"), B_TITLED_WINDOW, 89 88 B_ASYNCHRONOUS_CONTROLS /* | B_WILL_ACCEPT_FIRST_CLICK */) 90 89 , fController(new Controller) 91 90 , fIsFullscreen(false) … … 162 161 void 163 162 MainWin::CreateMenu() 164 163 { 165 fFileMenu = new BMenu( NAME);164 fFileMenu = new BMenu(B_TRANSLATE("TV")); 166 165 fChannelMenu = new BMenu(B_TRANSLATE("Channel")); 167 166 fInterfaceMenu = new BMenu(B_TRANSLATE("Interface")); 168 167 fSettingsMenu = new BMenu(B_TRANSLATE("Settings")); … … 174 173 fMenuBar->AddItem(fSettingsMenu); 175 174 fMenuBar->AddItem(fDebugMenu); 176 175 177 BString aboutStr = B_TRANSLATE_COMMENT("About %1"B_UTF8_ELLIPSIS, 178 "Parameter %1 is the name of the application."); 179 aboutStr.ReplaceFirst("%1", fLocalizedName); 180 fFileMenu->AddItem(new BMenuItem(aboutStr.String(), 176 fFileMenu->AddItem(new BMenuItem(B_TRANSLATE("About TV"B_UTF8_ELLIPSIS), 181 177 new BMessage(M_FILE_ABOUT))); 182 178 fFileMenu->AddSeparatorItem(); 183 179 fFileMenu->AddItem(new BMenuItem(B_TRANSLATE("Quit"), … … 565 561 new BMessage(M_TOGGLE_KEEP_ASPECT_RATIO), 'K', B_COMMAND_KEY)); 566 562 item->SetMarked(fKeepAspectRatio); 567 563 menu->AddSeparatorItem(); 568 BString aboutStr = B_TRANSLATE_COMMENT("About %1"B_UTF8_ELLIPSIS, 569 "Parameter %1 is the name of the application."); 570 aboutStr.ReplaceFirst("%1", fLocalizedName); 571 menu->AddItem(new BMenuItem(aboutStr.String(), 564 menu->AddItem(new BMenuItem(B_TRANSLATE("About TV"B_UTF8_ELLIPSIS), 572 565 new BMessage(M_FILE_ABOUT))); 573 566 menu->AddSeparatorItem(); 574 567 menu->AddItem(new BMenuItem(B_TRANSLATE("Quit"), … … 704 697 MainWin::UpdateWindowTitle() 705 698 { 706 699 char buf[100]; 707 sprintf(buf, "%s - %d x %d, %.3f:%.3f => %.0f x %.0f", NAME, fSourceWidth,700 sprintf(buf, "%s - %d x %d, %.3f:%.3f => %.0f x %.0f", B_TRANSLATE("TV"), fSourceWidth, 708 701 fSourceHeight, fWidthScale, fHeightScale, 709 702 fVideoView->Bounds().Width() + 1, fVideoView->Bounds().Height() + 1); 710 703 SetTitle(buf); … … 1228 1221 break; 1229 1222 1230 1223 case M_FILE_ABOUT: 1231 1232 BString alertStr = fLocalizedName;1233 alertStr << "\n\n";1234 alertStr << fLocalizedInfo1;1235 #if TIME_BOMB_ACTIVE1236 alertStr << "\n\n";1237 alertStr << INFO2;1238 #endif1239 alertStr << "\n\nCopyright ";1240 alertStr << COPYRIGHT;1241 alertStr << B_TRANSLATE("\nVersion ");1242 alertStr << VERSION;1243 alertStr << B_TRANSLATE("\nRevision ");1244 if (strcmp(REVISION, "unknown") == 0)1245 alertStr << fLocalizedRevision;1246 else1247 alertStr << REVISION;1248 alertStr << B_TRANSLATE("\nBuild ");1249 alertStr << BUILD;1224 { 1225 BString appName = B_TRANSLATE("TV"); 1226 int nameLength = appName.CountChars(); 1227 BAlert* alert = new BAlert(B_TRANSLATE("About"), 1228 appName.Append(B_TRANSLATE("\n\nDVB - Digital Video " 1229 "Broadcasting TV\n\nwritten by Marcus Overhagen\n" 1230 "Copyright 2005-2007\n")), 1231 B_TRANSLATE("OK")); 1232 BTextView* view = alert->TextView(); 1233 BFont font; 1234 1235 view->SetStylable(true); 1236 1237 view->GetFont(&font); 1238 font.SetSize(18); 1239 font.SetFace(B_BOLD_FACE); 1240 view->SetFontAndColor(0, nameLength, &font); 1241 1242 alert->Go(); 1250 1243 1251 BAlert *alert;1252 alert = new BAlert("about", alertStr.String(), B_TRANSLATE("OK"));1253 if (fAlwaysOnTop) {1254 ToggleAlwaysOnTop();1255 alert->Go();1256 ToggleAlwaysOnTop();1257 } else1258 alert->Go();1259 }1260 1244 break; 1261 1245 } 1262 1246 case M_FILE_QUIT: 1263 1247 // be_app->PostMessage(B_QUIT_REQUESTED); 1264 1248 PostMessage(B_QUIT_REQUESTED); -
src/apps/tv/config.h
28 28 #include <InterfaceDefs.h> 29 29 #include <time.h> 30 30 31 #define NAME "TV"32 #define REVISION "unknown"33 #define VERSION "1.1"34 #define BUILD __DATE__ " "__TIME__35 #define COPYRIGHT B_UTF8_COPYRIGHT" Marcus Overhagen 2005-2007"36 #define INFO1 "DVB - Digital Video Broadcasting TV"37 #define APP_SIG "application/x-vnd.Haiku."NAME38 31 39 32 #endif -
src/apps/tv/MainApp.cpp
22 22 * OTHER DEALINGS IN THE SOFTWARE. 23 23 */ 24 24 25 #include <Path.h>26 25 #include <Entry.h> 27 26 #include <Alert.h> 28 #include <unistd.h> 27 #include <InterfaceDefs.h> 28 #include <Path.h> 29 29 30 #include <stdio.h> 30 31 #include <time.h> 32 #include <unistd.h> 31 33 32 34 #include "MainApp.h" 33 #include "config.h"35 // #include "config.h" 34 36 #include "DeviceRoster.h" 35 37 36 38 #undef B_TRANSLATE_CONTEXT … … 43 45 44 46 MainApp::MainApp() 45 47 : 46 BApplication( APP_SIG)48 BApplication("application/x-vnd.Haiku.TV") 47 49 { 48 50 InitPrefs(); 49 51