Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to cache the last region #2615

Merged
merged 3 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
addressed typo comments and applied clang-format
  • Loading branch information
borgmanJeremy committed Jun 1, 2022
commit 4305ac3751ed1671b6475cf480ea018dca87b838
2 changes: 1 addition & 1 deletion src/config/generalconf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ void GeneralConf::initSaveLastRegion()
{
m_saveLastRegion = new QCheckBox(tr("Use last region"), this);
m_saveLastRegion->setToolTip(tr("Uses the last region as the default "
"selection for the next screenshot."));
"selection for the next screenshot"));
m_scrollAreaLayout->addWidget(m_saveLastRegion);

connect(m_saveLastRegion,
Expand Down
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void requestCaptureAndWait(const CaptureRequest& req)
Flameshot* flameshot = Flameshot::instance();
flameshot->requestCapture(req);
QObject::connect(flameshot, &Flameshot::captureTaken, [&](QPixmap) {
// Only u seful on MacOS because each instance hosts its own widgets
// Only useful on MacOS because each instance hosts its own widgets
if (!FlameshotDaemon::isThisInstanceHostingWidgets()) {
qApp->exit(0);
}
Expand Down Expand Up @@ -178,7 +178,8 @@ int main(int argc, char* argv[])
QStringLiteral("milliseconds"));

CommandOption useLastRegionOption(
"last-region", QObject::tr("Repeat screenshot with previously selected region"));
"last-region",
QObject::tr("Repeat screenshot with previously selected region"));

CommandOption regionOption("region",
QObject::tr("Screenshot region to select"),
Expand Down Expand Up @@ -376,8 +377,7 @@ int main(int argc, char* argv[])
if (!region.isEmpty()) {
auto selectionRegion = Region().value(region).toRect();
req.setInitialSelection(selectionRegion);
}
else if (useLastRegion){
} else if (useLastRegion) {
req.setInitialSelection(getLastRegion());
}
if (clipboard) {
Expand Down