Change code for tools. stop reading previous used tool

This commit is contained in:
jfmcarreira committed 2014-10-19 20:30:39 +01:00
1 parent 7b30b4a1b3
commit 55744503d8
5 files changed
+35 -27

No files matched your search

+1 -1
View File
@@ -65,7 +65,7 @@ Void PlaYUVerSettings::setLastOpenPath( const QString & path )
Int PlaYUVerSettings::getSelectedTool()
{
return m_settings.value( "MainWindow/SelectedTool", NavigationTool ).toInt();
return m_settings.value( "MainWindow/SelectedTool", ViewArea::NavigationTool ).toInt();
}
Void PlaYUVerSettings::setSelectedTool( Int tool )
+11 -3
View File
@@ -53,6 +53,14 @@ public:
{
NormalMode, MaskMode,
};
typedef enum
{
NavigationTool,
NormalSelectionTool,
BlockSelectionTool,
MaskTool,
EraserTool
}eTool;
ViewArea( QWidget *parent = 0 );
@@ -90,7 +98,7 @@ public:
{
return m_mode;
}
enum eTool tool() const
eTool tool() const
{
return m_tool;
}
@@ -109,7 +117,7 @@ public:
Void zoomChangeEvent(Double factor, QPoint center);
void setTool( enum eTool tool );
void setTool( eTool tool );
// QSize sizeHint() const;
@@ -161,7 +169,7 @@ private:
QPoint m_lastWindowPos;
GridManager m_grid;
ViewMode m_mode;
enum eTool m_tool;
eTool m_tool;
QColor m_maskColor;
double m_zoomFactor;
int m_xOffset;
+13 -13
View File
@@ -983,15 +983,9 @@ SubWindowHandle* plaYUVerApp::findSubWindow( const QMdiArea* mdiArea, const SubW
return 0;
}
Void plaYUVerApp::setNavigationTool()
Void plaYUVerApp::setTool( Int idxTool )
{
m_appTool = NavigationTool;
setAllSubWindowTool();
}
Void plaYUVerApp::setSelectionTool()
{
m_appTool = NormalSelectionTool;
m_appTool = (ViewArea::eTool ) idxTool;
setAllSubWindowTool();
}
@@ -1273,19 +1267,25 @@ Void plaYUVerApp::createActions()
actionGroupTools = new QActionGroup( this );
actionGroupTools->setExclusive( true );
m_appTool = NavigationTool;
m_mapperTools = new QSignalMapper( this );
connect( m_mapperTools, SIGNAL( mapped(int) ), this, SLOT( setTool(int) ) );
m_appTool = ViewArea::NavigationTool;
m_arrayActions[NAVIGATION_TOOL_ACT] = new QAction( tr( "&Navigation Tool" ), this );
m_arrayActions[NAVIGATION_TOOL_ACT]->setCheckable( true );
m_arrayActions[NAVIGATION_TOOL_ACT]->setChecked( true );
actionGroupTools->addAction( m_arrayActions[NAVIGATION_TOOL_ACT] );
connect( m_arrayActions[NAVIGATION_TOOL_ACT], SIGNAL( triggered() ), this, SLOT( setNavigationTool() ) );
connect( m_arrayActions[NAVIGATION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools, SLOT( map() ) );
m_mapperTools->setMapping( m_arrayActions[NAVIGATION_TOOL_ACT], ViewArea::NavigationTool );
m_arrayActions[SELECTION_TOOL_ACT] = new QAction( "&Selection Tool", this );
m_arrayActions[SELECTION_TOOL_ACT]->setCheckable( true );
m_arrayActions[SELECTION_TOOL_ACT]->setChecked( false );
actionGroupTools->addAction( m_arrayActions[SELECTION_TOOL_ACT] );
connect( m_arrayActions[SELECTION_TOOL_ACT], SIGNAL( triggered() ), this, SLOT( setSelectionTool() ) );
connect( m_arrayActions[SELECTION_TOOL_ACT], SIGNAL( triggered() ), m_mapperTools, SLOT( map() ) );
m_mapperTools->setMapping( m_arrayActions[SELECTION_TOOL_ACT], ViewArea::NormalSelectionTool );
// ------------ Window ------------
@@ -1495,8 +1495,8 @@ Void plaYUVerApp::readSettings()
move( pos );
resize( size );
m_cLastOpenPath = settings.lastOpenPath();
m_appTool = ( enum eTool )settings.getSelectedTool();
setAllSubWindowTool();
//m_appTool = ( ViewArea::eTool )settings.getSelectedTool();
//setAllSubWindowTool();
m_arrayActions[VIDEO_LOOP_ACT]->setChecked( settings.getRepeat() );
m_arrayActions[VIDEO_LOCK_ACT]->setChecked( settings.getVideoLock() );
+10 -5
View File
@@ -113,8 +113,7 @@ private Q_SLOTS:
void updateZoomFactorSBox();
void setAllSubWindowTool();
void setNavigationTool();
void setSelectionTool();
void setTool( int idxTool );
private:
@@ -295,9 +294,15 @@ private:
// Tools Actions;
QActionGroup *actionGroupTools;
QAction *actionNavigationTool;
QAction *actionSelectionTool;
enum eTool m_appTool;
enum APP_TOOLS_ACTION_LIST
{
NAVIGATION_TOOL,
SELECTION_TOOL,
TOTAL_TOOLS,
};
QVector<QAction*> m_arrayTools;
QSignalMapper *m_mapperTools;
ViewArea::eTool m_appTool;
PlaYUVerStreamInfoVector m_aRecentFileStreamInfo;
-5
View File
@@ -146,11 +146,6 @@ typedef struct __pixel_definition
};
}Pixel;
enum eTool
{
NavigationTool, NormalSelectionTool, BlockSelectionTool, MaskTool, EraserTool
};
} // NAMESPACE
#endif // __TYPEDEF_H__