| 1 | /* |
| 2 | * Copyright (C) 2020 Damir Porobic <[email protected]> |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; either version 2 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #include "WaylandConfig.h" |
| 21 | |
| 22 | WaylandConfig::WaylandConfig(const QSharedPointer<IDirectoryPathProvider> &directoryPathProvider, const QSharedPointer<IPlatformChecker> &platformChecker) : |
| 23 | Config(directoryPathProvider), |
| 24 | mPlatformChecker(platformChecker) |
| 25 | { |
| 26 | |
| 27 | } |
| 28 | |
| 29 | bool WaylandConfig::isFreezeImageWhileSnippingEnabledReadOnly() const |
| 30 | { |
| 31 | return true; |
| 32 | } |
| 33 | |
| 34 | bool WaylandConfig::freezeImageWhileSnippingEnabled() const |
| 35 | { |
| 36 | return false; |
| 37 | } |
| 38 | |
| 39 | bool WaylandConfig::isGlobalHotKeysEnabledReadOnly() const |
| 40 | { |
| 41 | return true; |
| 42 | } |
| 43 | |
| 44 | bool WaylandConfig::globalHotKeysEnabled() const |
| 45 | { |
| 46 | return false; |
| 47 | } |
| 48 | |
| 49 | bool WaylandConfig::isSnippingAreaMagnifyingGlassEnabledReadOnly() const |
| 50 | { |
| 51 | return true; |
| 52 | } |
| 53 | |
| 54 | bool WaylandConfig::snippingAreaMagnifyingGlassEnabled() const |
| 55 | { |
| 56 | return false; |
| 57 | } |
| 58 | |
| 59 | bool WaylandConfig::isForceGenericWaylandEnabledReadOnly() const |
| 60 | { |
| 61 | return isOnlyGenericScreenshotSupported(); |
| 62 | } |
| 63 | |
| 64 | bool WaylandConfig::isScaleGenericWaylandScreenshotEnabledReadOnly() const |
| 65 | { |
| 66 | return false; |
| 67 | } |
| 68 | |
| 69 | bool WaylandConfig::forceGenericWaylandEnabled() const |
| 70 | { |
| 71 | if (isOnlyGenericScreenshotSupported()) { |
| 72 | return true; |
| 73 | } |
| 74 | return Config::forceGenericWaylandEnabled(); |
| 75 | } |
| 76 | |
| 77 | bool WaylandConfig::isOnlyGenericScreenshotSupported() const |
| 78 | { |
| 79 | return mPlatformChecker->gnomeVersion() >= 41 || mPlatformChecker->isSnap(); |
| 80 | } |