[vlc-commits] qt: expose showRemainingTime configuration option to QML
Pierre Lamot
git at videolan.org
Thu Aug 29 10:44:40 CEST 2019
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Aug 7 14:42:10 2019 +0200| [d4682e7ad29295015047598f16c08d3e1d86ba83] | committer: Jean-Baptiste Kempf
qt: expose showRemainingTime configuration option to QML
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d4682e7ad29295015047598f16c08d3e1d86ba83
---
modules/gui/qt/main_interface.cpp | 8 ++++++++
modules/gui/qt/main_interface.hpp | 5 +++++
2 files changed, 13 insertions(+)
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index a93e3655d3..e9bf16938f 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -165,6 +165,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ),
/* */
b_playlistDocked = getSettings()->value( "MainWindow/pl-dock-status", true ).toBool();
+ m_showRemainingTime = getSettings()->value( "MainWindow/ShowRemainingTime", false ).toBool();
/* Should the UI stays on top of other windows */
b_interfaceOnTop = var_InheritBool( p_intf, "video-on-top" );
@@ -256,6 +257,7 @@ MainInterface::~MainInterface()
settings->beginGroup("MainWindow");
settings->setValue( "pl-dock-status", b_playlistDocked );
+ settings->setValue( "ShowRemainingTime", m_showRemainingTime );
/* Save playlist state */
settings->setValue( "playlist-visible", playlistVisible );
@@ -565,6 +567,12 @@ void MainInterface::setPlaylistVisible( bool visible )
emit playlistVisibleChanged(visible);
}
+void MainInterface::setShowRemainingTime( bool show )
+{
+ m_showRemainingTime = show;
+ emit showRemainingTimeChanged(show);
+}
+
void MainInterface::setInterfaceAlwaysOnTop( bool on_top )
{
b_interfaceOnTop = on_top;
diff --git a/modules/gui/qt/main_interface.hpp b/modules/gui/qt/main_interface.hpp
index 371cd54ac5..fac9fe102b 100644
--- a/modules/gui/qt/main_interface.hpp
+++ b/modules/gui/qt/main_interface.hpp
@@ -68,6 +68,7 @@ class MainInterface : public QVLCMW
Q_PROPERTY(bool interfaceAlwaysOnTop READ isInterfaceAlwaysOnTop WRITE setInterfaceAlwaysOnTop NOTIFY interfaceAlwaysOnTopChanged)
Q_PROPERTY(bool interfaceFullScreen READ isInterfaceFullScreen WRITE setInterfaceFullScreen NOTIFY interfaceFullScreenChanged)
Q_PROPERTY(bool hasEmbededVideo READ hasEmbededVideo NOTIFY hasEmbededVideoChanged)
+ Q_PROPERTY(bool showRemainingTime READ isShowRemainingTime WRITE setShowRemainingTime NOTIFY showRemainingTimeChanged)
Q_PROPERTY(VLCVarChoiceModel* extraInterfaces READ getExtraInterfaces CONSTANT)
public:
@@ -81,6 +82,7 @@ public:
bool getVideo( struct vout_window_t * );
private:
bool m_hasEmbededVideo = false;
+ bool m_showRemainingTime = false;
VLCVarChoiceModel* m_extraInterfaces;
std::atomic_flag videoActive;
static int enableVideo( struct vout_window_t *,
@@ -119,6 +121,7 @@ public:
bool isPlaylistVisible() { return playlistVisible; }
bool isInterfaceAlwaysOnTop() { return b_interfaceOnTop; }
bool hasEmbededVideo() { return m_hasEmbededVideo; }
+ inline bool isShowRemainingTime() const { return m_showRemainingTime; }
QList<QQmlError> qmlErrors() const;
protected:
@@ -205,6 +208,7 @@ public slots:
void setPlaylistDocked( bool );
void setPlaylistVisible( bool );
void setInterfaceAlwaysOnTop( bool );
+ void setShowRemainingTime( bool );
void emitBoss();
void emitRaise();
@@ -257,6 +261,7 @@ signals:
void interfaceFullScreenChanged(bool);
void hasEmbededVideoChanged(bool);
void toolBarConfUpdated();
+ void showRemainingTimeChanged(bool);
};
#endif
More information about the vlc-commits
mailing list