Save current tool

This commit is contained in:
jfmcarreira committed 2014-05-19 00:55:46 +01:00
1 parent 93095363b8
commit 71b4a8fe5b
3 files changed
+18 -7

No files matched your search

+11 -1
View File
@@ -28,7 +28,7 @@ namespace plaYUVer
{
PlaYUVerSettings::PlaYUVerSettings() :
m_settings( "IT", "YUV Player" )
m_settings( "IT", "YUV Player" )
{
}
// - - - - - - - - - - - - Main Window Settings - - - - - - - - - - - - - - - -
@@ -63,6 +63,16 @@ Void PlaYUVerSettings::setLastOpenPath( const QString & path )
m_settings.setValue( "MainWindow/lastOpenPath", path );
}
Int PlaYUVerSettings::getSelectedTool()
{
return m_settings.value( "MainWindow/SelectedTool", NavigationTool ).toInt();
}
Void PlaYUVerSettings::setSelectedTool( Int tool )
{
m_settings.setValue( "MainWindow/SelectedTool", tool );
}
// - - - - - - - - - - - - PLaying Settings - - - - - - - - - - - - - - - -
Bool PlaYUVerSettings::getRepeat()
+3
View File
@@ -50,6 +50,9 @@ public:
QString lastOpenPath();
Void setLastOpenPath( const QString &v );
Int getSelectedTool();
Void setSelectedTool( Int);
Bool getRepeat();
Bool getVideoLock();
Void setPlayingSettings( Bool repeat, Bool lock );
+4 -6
View File
@@ -158,8 +158,7 @@ Void plaYUVerApp::loadFile( QString fileName )
interfaceChild->show();
connect( interfaceChild->getViewArea(), SIGNAL( positionChanged(const QPoint &, PlaYUVerFrame *) ), this,
SLOT( updatePixelValueStatusBar(const QPoint &, PlaYUVerFrame *) ) );
connect( interfaceChild->getViewArea(), SIGNAL( selectionChanged( QRect ) ), this,
SLOT( updatePropertiesSelectedArea( QRect ) ) );
connect( interfaceChild->getViewArea(), SIGNAL( selectionChanged( QRect ) ), this, SLOT( updatePropertiesSelectedArea( QRect ) ) );
interfaceChild->zoomToFit();
interfaceChild->getViewArea()->setTool( m_appTool );
@@ -676,17 +675,13 @@ Void plaYUVerApp::dragEnterEvent( QDragEnterEvent *event )
{
//setText(tr("<drop content>"));
setBackgroundRole( QPalette::Highlight );
event->acceptProposedAction();
}
Void plaYUVerApp::dropEvent( QDropEvent *event )
{
const QMimeData *mimeData = event->mimeData();
QList<QUrl> urlList = mimeData->urls();
if( urlList.size() == 1 )
{
QString fileName = urlList.at( 0 ).toLocalFile();
@@ -1127,6 +1122,8 @@ Void plaYUVerApp::readSettings()
move( pos );
resize( size );
m_cLastOpenPath = settings.lastOpenPath();
m_appTool = ( enum eTool )settings.getSelectedTool();
setAllSubWindowTool();
m_arrayActions[VIDEO_LOOP_ACT]->setChecked( settings.getRepeat() );
m_arrayActions[VIDEO_LOCK_ACT]->setChecked( settings.getVideoLock() );
}
@@ -1137,6 +1134,7 @@ Void plaYUVerApp::writeSettings()
settings.setMainWindowPos( pos() );
settings.setMainWindowSize( size() );
settings.setLastOpenPath( m_cLastOpenPath );
settings.setSelectedTool( (Int)m_appTool );
settings.setPlayingSettings( m_arrayActions[VIDEO_LOOP_ACT]->isChecked(), m_arrayActions[VIDEO_LOCK_ACT]->isChecked() );
}