From b96bf3722733e132cd0025d59c1d73ca14c9ef44 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 9 May 2014 05:28:27 +0100 Subject: [PATCH] Add repeat and video lock to settings --- source/app/PlaYUVerSettings.cpp | 22 +++++++++++++++++++--- source/app/PlaYUVerSettings.h | 24 ++++++++++++++---------- source/app/plaYUVerApp.cpp | 3 +++ 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/source/app/PlaYUVerSettings.cpp b/source/app/PlaYUVerSettings.cpp index bebc09a..a89127b 100755 --- a/source/app/PlaYUVerSettings.cpp +++ b/source/app/PlaYUVerSettings.cpp @@ -38,7 +38,7 @@ QPoint PlaYUVerSettings::mainWindowPos() return m_settings.value( "MainWindow/pos", QPoint( 200, 200 ) ).toPoint(); } -void PlaYUVerSettings::setMainWindowPos( const QPoint & pos ) +Void PlaYUVerSettings::setMainWindowPos( const QPoint & pos ) { m_settings.setValue( "MainWindow/pos", pos ); } @@ -48,7 +48,7 @@ QSize PlaYUVerSettings::mainWindowSize() return m_settings.value( "MainWindow/size", QSize( 500, 400 ) ).toSize(); } -void PlaYUVerSettings::setMainWindowSize( const QSize & size ) +Void PlaYUVerSettings::setMainWindowSize( const QSize & size ) { m_settings.setValue( "MainWindow/size", size ); } @@ -58,11 +58,27 @@ QString PlaYUVerSettings::lastOpenPath() return m_settings.value( "MainWindow/lastOpenPath", QDir::homePath() ).toString(); } -void PlaYUVerSettings::setLastOpenPath( const QString & path ) +Void PlaYUVerSettings::setLastOpenPath( const QString & path ) { m_settings.setValue( "MainWindow/lastOpenPath", path ); } +// - - - - - - - - - - - - PLaying Settings - - - - - - - - - - - - - - - - + +Bool PlaYUVerSettings::getRepeat() +{ + return m_settings.value( "PLaying/Repeat", false ).toBool(); +} +Bool PlaYUVerSettings::getVideoLock() +{ + return m_settings.value( "PLaying/VideoLock", false ).toBool(); +} +Void PlaYUVerSettings::setPlayingSettings( Bool repeat, Bool lock ) +{ + m_settings.setValue( "PLaying/Repeat", repeat ); + m_settings.setValue( "PLaying/VideoLock", lock ); +} + // - - - - - - - - - - - - - - Grid Settings - - - - - - - - - - - - - - - - - - GridManager::Style PlaYUVerSettings::gridStyle() diff --git a/source/app/PlaYUVerSettings.h b/source/app/PlaYUVerSettings.h index d370150..d093142 100755 --- a/source/app/PlaYUVerSettings.h +++ b/source/app/PlaYUVerSettings.h @@ -28,7 +28,7 @@ #include "config.h" #include - +#include "TypeDef.h" #include "GridManager.h" namespace plaYUVer @@ -42,26 +42,30 @@ public: // - - - - - - - - - - Main Window Settings - - - - - - - - - - - - - QPoint mainWindowPos(); - void setMainWindowPos( const QPoint &v ); + Void setMainWindowPos( const QPoint &v ); QSize mainWindowSize(); - void setMainWindowSize( const QSize &v ); + Void setMainWindowSize( const QSize &v ); QString lastOpenPath(); - void setLastOpenPath( const QString &v ); + Void setLastOpenPath( const QString &v ); + + Bool getRepeat(); + Bool getVideoLock(); + Void setPlayingSettings( Bool repeat, Bool lock ); // - - - - - - - - - - - - Grid Settings - - - - - - - - - - - - - - - GridManager::Style gridStyle(); - void setGridStyle( GridManager::Style v ); + Void setGridStyle( GridManager::Style v ); QColor gridColor(); - void setGridColor( const QColor &v ); + Void setGridColor( const QColor &v ); - int gridHSpacing(); - void setGridHSpacing( int v ); + Int gridHSpacing(); + Void setGridHSpacing( int v ); - int gridVSpacing(); - void setGridVSpacing( int v ); + Int gridVSpacing(); + Void setGridVSpacing( int v ); private: QSettings m_settings; diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index 6905c5a..36594be 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -1073,6 +1073,8 @@ Void plaYUVerApp::readSettings() move( pos ); resize( size ); m_cLastOpenPath = settings.lastOpenPath(); + m_arrayActions[VIDEO_LOOP_ACT]->setChecked( settings.getRepeat() ); + m_arrayActions[VIDEO_LOCK_ACT]->setChecked( settings.getVideoLock() ); } Void plaYUVerApp::writeSettings() @@ -1081,6 +1083,7 @@ Void plaYUVerApp::writeSettings() settings.setMainWindowPos( pos() ); settings.setMainWindowSize( size() ); settings.setLastOpenPath( m_cLastOpenPath ); + settings.setPlayingSettings( m_arrayActions[VIDEO_LOOP_ACT]->isChecked(), m_arrayActions[VIDEO_LOCK_ACT]->isChecked() ); } } // NAMESPACE