[vlc-devel] [PATCH 03/21] qt: expose showRemainingTime configuration option to QML
Pierre Lamot
pierre at videolabs.io
Wed Aug 7 15:52:09 CEST 2019
---
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 eb28983885..836af15a74 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 b93e075f40..282dd8d687 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 *,
@@ -117,6 +119,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:
@@ -203,6 +206,7 @@ public slots:
void setPlaylistDocked( bool );
void setPlaylistVisible( bool );
void setInterfaceAlwaysOnTop( bool );
+ void setShowRemainingTime( bool );
void emitBoss();
void emitRaise();
@@ -255,6 +259,7 @@ signals:
void interfaceAlwaysOnTopChanged(bool);
void interfaceFullScreenChanged(bool);
void hasEmbededVideoChanged(bool);
+ void showRemainingTimeChanged(bool);
};
#endif
--
2.17.1
More information about the vlc-devel
mailing list