[Jahshaka-cvs] SF.net SVN: editopia:[221] cinesuite/cineplay-cinecode/trunk/src
Status: Beta
Brought to you by:
jahshaka
From: <tim...@us...> - 2008-11-03 19:45:49
|
Revision: 221 http://editopia.svn.sourceforge.net/editopia/?rev=221&view=rev Author: timdewhirst Date: 2008-11-03 19:45:45 +0000 (Mon, 03 Nov 2008) Log Message: ----------- cinesuite * fix for favourites not working * re-instate cineplay banner image Modified Paths: -------------- cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp cinesuite/cineplay-cinecode/trunk/src/CinePlay.cpp cinesuite/cineplay-cinecode/trunk/src/Common.cpp cinesuite/cineplay-cinecode/trunk/src/Common.h cinesuite/cineplay-cinecode/trunk/src/PlayList.cpp Modified: cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp 2008-11-03 10:54:28 UTC (rev 220) +++ cinesuite/cineplay-cinecode/trunk/src/CineCode.cpp 2008-11-03 19:45:45 UTC (rev 221) @@ -93,7 +93,7 @@ encode->addAction( tr( "set &in point" ), this, SLOT( onSetInPoint() ) ); encode->addAction( tr( "set &out point" ), this, SLOT( onSetOutPoint() ) ); encode->addAction( tr( "&reset in/out points" ), this, SLOT( onResetInOutPoints() ) ); - m_impl->m_helpMenu->addMenu( encode ); + m_impl->m_menubar->insertMenu( m_impl->m_helpMenuAction, encode ); // encode button connect( CineUtils::FindWidget( WIDGET_ENCODE, this ), SIGNAL( clicked() ), Modified: cinesuite/cineplay-cinecode/trunk/src/CinePlay.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/CinePlay.cpp 2008-11-03 10:54:28 UTC (rev 220) +++ cinesuite/cineplay-cinecode/trunk/src/CinePlay.cpp 2008-11-03 19:45:45 UTC (rev 221) @@ -64,6 +64,9 @@ if ( !m_impl->init( args ) ) return false; + // setup UI + ui.banner->setPixmap( QPixmap( ":/images/cineplay_banner" ) ); + // favorites tray... m_favoritesTray = new Tray( this, Tray::LOCATION_RIGHT ); m_impl->m_trays[ "favorites_tray" ] = m_favoritesTray; @@ -225,6 +228,7 @@ QApplication::setColorSpec( QApplication::CustomColor ); QApplication a( argc, argv ); + a.setWindowIcon( QIcon( ":/images/cineplay_48" ) ); a.setApplicationName( "CinePlay" ); // deliberately not translated a.setOrganizationName( CINE_ORG ); Modified: cinesuite/cineplay-cinecode/trunk/src/Common.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/Common.cpp 2008-11-03 10:54:28 UTC (rev 220) +++ cinesuite/cineplay-cinecode/trunk/src/Common.cpp 2008-11-03 19:45:45 UTC (rev 221) @@ -193,7 +193,7 @@ // mru menu m_mruMenu = new QMenu( tr( "open &recent" ), m_menubar ); - m_mruList.BuildMenu( m_mruMenu, this, SLOT( onMruSelected(int) ) ); + m_mruList.BuildMenu( m_mruMenu, this, SLOT( onMruSelected() ) ); m_fileMenu->addAction( tr( "&open file..." ), this, SLOT( onLoad() ) ); m_fileMenu->addAction( tr( "open &url..." ), this, SLOT( onLoadUrl() ) ); @@ -226,7 +226,7 @@ m_windowMenu->addAction( tr( "&movie info" ), this, SLOT( onShowMovieInfo() ) ); m_favMenu = new QMenu( tr( "&favorites" ), m_menubar ); - m_favList->BuildMenu( m_favMenu, this, SLOT( onFavSelected(int) ) ); + m_favList->BuildMenu( m_favMenu, this, SLOT( onFavSelected() ) ); m_windowMenu->addAction( tr( "&add favorite" ), this, SLOT( onFavAdd() ) ); m_windowMenu->addAction( tr( "&remove favorite" ), this, SLOT( onFavRemove() ) ); @@ -242,7 +242,7 @@ m_helpMenu->addAction( tr( "&check for updates" ), this, SLOT( onCheckVersion() ) ); m_helpMenu->addAction( tr( "&website" ), this, SLOT( onGotoWebsite() ) ); m_helpMenu->addAction( tr( "&about" ), this, SLOT( onAbout() ) ); - m_menubar->addMenu( m_helpMenu ); + m_helpMenuAction = m_menubar->addMenu( m_helpMenu ); } Common::~Common() @@ -970,10 +970,16 @@ } -void Common::onMruSelected(int index) +void Common::onMruSelected() { DEBUG_LOG; + QAction* a = qobject_cast< QAction* >( sender() ); + if ( !a ) + return; + + int index = a->data().toInt(); + QString str = m_mruList.getUrl(index); if(!str.isEmpty()) @@ -983,10 +989,20 @@ } -void Common::onFavSelected(int index) +void Common::onFavSelected() { DEBUG_LOG; + QAction* a = qobject_cast< QAction* >( sender() ); + if ( !a ) + return; + + onFavSelected( a->data().toInt() ); +} + +void Common::onFavSelected( int index ) +{ + DEBUG_LOG; // skip on until we find a valid favourite while ( !m_favList->isValid( index ) && index < m_favList->getEntryCount() ) ++index; @@ -1619,7 +1635,7 @@ //add to mru QString fname = le->filename(); m_mruList.pushUrl( fname ); - m_mruList.BuildMenu(m_mruMenu, this, SLOT( onMruSelected(int) ) ); + m_mruList.BuildMenu(m_mruMenu, this, SLOT( onMruSelected() ) ); m_mruItemAction->setEnabled( true ); m_lastFile = fname; m_lastFrame = 0; Modified: cinesuite/cineplay-cinecode/trunk/src/Common.h =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/Common.h 2008-11-03 10:54:28 UTC (rev 220) +++ cinesuite/cineplay-cinecode/trunk/src/Common.h 2008-11-03 19:45:45 UTC (rev 221) @@ -106,8 +106,9 @@ void onCheckRelease( const bool ); void checkReleaseDone( const bool, const bool ); void onGotoWebsite(); - void onMruSelected(int); - void onFavSelected(int); + void onMruSelected(); + void onFavSelected(); + void onFavSelected( int index ); void onFavAdd(); void onFavRemove(); void updateFavMenu(); @@ -203,6 +204,7 @@ QMenu* m_favMenu; QAction* m_favItemAction; QMenu* m_helpMenu; + QAction* m_helpMenuAction; QPoint m_dragClickPos; QSize m_dragAppSize; Modified: cinesuite/cineplay-cinecode/trunk/src/PlayList.cpp =================================================================== --- cinesuite/cineplay-cinecode/trunk/src/PlayList.cpp 2008-11-03 10:54:28 UTC (rev 220) +++ cinesuite/cineplay-cinecode/trunk/src/PlayList.cpp 2008-11-03 19:45:45 UTC (rev 221) @@ -141,7 +141,8 @@ QString str = QString::number( static_cast<uint>(t+1) ) + ": "; str += m_urls[t]; - menu->addAction( str, receiver, slot ); + QAction* a = menu->addAction( str, receiver, slot ); + a->setData( t ); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |