Merge branch 'devel' into develDevice

This commit is contained in:
jfmcarreira committed 2017-03-23 19:35:36 +00:00
commit bc2b3d040c
138 files changed
+23063 -17921

No files matched your search

+135 -124
View File
@@ -1,5 +1,5 @@
/* This file is a part of plaYUVer project
* Copyright (C) 2014-2015 by Luis Lucas (luisfrlucas@gmail.com)
* Copyright (C) 2014-2017 by Luis Lucas (luisfrlucas@gmail.com)
* Joao Carreira (jfmcarreira@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
@@ -22,43 +22,37 @@
* \brief Main definition of the PlaYUVerApp app
*/
#include <QtDebug>
#include "PlaYUVerApp.h"
#include <QAction>
#include <QActionGroup>
#include <QCloseEvent>
#include <QDoubleSpinBox>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QDoubleSpinBox>
#include <QActionGroup>
#include <QAction>
#include <QSignalMapper>
#include "PlaYUVerApp.h"
#include <QtDebug>
#ifdef USE_FERVOR
#include "fvupdater.h"
#endif
#include "lib/PlaYUVerCmdParser.h"
#include "PlaYUVerSubWindowHandle.h"
#include "AboutDialog.h"
#include "SubWindowAbstract.h"
#include "VideoSubWindow.h"
#include "VideoHandle.h"
#include "QualityHandle.h"
#include "ModulesHandle.h"
#include "DialogSubWindowSelector.h"
#include "ModulesHandle.h"
#include "PlaYUVerSubWindowHandle.h"
#include "QualityHandle.h"
#include "SubWindowAbstract.h"
#include "VideoHandle.h"
#include "VideoSubWindow.h"
#include "lib/PlaYUVerOptions.h"
#define SYNCHRONISED_ZOON 1
namespace plaYUVer
PlaYUVerApp::PlaYUVerApp()
: m_pcCurrentSubWindow( NULL ), m_pcCurrentVideoSubWindow( NULL ), m_pcAboutDialog( NULL )
{
PlaYUVerApp::PlaYUVerApp() :
m_pcCurrentSubWindow( NULL ),
m_pcCurrentVideoSubWindow( NULL ),
m_pcAboutDialog( NULL )
{
setWindowModality( Qt::ApplicationModal );
setWindowModality( Qt::NonModal );
// DBus
// DBus
#ifdef USE_QTDBUS
m_pDBusAdaptor = new PlaYUVerAppAdaptor( this );
#endif
@@ -90,44 +84,43 @@ PlaYUVerApp::PlaYUVerApp() :
connect( m_appModuleVideo, SIGNAL( changed() ), this, SLOT( update() ) );
connect( m_appModuleQuality, SIGNAL( changed() ), this, SLOT( update() ) );
connect( m_appModuleExtensions, SIGNAL( changed() ), this, SLOT( update() ) );
}
Bool PlaYUVerApp::parseArgs( Int argc, Char *argv[] )
Bool PlaYUVerApp::parseArgs( Int argc, Char* argv[] )
{
Bool bRet = false;
m_pcCmdParser = new PlaYUVerCmdParser();
m_pcCmdParser->config( argc, argv );
PlaYUVerOptions pcCmdParser;
std::vector<std::string> m_apcInputs;
std::string strResolution( "" );
std::string strPelFmt( "" );
std::vector<String> m_apcInputs;
String strResolution( "" );
String strPelFmt( "" );
m_pcCmdParser->Opts().addOptions()/**/
( "input,i", m_apcInputs, "input file" ) /**/
( "size,s", strResolution, "size (WxH)" ) /**/
( "pel_fmt", strPelFmt, "pixel format" );
pcCmdParser.addOptions() /**/
( "input,i", m_apcInputs, "input file" ) /**/
( "size,s", strResolution, "size (WxH)" ) /**/
( "pel_fmt", strPelFmt, "pixel format" );
if( !m_pcCmdParser->parse() )
if( !pcCmdParser.parse( argc, argv ) )
{
bRet |= true;
}
if( m_pcCmdParser->Opts()["help"]->count() )
if( pcCmdParser.hasOpt( "help" ) )
{
printf( "Usage: %s [options] input_file[s]\n", argv[0] );
m_pcCmdParser->Opts().doHelp( std::cout );
pcCmdParser.doHelp( std::cout );
bRet |= true;
}
if( m_pcCmdParser->Opts()["input"]->count() )
if( pcCmdParser.hasOpt( "input" ) )
{
for( UInt i = 1; i < m_apcInputs.size(); i++ )
{
loadFile( QString::fromStdString( m_apcInputs[i] ) );
}
}
std::list<const Char*>& argv_unhandled = m_pcCmdParser->getNoArgs();
for( std::list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++ )
std::list<const Char*>& argv_unhandled = pcCmdParser.getUnhandledArgs();
for( std::list<const Char*>::const_iterator it = argv_unhandled.begin();
it != argv_unhandled.end(); it++ )
{
loadFile( QString::fromStdString( *it ) );
}
@@ -143,7 +136,7 @@ Void PlaYUVerApp::about()
m_pcAboutDialog->exec();
}
Void PlaYUVerApp::closeEvent( QCloseEvent *event )
Void PlaYUVerApp::closeEvent( QCloseEvent* event )
{
Int mayCloseAll = true;
Int msgBoxCloseRet = QMessageBox::Yes;
@@ -151,35 +144,36 @@ Void PlaYUVerApp::closeEvent( QCloseEvent *event )
QList<SubWindowAbstract*> subWindowList = m_pcWindowHandle->findSubWindow();
if( subWindowList.size() >= 1 )
{
QMessageBox msgBoxClose( QMessageBox::Question, "PlaYUVer", "There are open files!", QMessageBox::Yes | QMessageBox::No, this );
QMessageBox msgBoxClose( QMessageBox::Question, "PlaYUVer", "There are open files!",
QMessageBox::Yes | QMessageBox::No, this );
msgBoxClose.setDefaultButton( QMessageBox::No );
msgBoxClose.setInformativeText( "Close all?" );
msgBoxCloseRet = msgBoxClose.exec();
}
switch( msgBoxCloseRet )
{
case QMessageBox::Yes:
mayCloseAll = true;
for( Int i = 0; i < subWindowList.size(); i++ )
{
mayCloseAll &= subWindowList.at( i )->mayClose();
}
case QMessageBox::Yes:
mayCloseAll = true;
for( Int i = 0; i < subWindowList.size(); i++ )
{
mayCloseAll &= subWindowList.at( i )->mayClose();
}
if( mayCloseAll )
{
//m_pcPlayingTimer->stop();
closeAll();
writeSettings();
event->accept();
}
else
{
if( mayCloseAll )
{
// m_pcPlayingTimer->stop();
closeAll();
writeSettings();
event->accept();
}
else
{
event->ignore();
}
break;
case QMessageBox::No:
default:
event->ignore();
}
break;
case QMessageBox::No:
default:
event->ignore();
}
}
@@ -200,18 +194,20 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
Void PlaYUVerApp::load( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
{
VideoSubWindow *videoSubWindow = PlaYUVerApp::findVideoStreamSubWindow( m_pcWindowHandle, fileName );
VideoSubWindow* videoSubWindow =
PlaYUVerApp::findVideoStreamSubWindow( m_pcWindowHandle, fileName );
if( videoSubWindow )
{
m_pcWindowHandle->setActiveSubWindow( videoSubWindow );
return;
}
videoSubWindow = new VideoSubWindow( VideoSubWindow::VIDEO_STREAM_SUBWINDOW ); //createSubWindow();
SubWindowAbstract *subWindow = videoSubWindow;
videoSubWindow =
new VideoSubWindow( VideoSubWindow::VIDEO_STREAM_SUBWINDOW ); // createSubWindow();
SubWindowAbstract* subWindow = videoSubWindow;
if( !pStreamInfo )
{
Int idx = findPlaYUVerStreamInfo( m_aRecentFileStreamInfo, fileName );
pStreamInfo = ( PlaYUVerStreamInfo* )( idx >= 0 ? &m_aRecentFileStreamInfo.at( idx ) : NULL );
pStreamInfo = (PlaYUVerStreamInfo*)( idx >= 0 ? &m_aRecentFileStreamInfo.at( idx ) : NULL );
}
try
@@ -229,9 +225,12 @@ Void PlaYUVerApp::load( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
m_pcWindowHandle->addSubWindow( videoSubWindow );
videoSubWindow->show();
connect( subWindow, SIGNAL( aboutToClose( SubWindowAbstract* ) ), m_appModuleVideo, SLOT( closeSubWindow( SubWindowAbstract* ) ) );
connect( subWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo, SLOT( zoomToFactorAll( double, QPoint ) ) );
connect( subWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo, SLOT( moveAllScrollBars( const QPoint ) ) );
connect( subWindow, SIGNAL( aboutToClose( SubWindowAbstract* ) ), m_appModuleVideo,
SLOT( closeSubWindow( SubWindowAbstract* ) ) );
connect( subWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ),
m_appModuleVideo, SLOT( zoomToFactorAll( double, QPoint ) ) );
connect( subWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo,
SLOT( moveAllScrollBars( const QPoint ) ) );
videoSubWindow->zoomToFit();
updateZoomFactorSBox();
@@ -248,10 +247,11 @@ Void PlaYUVerApp::load( QString fileName, PlaYUVerStreamInfo* pStreamInfo )
videoSubWindow->close();
}
}
catch( const char *msg )
catch( PlaYUVerFailure& e )
{
videoSubWindow->close();
QString warningMsg = "Cannot open file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + msg;
QString warningMsg = "Cannot open file " + QFileInfo( fileName ).fileName() +
" with the following error: \n" + e.what();
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
printMessage( warningMsg, LOG_ERROR );
}
@@ -279,11 +279,10 @@ Void PlaYUVerApp::open()
supported.append( " )" );
QStringList filter;
filter << supported
<< formatsList
<< tr( "All Files (*)" );
filter << supported << formatsList << tr( "All Files (*)" );
QStringList fileNameList = QFileDialog::getOpenFileNames( this, tr( "Open File" ), m_cLastOpenPath, filter.join( ";;" ) );
QStringList fileNameList = QFileDialog::getOpenFileNames( this, tr( "Open File" ),
m_cLastOpenPath, filter.join( ";;" ) );
for( Int i = 0; i < fileNameList.size(); i++ )
{
@@ -301,7 +300,7 @@ Void PlaYUVerApp::openDevice()
Void PlaYUVerApp::openRecent()
{
QAction *action = qobject_cast<QAction *>( sender() );
QAction* action = qobject_cast<QAction*>( sender() );
PlaYUVerStreamInfo recentFile = action->data().value<PlaYUVerStreamInfo>();
if( action )
loadFile( recentFile.m_cFilename, &recentFile );
@@ -311,7 +310,7 @@ Void PlaYUVerApp::save()
{
if( m_pcCurrentVideoSubWindow )
{
VideoSubWindow *saveWindow = m_pcCurrentVideoSubWindow;
VideoSubWindow* saveWindow = m_pcCurrentVideoSubWindow;
QString supported = tr( "Supported Files (" );
QStringList formatsList;
@@ -330,11 +329,10 @@ Void PlaYUVerApp::save()
supported.append( " )" );
QStringList filter;
filter << supported
<< formatsList
<< tr( "All Files (*)" );
filter << supported << formatsList << tr( "All Files (*)" );
QString fileName = QFileDialog::getSaveFileName( this, tr( "Open File" ), QString(), filter.join( ";;" ) );
QString fileName = QFileDialog::getSaveFileName( this, tr( "Open File" ), m_cLastOpenPath,
filter.join( ";;" ) );
if( !fileName.isEmpty() )
{
@@ -343,10 +341,11 @@ Void PlaYUVerApp::save()
{
saveWindow->save( fileName );
}
catch( const char *msg )
catch( PlaYUVerFailure& e )
{
QApplication::restoreOverrideCursor();
QString warningMsg = "Cannot save file " + QFileInfo( fileName ).fileName() + " with the following error: \n" + msg;
QString warningMsg = "Cannot save file " + QFileInfo( fileName ).fileName() +
" with the following error: \n" + e.what();
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
printMessage( warningMsg, LOG_ERROR );
return;
@@ -367,12 +366,14 @@ Void PlaYUVerApp::format()
addStreamInfoToRecentList( pcVideoSubWindow->getStreamInfo() );
}
}
catch( const char *msg )
catch( PlaYUVerFailure& e )
{
QString warningMsg = "Cannot change format of " + QFileInfo( pcVideoSubWindow->getCurrentFileName() ).fileName() + " with the following error: \n" + msg;
QString warningMsg = "Cannot change format of " +
QFileInfo( pcVideoSubWindow->getCurrentFileName() ).fileName() +
" with the following error: \n" + e.what();
QMessageBox::warning( this, QApplication::applicationName(), warningMsg );
printMessage( warningMsg, LOG_ERROR );
qDebug( ) << warningMsg;
qDebug() << warningMsg;
m_pcCurrentSubWindow->close();
}
m_pcCurrentSubWindow = NULL;
@@ -392,15 +393,15 @@ Void PlaYUVerApp::reload()
Void PlaYUVerApp::reloadAll()
{
UInt windowCategoryOrder[] =
{
SubWindowAbstract::VIDEO_STREAM_SUBWINDOW,
SubWindowAbstract::MODULE_SUBWINDOW,
SubWindowAbstract::MODULE_SUBWINDOW };
UInt windowCategoryOrder[] = {
SubWindowAbstract::VIDEO_STREAM_SUBWINDOW, SubWindowAbstract::MODULE_SUBWINDOW,
SubWindowAbstract::MODULE_SUBWINDOW,
};
for( UInt c = 0; c < 3; c++ )
{
QList<SubWindowAbstract*> subWindowList = m_pcWindowHandle->findSubWindow( windowCategoryOrder[c] );
QList<SubWindowAbstract*> subWindowList =
m_pcWindowHandle->findSubWindow( windowCategoryOrder[c] );
for( Int i = 0; i < subWindowList.size(); i++ )
{
subWindowList.at( i )->refreshSubWindow();
@@ -442,13 +443,13 @@ Void PlaYUVerApp::zoomToFit()
Void PlaYUVerApp::zoomToFitAll()
{
VideoSubWindow *videoSubWindow;
QList<SubWindowAbstract*> subWindowList = m_pcWindowHandle->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
VideoSubWindow* videoSubWindow;
QList<SubWindowAbstract*> subWindowList =
m_pcWindowHandle->findSubWindow( SubWindowAbstract::VIDEO_SUBWINDOW );
for( Int i = 0; i < subWindowList.size(); i++ )
{
videoSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
videoSubWindow->zoomToFit();
}
if( m_pcCurrentSubWindow )
updateZoomFactorSBox();
@@ -465,7 +466,7 @@ Void PlaYUVerApp::scaleFrame( int ratio )
Void PlaYUVerApp::zoomFromSBox( double zoom )
{
SubWindowAbstract *activeSubWindow = m_pcWindowHandle->activeSubWindow();
SubWindowAbstract* activeSubWindow = m_pcWindowHandle->activeSubWindow();
Double factor = zoom / 100;
if( activeSubWindow )
{
@@ -485,16 +486,16 @@ Void PlaYUVerApp::updateZoomFactorSBox()
// ----------------------- Drag and drop functions ----------------------
Void PlaYUVerApp::dragEnterEvent( QDragEnterEvent *event )
Void PlaYUVerApp::dragEnterEvent( QDragEnterEvent* event )
{
//setText(tr("<drop content>"));
//mdiArea->setBackgroundRole( QPalette::Highlight );
// setText(tr("<drop content>"));
// mdiArea->setBackgroundRole( QPalette::Highlight );
event->acceptProposedAction();
}
Void PlaYUVerApp::dropEvent( QDropEvent *event )
Void PlaYUVerApp::dropEvent( QDropEvent* event )
{
const QMimeData *mimeData = event->mimeData();
const QMimeData* mimeData = event->mimeData();
QList<QUrl> urlList = mimeData->urls();
if( urlList.size() == 1 )
{
@@ -506,11 +507,13 @@ Void PlaYUVerApp::dropEvent( QDropEvent *event )
// ----------------------- Sub Window Functions -----------------------
VideoSubWindow* PlaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager, const QString& fileName )
VideoSubWindow* PlaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHandle* windowManager,
const QString& fileName )
{
QString canonicalFilePath = QFileInfo( fileName ).canonicalFilePath();
VideoSubWindow* pcSubWindow;
QList<SubWindowAbstract*> subWindowList = windowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
QList<SubWindowAbstract*> subWindowList =
windowManager->findSubWindow( SubWindowAbstract::VIDEO_STREAM_SUBWINDOW );
for( Int i = 0; i < subWindowList.size(); i++ )
{
pcSubWindow = qobject_cast<VideoSubWindow*>( subWindowList.at( i ) );
@@ -524,9 +527,9 @@ VideoSubWindow* PlaYUVerApp::findVideoStreamSubWindow( const PlaYUVerSubWindowHa
Void PlaYUVerApp::update()
{
SubWindowAbstract *activeSubWindow = m_pcWindowHandle->activeSubWindow();
SubWindowAbstract* activeSubWindow = m_pcWindowHandle->activeSubWindow();
QCoreApplication::processEvents();
//if( activeSubWindow() != m_pcCurrentSubWindow )
// if( activeSubWindow() != m_pcCurrentSubWindow )
{
m_pcCurrentSubWindow = NULL;
m_pcCurrentVideoSubWindow = NULL;
@@ -636,7 +639,8 @@ Void PlaYUVerApp::createActions()
connect( m_arrayActions[SAVE_ACT], SIGNAL( triggered() ), this, SLOT( save() ) );
m_arrayActions[FORMAT_ACT] = new QAction( tr( "&Format" ), this );
m_arrayActions[FORMAT_ACT]->setIcon( QIcon::fromTheme( "transform-scale", QIcon( ":/images/configuredialog.png" ) ) );
m_arrayActions[FORMAT_ACT]->setIcon(
QIcon::fromTheme( "transform-scale", QIcon( ":/images/configuredialog.png" ) ) );
m_arrayActions[FORMAT_ACT]->setShortcut( Qt::CTRL + Qt::Key_F );
m_arrayActions[FORMAT_ACT]->setStatusTip( tr( "Open format dialog" ) );
connect( m_arrayActions[FORMAT_ACT], SIGNAL( triggered() ), this, SLOT( format() ) );
@@ -660,11 +664,13 @@ Void PlaYUVerApp::createActions()
m_arrayActions[CLOSE_ACT] = new QAction( tr( "&Close" ), this );
m_arrayActions[CLOSE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogCloseButton ) );
m_arrayActions[CLOSE_ACT]->setStatusTip( tr( "Close the active window" ) );
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), m_pcWindowHandle, SLOT( removeActiveSubWindow() ) );
connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), m_pcWindowHandle,
SLOT( removeActiveSubWindow() ) );
m_arrayActions[CLOSEALL_ACT] = new QAction( tr( "Close &All" ), this );
m_arrayActions[CLOSEALL_ACT]->setStatusTip( tr( "Close all the windows" ) );
connect( m_arrayActions[CLOSEALL_ACT], SIGNAL( triggered() ), m_pcWindowHandle, SLOT( removeAllSubWindow() ) );
connect( m_arrayActions[CLOSEALL_ACT], SIGNAL( triggered() ), m_pcWindowHandle,
SLOT( removeAllSubWindow() ) );
m_arrayActions[EXIT_ACT] = new QAction( tr( "E&xit" ), this );
m_arrayActions[EXIT_ACT]->setShortcuts( QKeySequence::Quit );
@@ -673,35 +679,41 @@ Void PlaYUVerApp::createActions()
// ------------ View ------------
mapperZoom = new QSignalMapper( this );
connect( mapperZoom, SIGNAL( mapped(int) ), this, SLOT( scaleFrame(int) ) );
connect( mapperZoom, SIGNAL( mapped( int ) ), this, SLOT( scaleFrame( int ) ) );
m_arrayActions[ZOOM_IN_ACT] = new QAction( tr( "Zoom &In (+25%)" ), this );
m_arrayActions[ZOOM_IN_ACT]->setIcon( QIcon::fromTheme( "zoom-in", QIcon( ":/images/zoomin.png" ) ) );
m_arrayActions[ZOOM_IN_ACT]->setIcon(
QIcon::fromTheme( "zoom-in", QIcon( ":/images/zoomin.png" ) ) );
m_arrayActions[ZOOM_IN_ACT]->setShortcut( tr( "Ctrl++" ) );
m_arrayActions[ZOOM_IN_ACT]->setStatusTip( tr( "Scale the image up by 25%" ) );
connect( m_arrayActions[ZOOM_IN_ACT], SIGNAL( triggered() ), mapperZoom, SLOT( map() ) );
mapperZoom->setMapping( m_arrayActions[ZOOM_IN_ACT], 125 );
m_arrayActions[ZOOM_OUT_ACT] = new QAction( tr( "Zoom &Out (-25%)" ), this );
m_arrayActions[ZOOM_OUT_ACT]->setIcon( QIcon::fromTheme( "zoom-out", QIcon( ":/images/zoomout.png" ) ) );
m_arrayActions[ZOOM_OUT_ACT]->setIcon(
QIcon::fromTheme( "zoom-out", QIcon( ":/images/zoomout.png" ) ) );
m_arrayActions[ZOOM_OUT_ACT]->setShortcut( tr( "Ctrl+-" ) );
m_arrayActions[ZOOM_OUT_ACT]->setStatusTip( tr( "Scale the image down by 25%" ) );
connect( m_arrayActions[ZOOM_OUT_ACT], SIGNAL( triggered() ), mapperZoom, SLOT( map() ) );
mapperZoom->setMapping( m_arrayActions[ZOOM_OUT_ACT], 80 );
m_arrayActions[ZOOM_NORMAL_ACT] = new QAction( tr( "&Normal Size" ), this );
m_arrayActions[ZOOM_NORMAL_ACT]->setIcon( QIcon::fromTheme( "zoom-original", QIcon( ":/images/zoomtonormal.png" ) ) );
m_arrayActions[ZOOM_NORMAL_ACT]->setIcon(
QIcon::fromTheme( "zoom-original", QIcon( ":/images/zoomtonormal.png" ) ) );
m_arrayActions[ZOOM_NORMAL_ACT]->setShortcut( tr( "Ctrl+N" ) );
m_arrayActions[ZOOM_NORMAL_ACT]->setStatusTip( tr( "Show the image at its original size" ) );
connect( m_arrayActions[ZOOM_NORMAL_ACT], SIGNAL( triggered() ), this, SLOT( normalSize() ) );
m_arrayActions[ZOOM_FIT_ACT] = new QAction( tr( "Zoom to &Fit" ), this );
m_arrayActions[ZOOM_FIT_ACT]->setIcon( QIcon::fromTheme( "zoom-fit-best", QIcon( ":/images/fittowindow.png" ) ) );
m_arrayActions[ZOOM_FIT_ACT]->setIcon(
QIcon::fromTheme( "zoom-fit-best", QIcon( ":/images/fittowindow.png" ) ) );
m_arrayActions[ZOOM_FIT_ACT]->setStatusTip( tr( "Zoom in or out to fit on the window." ) );
connect( m_arrayActions[ZOOM_FIT_ACT], SIGNAL( triggered() ), this, SLOT( zoomToFit() ) );
m_arrayActions[ZOOM_FIT_ALL_ACT] = new QAction( tr( "Zoom to Fit All" ), this );
//m_arrayActions[ZOOM_FIT_ALL_ACT]->setIcon( QIcon::fromTheme( "zoom-fit-best", QIcon( ":/images/fittowindow.png" ) ) );
// m_arrayActions[ZOOM_FIT_ALL_ACT]->setIcon( QIcon::fromTheme(
// "zoom-fit-best", QIcon( ":/images/fittowindow.png" ) )
// );
m_arrayActions[ZOOM_FIT_ALL_ACT]->setStatusTip( tr( "Apply zoom to fit to all windows" ) );
connect( m_arrayActions[ZOOM_FIT_ALL_ACT], SIGNAL( triggered() ), this, SLOT( zoomToFitAll() ) );
@@ -715,7 +727,8 @@ Void PlaYUVerApp::createActions()
#ifdef USE_FERVOR
m_arrayActions[UPDATE_ACT] = new QAction( tr( "&Update" ), this );
m_arrayActions[UPDATE_ACT]->setStatusTip( tr( "Check for updates" ) );
connect( m_arrayActions[UPDATE_ACT], SIGNAL( triggered() ), FvUpdater::sharedUpdater(), SLOT( CheckForUpdatesNotSilent() ) );
connect( m_arrayActions[UPDATE_ACT], SIGNAL( triggered() ), FvUpdater::sharedUpdater(),
SLOT( CheckForUpdatesNotSilent() ) );
#endif
m_arrayActions[ABOUT_ACT] = new QAction( tr( "&About" ), this );
@@ -760,12 +773,12 @@ Void PlaYUVerApp::createMenus()
m_arrayMenu[VIEW_MENU]->addSeparator();
// createPopupMenu() Returns a popup menu containing checkable entries for
// the toolbars and dock widgets present in the main window.
// createPopupMenu() Returns a popup menu containing checkable entries for
// the toolbars and dock widgets present in the main window.
m_arrayMenu[DOCK_VIEW_MENU] = createPopupMenu();
if( m_arrayMenu[DOCK_VIEW_MENU] )
{
QAction *actionPopupMenu = m_arrayMenu[VIEW_MENU]->addMenu( m_arrayMenu[DOCK_VIEW_MENU] );
QAction* actionPopupMenu = m_arrayMenu[VIEW_MENU]->addMenu( m_arrayMenu[DOCK_VIEW_MENU] );
actionPopupMenu->setText( tr( "&Toolbars/Docks" ) );
}
@@ -787,7 +800,6 @@ Void PlaYUVerApp::createMenus()
m_arrayMenu[ABOUT_MENU]->addSeparator();
m_arrayMenu[ABOUT_MENU]->addAction( m_arrayActions[ABOUT_ACT] );
m_arrayMenu[ABOUT_MENU]->addAction( m_arrayActions[ABOUTQT_ACT] );
}
Void PlaYUVerApp::createToolBars()
@@ -811,7 +823,8 @@ Void PlaYUVerApp::createToolBars()
m_pcZoomFactorSBox->setSingleStep( 10.0 );
m_pcZoomFactorSBox->setValue( 100.0 );
m_pcZoomFactorSBox->setSuffix( "%" );
connect( m_pcZoomFactorSBox, SIGNAL( valueChanged(double) ), this, SLOT( zoomFromSBox(double) ) );
connect( m_pcZoomFactorSBox, SIGNAL( valueChanged( double ) ), this,
SLOT( zoomFromSBox( double ) ) );
m_arrayToolBars[VIEW_TOOLBAR]->addWidget( m_pcZoomFactorSBox );
m_arrayToolBars[VIEW_TOOLBAR]->addAction( m_arrayActions[ZOOM_IN_ACT] );
m_arrayToolBars[VIEW_TOOLBAR]->addAction( m_arrayActions[ZOOM_OUT_ACT] );
@@ -822,12 +835,11 @@ Void PlaYUVerApp::createToolBars()
addToolBar( Qt::TopToolBarArea, m_arrayToolBars[VIEW_TOOLBAR] );
addToolBar( Qt::TopToolBarArea, m_appModuleVideo->createToolBar() );
}
Void PlaYUVerApp::createDockWidgets()
{
// Properties Dock Window
// Properties Dock Window
m_arraySideBars.resize( TOTAL_DOCK );
addDockWidget( Qt::RightDockWidgetArea, m_appModuleVideo->createDock() );
addDockWidget( Qt::RightDockWidgetArea, m_appModuleQuality->createDock() );
@@ -862,7 +874,8 @@ Void PlaYUVerApp::updateRecentFileActions()
m_arrayRecentFilesActions.at( actionIdx )->setText( QFileInfo( text ).fileName() );
m_arrayRecentFilesActions.at( actionIdx )->setToolTip( "Open File " + text );
m_arrayRecentFilesActions.at( actionIdx )->setStatusTip( "Open File " + text );
m_arrayRecentFilesActions.at( actionIdx )->setData( QVariant::fromValue( m_aRecentFileStreamInfo.at( actionIdx ) ) );
m_arrayRecentFilesActions.at( actionIdx )
->setData( QVariant::fromValue( m_aRecentFileStreamInfo.at( actionIdx ) ) );
m_arrayRecentFilesActions.at( actionIdx )->setVisible( true );
actionIdx++;
}
@@ -936,5 +949,3 @@ Void PlaYUVerApp::writeSettings()
m_appModuleExtensions->writeSettings();
m_pcWindowHandle->writeSettings();
}
} // NAMESPACE