Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Elisa
Commits
5f509193
Commit
5f509193
authored
Aug 07, 2020
by
stef lep
Committed by
Nate Graham
Aug 12, 2020
Browse files
add configuration to disable play at startup
parent
dfa4cb9a
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/elisa_core.kcfg
View file @
5f509193
...
...
@@ -21,6 +21,11 @@
false
</default>
</entry>
<entry
key=
"PlayAtStartup"
type=
"Bool"
>
<default>
false
</default>
</entry>
</group>
<group
name=
"Views"
>
<entry
key=
"EmbeddedView"
type=
"Enum"
>
...
...
src/localFileConfiguration/elisaconfigurationdialog.cpp
View file @
5f509193
...
...
@@ -76,6 +76,7 @@ void ElisaConfigurationDialog::save()
Elisa
::
ElisaConfiguration
::
setShowProgressOnTaskBar
(
mShowProgressInTaskBar
);
Elisa
::
ElisaConfiguration
::
setShowSystemTrayIcon
(
mShowSystemTrayIcon
);
Elisa
::
ElisaConfiguration
::
setForceUsageOfFastFileSearch
(
mForceUsageOfFastFileSearch
);
Elisa
::
ElisaConfiguration
::
setPlayAtStartup
(
mPlayAtStartup
);
Elisa
::
ElisaConfiguration
::
setEmbeddedView
(
0
);
switch
(
mEmbeddedView
)
...
...
@@ -155,11 +156,24 @@ void ElisaConfigurationDialog::setEmbeddedView(ElisaUtils::PlayListEntryType emb
setDirty
();
}
void
ElisaConfigurationDialog
::
setPlayAtStartup
(
bool
playAtStartup
)
{
if
(
mPlayAtStartup
==
playAtStartup
)
{
return
;
}
mPlayAtStartup
=
playAtStartup
;
Q_EMIT
playAtStartupChanged
();
setDirty
();
}
void
ElisaConfigurationDialog
::
configChanged
()
{
setRootPath
(
Elisa
::
ElisaConfiguration
::
rootPath
());
setShowProgressInTaskBar
(
Elisa
::
ElisaConfiguration
::
showProgressOnTaskBar
());
setShowSystemTrayIcon
(
Elisa
::
ElisaConfiguration
::
showSystemTrayIcon
());
setPlayAtStartup
(
Elisa
::
ElisaConfiguration
::
playAtStartup
());
switch
(
Elisa
::
ElisaConfiguration
::
embeddedView
())
{
case
0
:
...
...
src/localFileConfiguration/elisaconfigurationdialog.h
View file @
5f509193
...
...
@@ -48,6 +48,11 @@ class ELISALIB_EXPORT ElisaConfigurationDialog : public QObject
READ
isDirty
NOTIFY
isDirtyChanged
)
Q_PROPERTY
(
bool
playAtStartup
READ
playAtStartup
WRITE
setPlayAtStartup
NOTIFY
playAtStartupChanged
)
public:
explicit
ElisaConfigurationDialog
(
QObject
*
parent
=
nullptr
);
...
...
@@ -81,6 +86,11 @@ public:
return
mEmbeddedView
;
}
bool
playAtStartup
()
const
{
return
mPlayAtStartup
;
}
Q_SIGNALS:
void
rootPathChanged
(
const
QStringList
&
rootPath
);
...
...
@@ -95,6 +105,8 @@ Q_SIGNALS:
void
embeddedViewChanged
();
void
playAtStartupChanged
();
public
Q_SLOTS
:
void
setRootPath
(
const
QStringList
&
rootPath
);
...
...
@@ -109,6 +121,8 @@ public Q_SLOTS:
void
setEmbeddedView
(
ElisaUtils
::
PlayListEntryType
embeddedView
);
void
setPlayAtStartup
(
bool
playAtStartup
);
private
Q_SLOTS
:
void
configChanged
();
...
...
@@ -129,6 +143,8 @@ private:
bool
mForceUsageOfFastFileSearch
=
true
;
bool
mPlayAtStartup
=
false
;
ElisaUtils
::
PlayListEntryType
mEmbeddedView
=
ElisaUtils
::
Unknown
;
};
...
...
src/manageaudioplayer.cpp
View file @
5f509193
...
...
@@ -8,6 +8,8 @@
#include "mediaplaylist.h"
#include "elisa_settings.h"
#include <QTimer>
#include <QDateTime>
...
...
@@ -570,7 +572,9 @@ void ManageAudioPlayer::restorePreviousState()
}
auto
isPlaying
=
mPersistentState
.
find
(
QStringLiteral
(
"isPlaying"
));
if
(
isPlaying
!=
mPersistentState
.
end
()
&&
mPlayingState
!=
isPlaying
->
toBool
())
{
auto
currentConfiguration
=
Elisa
::
ElisaConfiguration
::
self
();
bool
autoPlay
=
currentConfiguration
->
playAtStartup
();
if
(
autoPlay
&&
isPlaying
!=
mPersistentState
.
end
()
&&
mPlayingState
!=
isPlaying
->
toBool
())
{
mPlayingState
=
isPlaying
->
toBool
();
}
...
...
src/qml/GeneralConfiguration.qml
View file @
5f509193
...
...
@@ -35,6 +35,14 @@ ColumnLayout {
onToggled
:
ElisaConfigurationDialog
.
showSystemTrayIcon
=
checked
}
CheckBox
{
checked
:
ElisaConfigurationDialog
.
playAtStartup
text
:
i18n
(
"
Start playing on startup
"
)
onToggled
:
ElisaConfigurationDialog
.
playAtStartup
=
checked
}
RowLayout
{
spacing
:
Kirigami
.
Units
.
smallSpacing
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment