disable power options for arm

https://tower.im/members/fe996d0d13b642a7867fb2d84080a5a8/?me=1vb
This commit is contained in:
listenerri 2019-03-25 13:37:58 +08:00
parent b1333a2795
commit cb33eb9f49
2 changed files with 8 additions and 0 deletions

View File

@ -12,6 +12,10 @@ find_package(Qt5Svg REQUIRED)
find_package(Qt5DBus REQUIRED)
find_package(DtkWidget REQUIRED)
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
add_definitions("-DDISABLE_POWER_OPTIONS")
endif()
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
add_library(${PLUGIN_NAME} SHARED ${SRCS} shutdown.qrc)
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../)

View File

@ -124,6 +124,7 @@ const QString ShutdownPlugin::itemContextMenu(const QString &itemKey)
reboot["isActive"] = true;
items.push_back(reboot);
#ifndef DISABLE_POWER_OPTIONS
QMap<QString, QVariant> suspend;
suspend["itemId"] = "Suspend";
suspend["itemText"] = tr("Suspend");
@ -137,6 +138,7 @@ const QString ShutdownPlugin::itemContextMenu(const QString &itemKey)
hibernate["isActive"] = true;
items.push_back(hibernate);
}
#endif
QMap<QString, QVariant> lock;
lock["itemId"] = "Lock";
@ -159,11 +161,13 @@ const QString ShutdownPlugin::itemContextMenu(const QString &itemKey)
items.push_back(switchUser);
}
#ifndef DISABLE_POWER_OPTIONS
QMap<QString, QVariant> power;
power["itemId"] = "power";
power["itemText"] = tr("Power settings");
power["isActive"] = true;
items.push_back(power);
#endif
QMap<QString, QVariant> menu;
menu["items"] = items;