QTfrontend/hwform.cpp
changeset 8384 a6e7a95f3b2e
parent 8383 b557c73a7593
child 8385 9e8924ff9813
--- a/QTfrontend/hwform.cpp	Mon Jan 14 13:19:47 2013 +0100
+++ b/QTfrontend/hwform.cpp	Mon Jan 14 13:28:03 2013 +0100
@@ -352,6 +352,7 @@
     }
 
     PagesStack.push(ID_PAGE_MAIN);
+    ((AbstractPage*)ui.Pages->widget(ID_PAGE_MAIN))->triggerPageEnter();
     GoBack();
 }
 
@@ -597,6 +598,10 @@
     
     qDebug("Leaving %s, entering %s", qPrintable(stringifyPageId(lastid)), qPrintable(stringifyPageId(id)));
 
+    // pageEnter and pageLeave events
+    ((AbstractPage*)ui.Pages->widget(lastid))->triggerPageLeave();    
+    ((AbstractPage*)ui.Pages->widget(id))->triggerPageEnter();
+
     if (id == ID_PAGE_DATADOWNLOAD)
     {
         ui.pageDataDownload->fetchList();
@@ -668,10 +673,6 @@
             curTeamSelWidget->resetPlayingTeams(teamsList);
         }
     }
-    else if (id == ID_PAGE_GAMESTATS)
-    {
-        ui.pageGameStats->renderStats();
-    }
 
     if (id == ID_PAGE_MAIN)
     {
@@ -701,6 +702,7 @@
     unnecessary.
    */
 
+
 #if (QT_VERSION >= 0x040600)
     if (!stopAnim)
     {
@@ -768,6 +770,7 @@
     int curid = ui.Pages->currentIndex();
     if (curid == ID_PAGE_MAIN)
     {
+        ((AbstractPage*)ui.Pages->widget(ID_PAGE_MAIN))->triggerPageLeave();
         if (!ui.pageVideos->tryQuit(this))
             return;
         stopAnim = true;