[app] Added keepDisplayOn option
This commit is contained in:
parent
57801ed140
commit
3ccc36e335
4 changed files with 36 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2015-2017 Jolla Ltd.
|
Copyright (C) 2015-2018 Jolla Ltd.
|
||||||
Contact: Slava Monich <slava.monich@jolla.com>
|
Copyright (C) 2015-2018 Slava Monich <slava.monich@jolla.com>
|
||||||
|
|
||||||
You may use this file under the terms of BSD license as follows:
|
You may use this file under the terms of BSD license as follows:
|
||||||
|
|
||||||
|
@ -54,6 +54,11 @@ ApplicationWindow {
|
||||||
BooksHints { id: globalHints }
|
BooksHints { id: globalHints }
|
||||||
BooksFeedback { id: globalFeedback }
|
BooksFeedback { id: globalFeedback }
|
||||||
SystemState { id: globalSystemState }
|
SystemState { id: globalSystemState }
|
||||||
|
DisplayBlanking {
|
||||||
|
pauseRequested: Qt.application.active &&
|
||||||
|
Settings.currentBook &&
|
||||||
|
Settings.keepDisplayOn
|
||||||
|
}
|
||||||
|
|
||||||
initialPage: BooksMainPage { id: mainPage }
|
initialPage: BooksMainPage { id: mainPage }
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2015-2017 Jolla Ltd.
|
* Copyright (C) 2015-2018 Jolla Ltd.
|
||||||
* Contact: Slava Monich <slava.monich@jolla.com>
|
* Copyright (C) 2015-2018 Slava Monich <slava.monich@jolla.com>
|
||||||
*
|
*
|
||||||
* You may use this file under the terms of the BSD license as follows:
|
* You may use this file under the terms of the BSD license as follows:
|
||||||
*
|
*
|
||||||
|
@ -49,6 +49,7 @@
|
||||||
#define KEY_CURRENT_FOLDER "currentFolder"
|
#define KEY_CURRENT_FOLDER "currentFolder"
|
||||||
#define KEY_REMOVABLE_ROOT "removableRoot"
|
#define KEY_REMOVABLE_ROOT "removableRoot"
|
||||||
#define KEY_INVERT_COLORS "invertColors"
|
#define KEY_INVERT_COLORS "invertColors"
|
||||||
|
#define KEY_KEEP_DISPLAY_ON "keepDisplayOn"
|
||||||
#define KEY_VOLUME_UP_ACTION "volumeUpAction"
|
#define KEY_VOLUME_UP_ACTION "volumeUpAction"
|
||||||
#define KEY_VOLUME_DOWN_ACTION "volumeDownAction"
|
#define KEY_VOLUME_DOWN_ACTION "volumeDownAction"
|
||||||
#define KEY_ORIENTATION "orientation"
|
#define KEY_ORIENTATION "orientation"
|
||||||
|
@ -59,6 +60,7 @@
|
||||||
#define DEFAULT_CURRENT_FOLDER QString()
|
#define DEFAULT_CURRENT_FOLDER QString()
|
||||||
#define DEFAULT_REMOVABLE_ROOT "Books"
|
#define DEFAULT_REMOVABLE_ROOT "Books"
|
||||||
#define DEFAULT_INVERT_COLORS false
|
#define DEFAULT_INVERT_COLORS false
|
||||||
|
#define DEFAULT_KEEP_DISPLAY_ON false
|
||||||
#define DEFAULT_VOLUME_UP_ACTION (BooksSettings::ActionNextPage)
|
#define DEFAULT_VOLUME_UP_ACTION (BooksSettings::ActionNextPage)
|
||||||
#define DEFAULT_VOLUME_DOWN_ACTION (BooksSettings::ActionPreviousPage)
|
#define DEFAULT_VOLUME_DOWN_ACTION (BooksSettings::ActionPreviousPage)
|
||||||
#define DEFAULT_ORIENTATION (BooksSettings::OrientationAny)
|
#define DEFAULT_ORIENTATION (BooksSettings::OrientationAny)
|
||||||
|
@ -232,6 +234,7 @@ public:
|
||||||
MGConfItem* iFontSizeConf;
|
MGConfItem* iFontSizeConf;
|
||||||
MGConfItem* iPageDetailsConf;
|
MGConfItem* iPageDetailsConf;
|
||||||
MGConfItem* iInvertColorsConf;
|
MGConfItem* iInvertColorsConf;
|
||||||
|
MGConfItem* iKeepDisplayOnConf;
|
||||||
MGConfItem* iVolumeUpActionConf;
|
MGConfItem* iVolumeUpActionConf;
|
||||||
MGConfItem* iVolumeDownActionConf;
|
MGConfItem* iVolumeDownActionConf;
|
||||||
MGConfItem* iCurrentFolderConf;
|
MGConfItem* iCurrentFolderConf;
|
||||||
|
@ -252,6 +255,7 @@ BooksSettings::Private::Private(BooksSettings* aParent) :
|
||||||
iFontSizeConf(new MGConfItem(DCONF_PATH KEY_FONT_SIZE, this)),
|
iFontSizeConf(new MGConfItem(DCONF_PATH KEY_FONT_SIZE, this)),
|
||||||
iPageDetailsConf(new MGConfItem(DCONF_PATH KEY_PAGE_DETAILS, this)),
|
iPageDetailsConf(new MGConfItem(DCONF_PATH KEY_PAGE_DETAILS, this)),
|
||||||
iInvertColorsConf(new MGConfItem(DCONF_PATH KEY_INVERT_COLORS, this)),
|
iInvertColorsConf(new MGConfItem(DCONF_PATH KEY_INVERT_COLORS, this)),
|
||||||
|
iKeepDisplayOnConf(new MGConfItem(DCONF_PATH KEY_KEEP_DISPLAY_ON, this)),
|
||||||
iVolumeUpActionConf(new MGConfItem(DCONF_PATH KEY_VOLUME_UP_ACTION, this)),
|
iVolumeUpActionConf(new MGConfItem(DCONF_PATH KEY_VOLUME_UP_ACTION, this)),
|
||||||
iVolumeDownActionConf(new MGConfItem(DCONF_PATH KEY_VOLUME_DOWN_ACTION, this)),
|
iVolumeDownActionConf(new MGConfItem(DCONF_PATH KEY_VOLUME_DOWN_ACTION, this)),
|
||||||
iCurrentFolderConf(new MGConfItem(DCONF_PATH KEY_CURRENT_FOLDER, this)),
|
iCurrentFolderConf(new MGConfItem(DCONF_PATH KEY_CURRENT_FOLDER, this)),
|
||||||
|
@ -267,6 +271,7 @@ BooksSettings::Private::Private(BooksSettings* aParent) :
|
||||||
connect(iPageDetailsConf, SIGNAL(valueChanged()), iParent, SIGNAL(pageDetailsChanged()));
|
connect(iPageDetailsConf, SIGNAL(valueChanged()), iParent, SIGNAL(pageDetailsChanged()));
|
||||||
connect(iInvertColorsConf, SIGNAL(valueChanged()), iParent, SIGNAL(invertColorsChanged()));
|
connect(iInvertColorsConf, SIGNAL(valueChanged()), iParent, SIGNAL(invertColorsChanged()));
|
||||||
connect(iInvertColorsConf, SIGNAL(valueChanged()), iParent, SIGNAL(pageBackgroundColorChanged()));
|
connect(iInvertColorsConf, SIGNAL(valueChanged()), iParent, SIGNAL(pageBackgroundColorChanged()));
|
||||||
|
connect(iKeepDisplayOnConf, SIGNAL(valueChanged()), iParent, SIGNAL(keepDisplayOnChanged()));
|
||||||
connect(iVolumeUpActionConf, SIGNAL(valueChanged()), iParent, SIGNAL(volumeUpActionChanged()));
|
connect(iVolumeUpActionConf, SIGNAL(valueChanged()), iParent, SIGNAL(volumeUpActionChanged()));
|
||||||
connect(iVolumeDownActionConf, SIGNAL(valueChanged()), iParent, SIGNAL(volumeDownActionChanged()));
|
connect(iVolumeDownActionConf, SIGNAL(valueChanged()), iParent, SIGNAL(volumeDownActionChanged()));
|
||||||
connect(iOrientationConf, SIGNAL(valueChanged()), iParent, SIGNAL(orientationChanged()));
|
connect(iOrientationConf, SIGNAL(valueChanged()), iParent, SIGNAL(orientationChanged()));
|
||||||
|
@ -543,6 +548,20 @@ BooksSettings::setInvertColors(
|
||||||
iPrivate->iInvertColorsConf->set(aValue);
|
iPrivate->iInvertColorsConf->set(aValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
BooksSettings::keepDisplayOn() const
|
||||||
|
{
|
||||||
|
return iPrivate->iKeepDisplayOnConf->value(DEFAULT_KEEP_DISPLAY_ON).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BooksSettings::setKeepDisplayOn(
|
||||||
|
bool aValue)
|
||||||
|
{
|
||||||
|
HDEBUG(aValue);
|
||||||
|
iPrivate->iKeepDisplayOnConf->set(aValue);
|
||||||
|
}
|
||||||
|
|
||||||
BooksSettings::Action
|
BooksSettings::Action
|
||||||
BooksSettings::volumeUpAction() const
|
BooksSettings::volumeUpAction() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2015-2017 Jolla Ltd.
|
* Copyright (C) 2015-2018 Jolla Ltd.
|
||||||
* Contact: Slava Monich <slava.monich@jolla.com>
|
* Copyright (C) 2015-2018 Slava Monich <slava.monich@jolla.com>
|
||||||
*
|
*
|
||||||
* You may use this file under the terms of the BSD license as follows:
|
* You may use this file under the terms of the BSD license as follows:
|
||||||
*
|
*
|
||||||
|
@ -49,6 +49,7 @@ class BooksSettings : public QObject
|
||||||
Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize NOTIFY fontSizeChanged)
|
Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize NOTIFY fontSizeChanged)
|
||||||
Q_PROPERTY(int pageDetails READ pageDetails WRITE setPageDetails NOTIFY pageDetailsChanged)
|
Q_PROPERTY(int pageDetails READ pageDetails WRITE setPageDetails NOTIFY pageDetailsChanged)
|
||||||
Q_PROPERTY(bool invertColors READ invertColors WRITE setInvertColors NOTIFY invertColorsChanged)
|
Q_PROPERTY(bool invertColors READ invertColors WRITE setInvertColors NOTIFY invertColorsChanged)
|
||||||
|
Q_PROPERTY(bool keepDisplayOn READ keepDisplayOn WRITE setKeepDisplayOn NOTIFY keepDisplayOnChanged)
|
||||||
Q_PROPERTY(int volumeUpAction READ volumeUpAction WRITE setVolumeUpAction NOTIFY volumeUpActionChanged)
|
Q_PROPERTY(int volumeUpAction READ volumeUpAction WRITE setVolumeUpAction NOTIFY volumeUpActionChanged)
|
||||||
Q_PROPERTY(int volumeDownAction READ volumeDownAction WRITE setVolumeDownAction NOTIFY volumeDownActionChanged)
|
Q_PROPERTY(int volumeDownAction READ volumeDownAction WRITE setVolumeDownAction NOTIFY volumeDownActionChanged)
|
||||||
Q_PROPERTY(QObject* currentBook READ currentBook WRITE setCurrentBook NOTIFY currentBookChanged)
|
Q_PROPERTY(QObject* currentBook READ currentBook WRITE setCurrentBook NOTIFY currentBookChanged)
|
||||||
|
@ -101,6 +102,9 @@ public:
|
||||||
bool invertColors() const;
|
bool invertColors() const;
|
||||||
void setInvertColors(bool aValue);
|
void setInvertColors(bool aValue);
|
||||||
|
|
||||||
|
bool keepDisplayOn() const;
|
||||||
|
void setKeepDisplayOn(bool aValue);
|
||||||
|
|
||||||
Action volumeUpAction() const;
|
Action volumeUpAction() const;
|
||||||
void setVolumeUpAction(int aValue);
|
void setVolumeUpAction(int aValue);
|
||||||
|
|
||||||
|
@ -127,6 +131,7 @@ Q_SIGNALS:
|
||||||
void textStyleChanged();
|
void textStyleChanged();
|
||||||
void pageDetailsChanged();
|
void pageDetailsChanged();
|
||||||
void invertColorsChanged();
|
void invertColorsChanged();
|
||||||
|
void keepDisplayOnChanged();
|
||||||
void volumeUpActionChanged();
|
void volumeUpActionChanged();
|
||||||
void volumeDownActionChanged();
|
void volumeDownActionChanged();
|
||||||
void currentBookChanged();
|
void currentBookChanged();
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit c8d907a11a3512672ed906fa2c3b41a65c9a9bd2
|
Subproject commit b0fda2fea0c7381d74bf848902c48cbbcd3f6a8e
|
Loading…
Reference in a new issue