Screenshot: Alt-D/H/A/F s.cuts to select target folder
* Fixes #7987. - GCI 2013
This commit is contained in:
committed by
Siarzhuk Zharski
parent
7470dfe2d3
commit
5ff76056f7
@@ -206,7 +206,7 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,
|
|||||||
.Add(fWindowBorder)
|
.Add(fWindowBorder)
|
||||||
.Add(fShowCursor)
|
.Add(fShowCursor)
|
||||||
.AddStrut(kSpacing)
|
.AddStrut(kSpacing)
|
||||||
.AddGrid(0.0, kSpacing/2)
|
.AddGrid(0.0, kSpacing / 2)
|
||||||
.Add(fDelayControl->CreateLabelLayoutItem(), 0, 0)
|
.Add(fDelayControl->CreateLabelLayoutItem(), 0, 0)
|
||||||
.Add(fDelayControl->CreateTextViewLayoutItem(), 1, 0)
|
.Add(fDelayControl->CreateTextViewLayoutItem(), 1, 0)
|
||||||
.Add(BSpaceLayoutItem::CreateHorizontalStrut(kLabelSpacing),
|
.Add(BSpaceLayoutItem::CreateHorizontalStrut(kLabelSpacing),
|
||||||
@@ -481,19 +481,19 @@ ScreenshotWindow::_SetupOutputPathMenu(const BMessage& settings)
|
|||||||
|
|
||||||
BString label(B_TRANSLATE("Home folder"));
|
BString label(B_TRANSLATE("Home folder"));
|
||||||
_AddItemToPathMenu(path.Path(), label, 0,
|
_AddItemToPathMenu(path.Path(), label, 0,
|
||||||
(path.Path() == lastSelectedPath));
|
(path.Path() == lastSelectedPath), 'H');
|
||||||
|
|
||||||
path.Append("Desktop");
|
path.Append("Desktop");
|
||||||
label.SetTo(B_TRANSLATE("Desktop"));
|
label.SetTo(B_TRANSLATE("Desktop"));
|
||||||
_AddItemToPathMenu(path.Path(), label, 0, (
|
_AddItemToPathMenu(path.Path(), label, 0, (
|
||||||
path.Path() == lastSelectedPath));
|
path.Path() == lastSelectedPath), 'D');
|
||||||
|
|
||||||
find_directory(B_BEOS_ETC_DIRECTORY, &path);
|
find_directory(B_BEOS_ETC_DIRECTORY, &path);
|
||||||
path.Append("artwork");
|
path.Append("artwork");
|
||||||
|
|
||||||
label.SetTo(B_TRANSLATE("Artwork folder"));
|
label.SetTo(B_TRANSLATE("Artwork folder"));
|
||||||
_AddItemToPathMenu(path.Path(), label, 2,
|
_AddItemToPathMenu(path.Path(), label, 2,
|
||||||
(path.Path() == lastSelectedPath));
|
(path.Path() == lastSelectedPath), 'A');
|
||||||
|
|
||||||
int32 i = 0;
|
int32 i = 0;
|
||||||
BString userPath;
|
BString userPath;
|
||||||
@@ -513,13 +513,13 @@ ScreenshotWindow::_SetupOutputPathMenu(const BMessage& settings)
|
|||||||
|
|
||||||
fOutputPathMenu->AddItem(new BSeparatorItem());
|
fOutputPathMenu->AddItem(new BSeparatorItem());
|
||||||
fOutputPathMenu->AddItem(new BMenuItem(B_TRANSLATE("Choose folder..."),
|
fOutputPathMenu->AddItem(new BMenuItem(B_TRANSLATE("Choose folder..."),
|
||||||
new BMessage(kChooseLocation)));
|
new BMessage(kChooseLocation), 'F'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ScreenshotWindow::_AddItemToPathMenu(const char* path, BString& label,
|
ScreenshotWindow::_AddItemToPathMenu(const char* path, BString& label,
|
||||||
int32 index, bool markItem)
|
int32 index, bool markItem, uint32 shortcutKey)
|
||||||
{
|
{
|
||||||
// Make sure that item won't be a duplicate of an existing one
|
// Make sure that item won't be a duplicate of an existing one
|
||||||
for (int32 i = fOutputPathMenu->CountItems() - 1; i >= 0; --i) {
|
for (int32 i = fOutputPathMenu->CountItems() - 1; i >= 0; --i) {
|
||||||
@@ -544,7 +544,8 @@ ScreenshotWindow::_AddItemToPathMenu(const char* path, BString& label,
|
|||||||
fOutputPathMenu->TruncateString(&label, B_TRUNCATE_MIDDLE,
|
fOutputPathMenu->TruncateString(&label, B_TRUNCATE_MIDDLE,
|
||||||
fOutputPathMenu->StringWidth("SomethingLongHere"));
|
fOutputPathMenu->StringWidth("SomethingLongHere"));
|
||||||
|
|
||||||
fOutputPathMenu->AddItem(new BMenuItem(label.String(), message), index);
|
fOutputPathMenu->AddItem(new BMenuItem(label.String(), message,
|
||||||
|
shortcutKey), index);
|
||||||
|
|
||||||
if (markItem) {
|
if (markItem) {
|
||||||
fOutputPathMenu->ItemAt(index)->SetMarked(true);
|
fOutputPathMenu->ItemAt(index)->SetMarked(true);
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ private:
|
|||||||
void _DisallowChar(BTextView* textView);
|
void _DisallowChar(BTextView* textView);
|
||||||
void _SetupOutputPathMenu(const BMessage& settings);
|
void _SetupOutputPathMenu(const BMessage& settings);
|
||||||
void _AddItemToPathMenu(const char* path,
|
void _AddItemToPathMenu(const char* path,
|
||||||
BString& label, int32 index, bool markItem);
|
BString& label, int32 index, bool markItem,
|
||||||
|
uint32 shortcutKey = 0);
|
||||||
void _UpdateFilenameSelection();
|
void _UpdateFilenameSelection();
|
||||||
void _SetupTranslatorMenu();
|
void _SetupTranslatorMenu();
|
||||||
status_t _SaveScreenshot();
|
status_t _SaveScreenshot();
|
||||||
|
|||||||
Reference in New Issue
Block a user