extragear/multimedia/amarok/src

Mark Kretschmann kretschmann at kde.org
Fri Mar 13 20:05:42 CET 2009


SVN commit 939066 by markey:

Continue work on a first-run-tutorial which was first started by Jeff
Mitchell (jefferai).

We've currently reached the point where the tutorial displays one page
with nicely formatted text in it, and a Close button. Further pages (not
too many, I suggest) could be added, for explaining the basic usage of
Amarok (especially the 3 panes concept). Also graphics could be added
for WOW-factor.

I've deliberately left out i18n() for the text until we have it
finalized, so that this won't get too messy for translators.

To enable the tutorial, set "FirstRunTutorial" in amarokrc (General
section) = true.

CCMAIL: amarok-devel at kde.org

 M  +3 -1      App.cpp  
 M  +1 -0      CMakeLists.txt  
 M  +17 -4     firstruntutorial/FirstRunTutorial.cpp  
 M  +1 -0      firstruntutorial/FirstRunTutorial.h  
 A             firstruntutorial/FirstRunTutorialPage.cpp   [License: GPL (v2+)]
 A             firstruntutorial/FirstRunTutorialPage.h   [License: GPL (v2+)]


--- trunk/extragear/multimedia/amarok/src/App.cpp #939065:939066
@@ -620,10 +620,12 @@
     m_splash = 0;
     PERF_LOG( "App init done" )
     KConfigGroup config = KGlobal::config()->group( "General" );
-    const bool firstruntut = config.readEntry( "FirstRunTutorial", false );
+
+    const bool firstruntut = config.readEntry( "FirstRunTutorial", true );
     debug() << "Checking whether to run first run tutorial..." << firstruntut;
     if( firstruntut )
     {
+        config.writeEntry( "FirstRunTutorial", false );
         debug() << "Starting first run tutorial";
         FirstRunTutorial *frt = new FirstRunTutorial( mainWindow() );
         QTimer::singleShot( 1000, frt, SLOT( initOverlay() ) );
--- trunk/extragear/multimedia/amarok/src/CMakeLists.txt #939065:939066
@@ -475,6 +475,7 @@
     browsers/filebrowser/MyDirOperator.cpp
     browsers/filebrowser/kbookmarkhandler.cpp
     firstruntutorial/FirstRunTutorial.cpp
+    firstruntutorial/FirstRunTutorialPage.cpp
     MountPointManager.cpp
     PaletteHandler.cpp
     PopupDropperFactory.cpp
--- trunk/extragear/multimedia/amarok/src/firstruntutorial/FirstRunTutorial.cpp #939065:939066
@@ -11,10 +11,11 @@
  *                                                                         *
  ***************************************************************************/
 
-
 #include "FirstRunTutorial.h"
 
 #include "Debug.h"
+#include "FirstRunTutorialPage.h"
+#include "MainWindow.h"
 
 #include <QChar>
 #include <QString>
@@ -32,8 +33,7 @@
     , m_framesMax( 60 )
     , m_itemSet()
     , m_pageNum( 0 )
-{
-}
+{}
 
 FirstRunTutorial::~FirstRunTutorial()
 {
@@ -46,6 +46,7 @@
 FirstRunTutorial::initOverlay() //SLOT
 {
     DEBUG_BLOCK
+
     m_scene = new QGraphicsScene( m_parent );
     m_view = new QGraphicsView( m_scene, m_parent );
     m_scene->setSceneRect( QRectF( m_parent->rect() ) );
@@ -71,6 +72,7 @@
     m_fadeHideTimer.setCurrentTime( 0 );
     m_fadeHideTimer.setFrameRange( 0, 60 );
     m_fadeHideTimer.setCurveShape( QTimeLine::EaseOutCurve );
+
     connect( &m_fadeShowTimer, SIGNAL( frameChanged(int) ), this, SLOT( fadeShowTimerFrameChanged(int) ) );
     connect( &m_fadeHideTimer, SIGNAL( frameChanged(int) ), this, SLOT( fadeHideTimerFrameChanged(int) ) );
     connect( &m_fadeShowTimer, SIGNAL( finished() ), this, SLOT( fadeShowTimerFinished() ) );
@@ -82,6 +84,7 @@
 FirstRunTutorial::fadeShowTimerFrameChanged( int frame ) //SLOT
 {
     DEBUG_BLOCK
+
     if( m_fadeShowTimer.state() == QTimeLine::Running && m_pageNum == 0 )
     {
         qreal val = ( frame * 1.0 ) / m_framesMax;
@@ -97,6 +100,7 @@
 FirstRunTutorial::fadeShowTimerFinished() //SLOT
 {
     DEBUG_BLOCK
+
     if( m_pageNum == 0 )
     {
         QColor color = Qt::blue;
@@ -112,6 +116,7 @@
 FirstRunTutorial::fadeHideTimerFrameChanged( int frame ) //SLOT
 {
     DEBUG_BLOCK
+
     if( m_fadeHideTimer.state() == QTimeLine::Running && m_pageNum == 0 )
     {
         qreal val = ( frame * 1.0 ) / m_framesMax;
@@ -127,6 +132,7 @@
 FirstRunTutorial::fadeHideTimerFinished() //SLOT
 {
     DEBUG_BLOCK
+
     if( m_pageNum == MAX_PAGE )
     {
         QColor color = Qt::blue;
@@ -163,7 +169,14 @@
 void FirstRunTutorial::slotPage1() //SLOT
 {
     DEBUG_BLOCK
-    m_fadeHideTimer.start();
+
+    FirstRunTutorialPage* page = new FirstRunTutorialPage();
+    page->setGeometry( The::mainWindow()->geometry().adjusted( 200, 200, -200, -200 ) );
+
+    m_scene->addItem( page );
+    connect( page, SIGNAL( destroyed() ), &m_fadeHideTimer, SLOT( start() ) );
+
+    //m_fadeHideTimer.start();
 }
 
 #include "FirstRunTutorial.moc"
--- trunk/extragear/multimedia/amarok/src/firstruntutorial/FirstRunTutorial.h #939065:939066
@@ -24,6 +24,7 @@
 class FirstRunTutorial : public QObject
 {
     Q_OBJECT
+
     public:
         FirstRunTutorial( QWidget *parent );
         ~FirstRunTutorial();


More information about the Amarok-devel mailing list