Enable Screenshot & Screenshot history shortcut changing in MACOS (#2098)

* Enable Screenshot & Screenshot history shortcut changing in MACOS
From issue #1259 and my experience, I've fix and test this feature in my Hackintosh. So now you can change shortcut to take screenshot and show screenshot history (require restart flameshot).
- Default key to take screenshot is "Cmd + Shift + X", screenshot history is "Option + Shift + X".
- Added new translate text "Require restart flameshot".

* - Change message text for screenshot shortcut

* - Format code using clang-format

Co-authored-by: adrienpixodeo <adrien@pixodeo.net>
This commit is contained in:
LHBosssss
2021-11-21 09:44:39 +07:00
committed by GitHub
parent d253143b8f
commit 2283b3e783
5 changed files with 25 additions and 17 deletions

View File

@@ -90,20 +90,19 @@ Controller::Controller()
currentScreen->grabWindow(QApplication::desktop()->winId(), 0, 0, 1, 1);
// set global shortcuts for MacOS
m_HotkeyScreenshotCapture =
new QHotkey(QKeySequence("Ctrl+Alt+Shift+4"), true, this);
m_HotkeyScreenshotCapture = new QHotkey(
QKeySequence(ConfigHandler().shortcut("TAKE_SCREENSHOT")), true, this);
QObject::connect(m_HotkeyScreenshotCapture,
&QHotkey::activated,
qApp,
[&]() { this->startVisualCapture(); });
m_HotkeyScreenshotHistory =
new QHotkey(QKeySequence("Ctrl+Alt+Shift+H"), true, this);
m_HotkeyScreenshotHistory = new QHotkey(
QKeySequence(ConfigHandler().shortcut("SCREENSHOT_HISTORY")), true, this);
QObject::connect(m_HotkeyScreenshotHistory,
&QHotkey::activated,
qApp,
[&]() { this->showRecentUploads(); });
#endif
if (ConfigHandler().checkForUpdates()) {
getLatestAvailableVersion();
}