mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55:21 +01:00
Qt/QML edition
This commit is contained in:
commit
d7b361ba44
2168 changed files with 721948 additions and 0 deletions
33
powersaveblocker.h
Normal file
33
powersaveblocker.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#ifndef POWERSAVEBLOCKER_H
|
||||
#define POWERSAVEBLOCKER_H
|
||||
|
||||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Copyright (C) 2020 Raspberry Pi (Trading) Limited
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
class PowerSaveBlocker : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PowerSaveBlocker(QObject *parent = nullptr);
|
||||
virtual ~PowerSaveBlocker();
|
||||
void applyBlock(const QString &reason);
|
||||
void removeBlock();
|
||||
|
||||
signals:
|
||||
|
||||
protected:
|
||||
bool _stayingAwake;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
HANDLE _powerRequest;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // POWERSAVEBLOCKER_H
|
Loading…
Add table
Add a link
Reference in a new issue