Ticket #3817: Screenshot-stringsV2.diff
File Screenshot-stringsV2.diff, 8.0 KB (added by , 15 years ago) |
---|
-
src/apps/screenshot/ScreenshotWindow.cpp
49 49 enum { 50 50 kScreenshotType, 51 51 kIncludeBorder, 52 kShow Cursor,52 kShowMouse, 53 53 kBackToSave, 54 54 kTakeScreenshot, 55 55 kImageOutputFormat, … … 78 78 79 79 80 80 ScreenshotWindow::ScreenshotWindow(bigtime_t delay, bool includeBorder, 81 bool include Cursor, bool grabActiveWindow, bool showConfigWindow,81 bool includeMouse, bool grabActiveWindow, bool showConfigWindow, 82 82 bool saveScreenshotSilent) 83 83 : BWindow(BRect(0, 0, 200.0, 100.0), "Take Screenshot", B_TITLED_WINDOW, 84 84 B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_QUIT_ON_WINDOW_CLOSE | … … 89 89 fLastSelectedPath(NULL), 90 90 fDelay(delay), 91 91 fIncludeBorder(includeBorder), 92 fInclude Cursor(includeCursor),92 fIncludeMouse(includeMouse), 93 93 fGrabActiveWindow(grabActiveWindow), 94 94 fShowConfigWindow(showConfigWindow) 95 95 { … … 129 129 fIncludeBorder = (fWindowBorder->Value() == B_CONTROL_ON); 130 130 } break; 131 131 132 case kShow Cursor: {133 fInclude Cursor = (fShowCursor->Value() == B_CONTROL_ON);132 case kShowMouse: { 133 fIncludeMouse = (fShowMouse->Value() == B_CONTROL_ON); 134 134 } break; 135 135 136 136 case kBackToSave: { … … 166 166 BMessenger target(this); 167 167 fOutputPathPanel = new BFilePanel(B_OPEN_PANEL, &target, 168 168 NULL, B_DIRECTORY_NODE, false, NULL, new DirectoryRefFilter()); 169 fOutputPathPanel->Window()->SetTitle("Choose directory");169 fOutputPathPanel->Window()->SetTitle("Choose folder"); 170 170 fOutputPathPanel->SetButtonLabel(B_DEFAULT_BUTTON, "Select"); 171 171 } 172 172 fOutputPathPanel->Show(); … … 243 243 244 244 fActiveWindow = new BRadioButton("Take active window", 245 245 new BMessage(kScreenshotType)); 246 fWholeDesktop = new BRadioButton("Take whole Desktop",246 fWholeDesktop = new BRadioButton("Take whole screen", 247 247 new BMessage(kScreenshotType)); 248 248 fWholeDesktop->SetValue(B_CONTROL_ON); 249 249 … … 261 261 new BMessage(kIncludeBorder)); 262 262 fWindowBorder->SetEnabled(false); 263 263 264 fShow Cursor = new BCheckBox("Include cursor in screenshot",265 new BMessage(kShow Cursor));266 fShow Cursor->SetValue(fIncludeCursor);264 fShowMouse = new BCheckBox("Include mouse pointer in screenshot", 265 new BMessage(kShowMouse)); 266 fShowMouse->SetValue(fIncludeMouse); 267 267 268 268 BBox* divider = new BBox(B_FANCY_BORDER, NULL); 269 269 divider->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, 1)); … … 289 289 .AddStrut(10.0) 290 290 .AddGroup(B_HORIZONTAL) 291 291 .AddStrut(15.0) 292 .Add(fShow Cursor)292 .Add(fShowMouse) 293 293 .End() 294 294 .AddStrut(5.0) 295 295 .AddGroup(B_HORIZONTAL, 5.0) … … 428 428 BPath path; 429 429 find_directory(B_USER_DIRECTORY, &path); 430 430 431 BString label("Home directory");431 BString label("Home folder"); 432 432 _AddItemToPathMenu(path.Path(), label, 0, (path.Path() == lastSelectedPath)); 433 433 434 434 path.Append("Desktop"); … … 438 438 find_directory(B_BEOS_ETC_DIRECTORY, &path); 439 439 path.Append("artwork"); 440 440 441 label.SetTo("Artwork directory");441 label.SetTo("Artwork folder"); 442 442 _AddItemToPathMenu(path.Path(), label, 2, (path.Path() == lastSelectedPath)); 443 443 444 444 int32 i = 0; … … 459 459 } 460 460 461 461 fOutputPathMenu->AddItem(new BSeparatorItem()); 462 fOutputPathMenu->AddItem(new BMenuItem("Choose directory...",462 fOutputPathMenu->AddItem(new BMenuItem("Choose folder...", 463 463 new BMessage(kChooseLocation))); 464 464 } 465 465 … … 626 626 delete fScreenshot; 627 627 if (_GetActiveWindowFrame(&frame) == B_OK) { 628 628 fScreenshot = new BBitmap(frame.OffsetToCopy(B_ORIGIN), B_RGBA32); 629 BScreen(this).ReadBitmap(fScreenshot, fInclude Cursor, &frame);629 BScreen(this).ReadBitmap(fScreenshot, fIncludeMouse, &frame); 630 630 } else { 631 BScreen(this).GetBitmap(&fScreenshot, fInclude Cursor);631 BScreen(this).GetBitmap(&fScreenshot, fIncludeMouse); 632 632 } 633 633 } 634 634 … … 731 731 732 732 BPath homePath; 733 733 if (find_directory(B_USER_DIRECTORY, &homePath) != B_OK) { 734 fprintf(stderr, "failed to find user home directory\n");734 fprintf(stderr, "failed to find user home folder\n"); 735 735 return; 736 736 } 737 737 -
src/apps/screenshot/ScreenshotWindow.h
22 22 public: 23 23 ScreenshotWindow(bigtime_t delay = 0, 24 24 bool includeBorder = false, 25 bool include Cursor= false,25 bool includeMouse = false, 26 26 bool grabActiveWindow = false, 27 27 bool showConfigWindow = false, 28 28 bool saveScreenshotSilent = false); … … 62 62 BRadioButton* fWholeDesktop; 63 63 BTextControl* fDelayControl; 64 64 BCheckBox* fWindowBorder; 65 BCheckBox* fShow Cursor;65 BCheckBox* fShowMouse; 66 66 BButton* fBackToSave; 67 67 BButton* fTakeScreenshot; 68 68 BTextControl* fNameControl; … … 75 75 bigtime_t fDelay; 76 76 77 77 bool fIncludeBorder; 78 bool fInclude Cursor;78 bool fIncludeMouse; 79 79 bool fGrabActiveWindow; 80 80 bool fShowConfigWindow; 81 81 -
src/apps/screenshot/Screenshot.cpp
45 45 bool includeBorder = false; 46 46 message->FindBool("border", &includeBorder); 47 47 48 bool include Cursor= false;49 message->FindBool("border", &include Cursor);48 bool includeMouse = false; 49 message->FindBool("border", &includeMouse); 50 50 51 51 bool grabActiveWindow = false; 52 52 message->FindBool("window", &grabActiveWindow); … … 57 57 bool showConfigureWindow = false; 58 58 message->FindBool("configure", &showConfigureWindow); 59 59 60 new ScreenshotWindow(delay * 1000000, includeBorder, include Cursor,60 new ScreenshotWindow(delay * 1000000, includeBorder, includeMouse, 61 61 grabActiveWindow, showConfigureWindow, saveScreenshotSilent); 62 62 63 63 fRefsReceived = true; … … 70 70 bigtime_t delay = 0; 71 71 72 72 bool includeBorder = false; 73 bool include Cursor= false;73 bool includeMouse = false; 74 74 bool grabActiveWindow = false; 75 75 bool showConfigureWindow = false; 76 76 bool saveScreenshotSilent = false; … … 80 80 _ShowHelp(); 81 81 else if (strcmp(argv[i], "-b") == 0 || strcmp(argv[i], "--border") == 0) 82 82 includeBorder = true; 83 else if (strcmp(argv[i], "- c") == 0 || strcmp(argv[i], "--cursor") == 0)84 include Cursor= true;83 else if (strcmp(argv[i], "-m") == 0 || strcmp(argv[i], "--mouse") == 0) 84 includeMouse = true; 85 85 else if (strcmp(argv[i], "-w") == 0 || strcmp(argv[i], "--window") == 0) 86 86 grabActiveWindow = true; 87 87 else if (strcmp(argv[i], "-s") == 0 || strcmp(argv[i], "--silent") == 0) … … 99 99 } 100 100 } 101 101 fArgvReceived = true; 102 new ScreenshotWindow(delay, includeBorder, include Cursor, grabActiveWindow,102 new ScreenshotWindow(delay, includeBorder, includeMouse, grabActiveWindow, 103 103 showConfigureWindow, saveScreenshotSilent); 104 104 } 105 105 … … 107 107 void 108 108 Screenshot::_ShowHelp() const 109 109 { 110 printf("Screenshot [OPTION]... Creates a Bitmap of the current screen\n\n");110 printf("Screenshot [OPTION]... Creates a bitmap of the current screen\n\n"); 111 111 printf("OPTION\n"); 112 112 printf(" -o, --options Show options window first\n"); 113 printf(" - c, --cursor Have the cursor insidethe screenshot\n");113 printf(" -m, --mouse Have the mouse pointer in the screenshot\n"); 114 114 printf(" -b, --border Include the window border with the screenshot\n"); 115 115 printf(" -w, --window Use active window instead of the entire screen\n"); 116 116 printf(" -d, --delay=seconds Take screenshot after specified delay [in seconds]\n"); 117 printf(" -s, --silent Saves the screenshot without the applicationwindow\n");118 printf(" over writes --options, saves to home directoryas png\n");117 printf(" -s, --silent Saves the screenshot without showing the app window\n"); 118 printf(" overrides --options, saves to home folder as png\n"); 119 119 printf("\n"); 120 120 printf("Note: OPTION -b, --border takes only effect when used with -w, --window\n"); 121 121