]> git.vomp.tv Git - vompclient.git/commitdiff
Switch over to updateView rather than show, EPG tweaks
authorChris Tallon <chris@vomp.tv>
Wed, 7 Dec 2005 23:03:00 +0000 (23:03 +0000)
committerChris Tallon <chris@vomp.tv>
Wed, 7 Dec 2005 23:03:00 +0000 (23:03 +0000)
23 files changed:
box.cc
box.h
command.cc
vchannellist.cc
vchannelselect.cc
vconnect.cc
vepg.cc
vepg.h
view.h
viewman.cc
vlivebanner.cc
vmute.cc
voptions.cc
voptions.h
vquestion.cc
vrecordinglist.cc
vrecordinglist.h
vrecordingmenu.cc
vserverselect.cc
vvideolive.cc
vvolume.cc
vwelcome.cc
vwelcome.h

diff --git a/box.cc b/box.cc
index 3c7a5d5efcfb2d09ae71d833bb83d849591902a4..2a72bc532cc9611747ca82658201d1726e8c4143 100644 (file)
--- a/box.cc
+++ b/box.cc
@@ -62,10 +62,10 @@ void Box::setSurfaceOffset(UINT x, UINT y)
 
 void Box::show()
 {
-  show(area);
+  blt(area);
 }
 
-void Box::show(Region& r)
+void Box::blt(Region& r)
 {
   Log::getInstance()->log("Box", Log::DEBUG, "Show region %p %u %u %u %u", surface, r.x, r.y, r.w, r.h);
 //  surface->updateToScreen(area.x, area.y, area.w, area.h);
diff --git a/box.h b/box.h
index 50d5598965730bad3e3924dd5a18cf92b947d345..b9ea1a323999d0a74133ec2b15c322c81f6f333f 100644 (file)
--- a/box.h
+++ b/box.h
@@ -35,11 +35,11 @@ class Box
     Box();
     virtual ~Box();
 
-    void setScreenPos(int x, int y);
+    void setScreenPos(int x, int y); // Even numbers only!!!
     void setSurfaceOffset(UINT x, UINT y);
 
-    void show();
-    void show(Region& r);
+    void show(); // Obselete
+    void blt(Region& r); // For use only by ViewMan
 
     virtual void draw();
 
@@ -48,7 +48,7 @@ class Box
     void drawPara(char* text, int x, int y, Colour& colour);
 
     // Drawing functions level 0
-    void rectangle(int x1, int y1, int x2, int y2, Colour& colour);
+    void rectangle(int x1, int y1, int w, int h, Colour& colour);
     void drawText(char* text, int x, int y, Colour& colour);
     void drawTextRJ(char* text, int x, int y, Colour& colour);
     void drawTextCentre(char* text, int x, int y, Colour& colour);
index b44106db79d131030bdec6ab5cb110ba8df8e801..2ac60ad6fe21bf6347e9c0b1dddcf099bcce005a 100644 (file)
@@ -96,8 +96,8 @@ void Command::run()
   v->create(video->getScreenWidth(), video->getScreenHeight());
   v->setBackgroundColour(Colour::VIDEOBLUE);
   v->draw();
-  v->show();
   viewman->add(v);
+  viewman->updateView(v);
   viewman->removeView(v);
 
   // Wallpaper
@@ -113,8 +113,8 @@ void Command::run()
     wallpaper->init("/wallpaperNTSC.jpg");
   }
   wallpaper->draw();
-  wallpaper->show();
   viewman->add(wallpaper);
+  viewman->updateView(wallpaper);
 
   // End of startup. Lock the mutex and put the first view up
 
@@ -246,16 +246,16 @@ void Command::handleCommand(int button)
     case Remote::VOLUMEDOWN:
     {
       VVolume* v = new VVolume();
-      v->handleCommand(button); // this will draw+show
       viewman->add(v);
+      v->handleCommand(button); // this will draw+show
       return;
     }
     case Remote::MUTE:
     {
       VMute* v = new VMute();
       v->draw();
-      v->show();
       viewman->add(v);
+      viewman->updateView(v);
       return;
     }
     case Remote::POWER:
@@ -290,7 +290,7 @@ void Command::doStandby()
   {
     Video::getInstance()->signalOff();
     viewman->removeAll();
-    wallpaper->show();
+    viewman->updateView(wallpaper);
 
     VDR::getInstance()->configSave("General", "Last Power State", "Off");
     VDR::getInstance()->disconnect();
@@ -322,9 +322,8 @@ void Command::doJustConnected(VConnect* vconnect)
 
   vi->setOneLiner(tr("Connected, loading config"));
   vi->draw();
-  vi->show();
   viewman->add(vi);
-
+  viewman->updateView(vi);
 
   VDR* vdr = VDR::getInstance();
   char* config;
@@ -492,6 +491,6 @@ void Command::doJustConnected(VConnect* vconnect)
 
   VWelcome* vw = new VWelcome();
   vw->draw();
-  vw->show();
   viewman->add(vw);
+  viewman->updateView(vw);
 }
index 69d2ce009f47c3bb476946be53c18bc8e0862481..364856140b988bca237150f6f3202c43636b5b26 100644 (file)
@@ -150,7 +150,7 @@ int VChannelList::handleCommand(int command)
       sl.draw();
 
       doShowingBar();
-      show();
+      ViewMan::getInstance()->updateView(this);
       return 2;
     }
     case Remote::DF_DOWN:
@@ -160,7 +160,7 @@ int VChannelList::handleCommand(int command)
       sl.draw();
 
       doShowingBar();
-      show();
+      ViewMan::getInstance()->updateView(this);
       return 2;
     }
     case Remote::SKIPBACK:
@@ -169,7 +169,7 @@ int VChannelList::handleCommand(int command)
       sl.draw();
 
       doShowingBar();
-      show();
+      ViewMan::getInstance()->updateView(this);
       return 2;
     }
     case Remote::SKIPFORWARD:
@@ -178,7 +178,7 @@ int VChannelList::handleCommand(int command)
       sl.draw();
 
       doShowingBar();
-      show();
+      ViewMan::getInstance()->updateView(this);
       return 2;
     }
     case Remote::OK:
@@ -203,9 +203,9 @@ int VChannelList::handleCommand(int command)
       VVideoLive* v = new VVideoLive(chanList, chan->type);
       v->channelChange(VVideoLive::NUMBER, chan->number);
 
-      ViewMan::getInstance()->add(v);
       v->draw();
-      v->show();
+      ViewMan::getInstance()->add(v);
+      ViewMan::getInstance()->updateView(v);
 
       return 2;
     }
index 14b4e0146b50bf8a4c680b2f0decc2c47789eb2b..bd773152e9e4a85370b364327d7c1ddf4e23bd66 100644 (file)
@@ -111,7 +111,7 @@ int VChannelSelect::handleCommand(int command)
       ++numGot;
 
       draw();
-      show();
+      ViewMan::getInstance()->updateView(this);
 
       if (numGot == 3)
       {
index dbcbb4bf9c3b549c3fdb7e6a137178b45cd344a4..eab08b1f7bb6a6a6844dfa96462ada1fee5bd432 100644 (file)
@@ -74,7 +74,7 @@ void VConnect::threadMethod()
   {
     setOneLiner(tr("Locating server"));
     draw();
-    show();
+    viewman->updateView(this);
 
     vdr->findServers(serverIPs);
     if (!irun)
@@ -94,9 +94,10 @@ void VConnect::threadMethod()
       VServerSelect* vs = new VServerSelect(&serverIPs);
       vs->setParent(this);
       vs->draw();
-      vs->show();
       viewman->add(vs);  // FIXME - do this better - perhaps post message to Command
                          // Otherwise it will be using ViewMan without the Command mutex locked
+      viewman->updateView(vs);
+
       threadLock();
       threadWaitForSignal();
       threadUnlock();
@@ -118,7 +119,7 @@ void VConnect::threadMethod()
 
     setOneLiner(tr("Connecting to VDR"));
     draw();
-    show();
+    viewman->updateView(this);
 
     success = vdr->connect();
     if (success)
@@ -147,7 +148,7 @@ void VConnect::threadMethod()
     }
 
     draw();
-    show();
+    viewman->updateView(this);
     nanosleep(&ts, NULL);
 
   } while(!success);
diff --git a/vepg.cc b/vepg.cc
index 0f16515c2ed5e6852dd0e2c7e759082a0b9379a6..88e38a2d12bcc23f89a756123618b37fb6d02e4c 100644 (file)
--- a/vepg.cc
+++ b/vepg.cc
@@ -35,6 +35,8 @@
 \r
 VEpg::VEpg(VVideoLive* v, UINT currentChannel)\r
 {\r
+  viewman = ViewMan::getInstance();\r
+\r
   for(UINT listIndex = 0; listIndex < 7; listIndex++)\r
   {\r
     // initialise array of pointers to eventlist structures\r
@@ -145,13 +147,12 @@ void VEpg::setInfo(Event* event)
 void VEpg::draw()\r
 {\r
   View::draw(); // draw pallet\r
-  chanListbox.draw();\r
-  drawgrid();\r
-  chanName.draw(); // TODO this should be dealt with by vvideolive\r
-  progTitle.draw();\r
-  progInfo.draw();\r
 \r
-// Display the status and key stuff at the bottom\r
+  // Moved all the dynamic data drawing to a seperate function\r
+\r
+\r
+  Log::getInstance()->log("EPG", Log::DEBUG, "START TIME");\r
+  // Display the status and key stuff at the bottom\r
   int keyx = chanListbox.getOffsetX();\r
   int keyy = chanListbox.getOffsetY() + chanListbox.getHeight() + 2;\r
   surface->fillblt(keyx, keyy, 610, Surface::getFontHeight() * 2 + 14, surface->rgba(100, 100, 100, 255));\r
@@ -193,8 +194,8 @@ void VEpg::draw()
   drawText(tr("Guide / Back: Close"), keyx + 292 , keyy + 5, Colour::LIGHTTEXT);\r
 \r
   surface->fillblt(keyx + 290, keyy + Surface::getFontHeight() + 8, 180, Surface::getFontHeight() + 2, surface->rgba( 180, 180, 180, 255));\r
-  Colour red = Colour(130, 0, 0);\r
-  drawText(tr("Rec: Set timer"), keyx + 292, keyy + Surface::getFontHeight() + 9, red);\r
+//  Colour red = Colour(130, 0, 0);\r
+//  drawText(tr("Rec: Set timer"), keyx + 292, keyy + Surface::getFontHeight() + 9, red);\r
 \r
   surface->fillblt(keyx + 474, keyy + 4, 128, Surface::getFontHeight() + 2, surface->rgba( 180, 180, 180, 255));\r
   w.nextSymbol = WSymbol::PLAY;\r
@@ -204,8 +205,35 @@ void VEpg::draw()
 \r
   surface->fillblt(keyx + 474, keyy + Surface::getFontHeight() + 8, 128, Surface::getFontHeight() + 2, surface->rgba( 180, 180, 180, 255));\r
   drawText(tr("Go: Preview"), keyx + 476, keyy + Surface::getFontHeight() + 9, Colour::LIGHTTEXT);\r
+\r
+\r
+  Log::getInstance()->log("EPG", Log::DEBUG, "END TIME");\r
+\r
+  // Draw all the dynamic data\r
+  drawData();\r
 }\r
 \r
+void VEpg::drawData()\r
+{\r
+  // Not doing View::draw() every time causes\r
+  // things not to be cleared off the surface properly\r
+  // So, blank out the data area first\r
+\r
+  rectangle(\r
+    chanListbox.getOffsetX(),\r
+    chanListbox.getOffsetY() - Surface::getFontHeight() - 3,\r
+    610, // FIXME make this dynamic\r
+    chanListbox.getHeight() + Surface::getFontHeight() + 3,\r
+    Colour::BLACK);\r
+\r
+  chanListbox.draw();\r
+  drawgrid();\r
+  chanName.draw(); // TODO this should be dealt with by vvideolive\r
+  progTitle.draw();\r
+  progInfo.draw();\r
+}
+
+\r
 int VEpg::handleCommand(int command)\r
 {\r
   switch(command)\r
@@ -214,24 +242,24 @@ int VEpg::handleCommand(int command)
     case Remote::UP:\r
     { // cursor up the channel list\r
       chanListbox.up();\r
-      draw();\r
-      show();\r
+      drawData();\r
+      viewman->updateView(this);\r
       return 2;\r
     }\r
     case Remote::DF_DOWN:\r
     case Remote::DOWN:\r
     { // cursor down the channel list\r
       chanListbox.down();\r
-      draw();\r
-      show();\r
+      drawData();\r
+      viewman->updateView(this);\r
       return 2;\r
     }\r
     case Remote::DF_LEFT:\r
     case Remote::LEFT:\r
     { // cursor left through time\r
       selTime = thisEvent.time - 1;\r
-      draw();\r
-      show();\r
+      drawData();\r
+      viewman->updateView(this);\r
       return 2;\r
     }\r
     case Remote::DF_RIGHT:\r
@@ -239,40 +267,40 @@ int VEpg::handleCommand(int command)
     {\r
     // cursor right through time\r
       selTime = thisEvent.time + thisEvent.duration;\r
-      draw();\r
-      show();\r
+      drawData();\r
+      viewman->updateView(this);\r
       return 2;\r
     }\r
     case Remote::RED:\r
     {\r
     // cursor up one page\r
       chanListbox.pageUp();\r
-      draw();\r
-      show();\r
+      drawData();\r
+      viewman->updateView(this);\r
       return 2;\r
     }\r
     case Remote::GREEN:\r
     {\r
     // cursor down one page\r
       chanListbox.pageDown();\r
-      draw();\r
-      show();\r
+      drawData();\r
+      viewman->updateView(this);\r
       return 2;\r
     }\r
     case Remote::BLUE:\r
     {\r
     // step forward 24 hours\r
       selTime += 24 * 60 * 60;\r
-      draw();\r
-      show();\r
+      drawData();\r
+      viewman->updateView(this);\r
       return 2;\r
     }\r
     case Remote::YELLOW:\r
     {\r
     // step forward 24 hours\r
       selTime -= 24 * 60 * 60;\r
-      draw();\r
-      show();\r
+      drawData();\r
+      viewman->updateView(this);\r
       return 2;\r
     }\r
     case Remote::RECORD:\r
@@ -327,7 +355,7 @@ int VEpg::handleCommand(int command)
 \r
 void VEpg::drawgrid() // redraws grid and select programme\r
 {\r
-// draw the grid of programmes\r
+  // draw the grid of programmes\r
   char timeString[20];\r
   time_t t;\r
   time(&t); // set t = now\r
@@ -487,7 +515,7 @@ void VEpg::setCurrentChannel(char* chname)
 {\r
   chanName.setText(chname);\r
   chanName.draw();\r
-  show();\r
+  viewman->updateView(this);\r
 }\r
 \r
 void VEpg::paintCell(Event* event, int yOffset, Colour bg, Colour fg)\r
diff --git a/vepg.h b/vepg.h
index d0170150026189d8f7769c82f3c370b5cc921b66..d9c786f46ea4270335d15ffd7139635e70ea2339 100644 (file)
--- a/vepg.h
+++ b/vepg.h
@@ -55,6 +55,7 @@ class VEpg : public View
   private:\r
     void setInfo(Event* event); // display details of selected programme\r
     void drawgrid(); // redraws grid and select programme\r
+    void drawData();\r
 \r
     WSelectList chanListbox; // listbox to display available channels\r
     WTextbox progTitle; // area to display time and title of selected programme\r
@@ -77,6 +78,7 @@ class VEpg : public View
     void paintCell(Event* event, int yOffset, Colour bg, Colour fg);\r
     time_t prevHour(time_t* t);\r
     VVideoLive* videoLive;\r
+    ViewMan* viewman;\r
 };\r
 \r
 #endif\r
diff --git a/view.h b/view.h
index 430e9b0ab1e2ba882cde0940b83590d9596980e1..ce97743ab873d3aba977414d83cb58f667564a28 100644 (file)
--- a/view.h
+++ b/view.h
@@ -34,7 +34,7 @@ class View : public Box
   public:
     View();
     virtual ~View();
-    bool create(UINT width, UINT height);
+    bool create(UINT width, UINT height); // Even numbers only ?
 
     virtual void draw();
     virtual int handleCommand(int command);
index ab5ab979aa8204b94f9d1e9b59a1449aa5b5efe0..f8180589e4d0df1bb6d7e843bfcf40123995a5e6 100644 (file)
@@ -132,6 +132,7 @@ void ViewMan::deleteView(int z)
 
 void ViewMan::updateView(View* toUpdate, Region* regionToUpdate)
 {
+  Log::getInstance()->log("ViewMan", Log::DEBUG, "UpdateView called");
   // Get the z index of the view
 
   int z;
@@ -170,7 +171,7 @@ void ViewMan::updateView(View* toUpdate, Region* regionToUpdate)
   {
     r2 = rl.front();
     r2.z = z;
-    views[z]->show(r2);
+    views[z]->blt(r2);
     rl.pop_front();
   }
 }
@@ -184,7 +185,7 @@ void ViewMan::repaintRevealed(int x, Region r)
   while(!rl.empty())
   {
     r2 = rl.front();
-    views[r2.z]->show(r2);
+    views[r2.z]->blt(r2);
     rl.pop_front();
   }
 }
@@ -434,7 +435,7 @@ void ViewMan::processMessage(Message* m)
       View* toAdd = (View*)m->parameter;
       add(toAdd);
       toAdd->draw();
-      toAdd->show();
+      updateView(toAdd);
     }
   }
 }
index 9b275994f6340453d9afb4780792c00c7c84d3a5..fd48254c28df5fdb561fb47a6fc7150dc3236b91 100644 (file)
@@ -37,11 +37,11 @@ VLiveBanner::VLiveBanner(View* tparent, Channel* channel, bool bannerTakesComman
   create(500, 120);
   if (Video::getInstance()->getFormat() == Video::PAL)
   {
-    setScreenPos(125, 410);
+    setScreenPos(124, 410);
   }
   else
   {
-    setScreenPos(115, 320);
+    setScreenPos(114, 320);
   }
 
 
@@ -165,7 +165,7 @@ int VLiveBanner::handleCommand(int command)
       sl.up();
       sl.draw();
 
-      show();
+      ViewMan::getInstance()->updateView(this);
 
       // Arrows pressed, go to an 8s timer
       Timers::getInstance()->setTimer(this, 1, (struct timespec){8, 0});
@@ -181,7 +181,7 @@ int VLiveBanner::handleCommand(int command)
       sl.down();
       sl.draw();
 
-      show();
+      ViewMan::getInstance()->updateView(this);
 
       // Arrows pressed, go to an 8s timer
       Timers::getInstance()->setTimer(this, 1, (struct timespec){8, 0});
@@ -242,10 +242,10 @@ int VLiveBanner::handleCommand(int command)
             vi->setScreenPos(110, 90);
           }
           vi->create(510, 270);
+          vi->draw();
 
           ViewMan::getInstance()->add(vi);
-          vi->draw();
-          vi->show();
+          ViewMan::getInstance()->updateView(vi);
 
           return 2;
 
index 46d6b1f9e1c30ac2acb00866808cb3e73d74e110..d4444b3dd2c8437253b2721a13ec9429f78636e5 100644 (file)
--- a/vmute.cc
+++ b/vmute.cc
@@ -75,7 +75,7 @@ int VMute::handleCommand(int command)
     {
       isMuted = Audio::getInstance()->toggleUserMute();
       draw();
-      show();
+      ViewMan::getInstance()->updateView(this);
       // handled
       return 2;
     }
index 74e6827ecf48269da37847b675401d3fb006d7c4..ca26fd4634198b4eeed73272e733ec1f76a733cb 100644 (file)
@@ -22,6 +22,8 @@
 
 VOptions::VOptions()
 {
+  viewman = ViewMan::getInstance();
+
   create(530, 85+(NUM_OPTIONS*30));
   if (Video::getInstance()->getFormat() == Video::PAL)
   {
@@ -132,7 +134,7 @@ int VOptions::handleCommand(int command)
         --selectedOption;
         optionBox[selectedOption].setActive(1);
         draw();
-        show();
+        viewman->updateView(this);
       }
       return 2;
     }
@@ -145,7 +147,7 @@ int VOptions::handleCommand(int command)
         ++selectedOption;
         optionBox[selectedOption].setActive(1);
         draw();
-        show();
+        viewman->updateView(this);
       }
       return 2;
     }
@@ -154,7 +156,7 @@ int VOptions::handleCommand(int command)
     {
       optionBox[selectedOption].left();
       draw();
-      show();
+      viewman->updateView(this);
       return 2;
     }
     case Remote::DF_RIGHT:
@@ -162,7 +164,7 @@ int VOptions::handleCommand(int command)
     {
       optionBox[selectedOption].right();
       draw();
-      show();
+      viewman->updateView(this);
       return 2;
     }
     case Remote::BACK:
@@ -174,7 +176,7 @@ int VOptions::handleCommand(int command)
     {
       optionBox[selectedOption].cycle();
       draw();
-      show();
+      viewman->updateView(this);
     }
   }
 
@@ -221,7 +223,7 @@ void VOptions::doSave()
     Message *m = new Message();
     m->to = VWelcome::getInstance();
     m->message = Message::REDRAW_LANG;
-    ViewMan::getInstance()->postMessage(m);
+    viewman->postMessage(m);
   }
 
   if (result[2] != optionsAtStart[2])
index 5745110e607a784f8f1888f046b002aefc93625e..918d4c29cf19c21d1d9b5107ed381e5ab86f73f7 100644 (file)
@@ -80,6 +80,7 @@ class VOptions : public View
     WOptionBox optionBox[numOptions];
     VDR* vdr;
     int* optionsAtStart;
+    ViewMan* viewman;
 };
 
 #endif
index de8f6ff0f49c82153e8cc3356bbc39421f7d230a..2b792ec10e6d16e6b49013b7793132916e17c404 100644 (file)
@@ -82,7 +82,7 @@ int VQuestion::handleCommand(int command)
     {
       swap();
       draw();
-      show();
+      ViewMan::getInstance()->updateView(this);
       return 2;
     }
     case Remote::DF_RIGHT:
@@ -90,7 +90,7 @@ int VQuestion::handleCommand(int command)
     {
       swap();
       draw();
-      show();
+      ViewMan::getInstance()->updateView(this);
       return 2;
     }
     case Remote::BACK:
index 8b5ba14a73f40218d602f564e0459c4e314b8878..ce14abe864a9c966136f6e0ada91a6717f8c2693 100644 (file)
@@ -24,6 +24,7 @@ VRecordingList::VRecordingList(VRecordingList* tparent)
 {
   myParent = tparent;
   dataInvalid = 0;
+  viewman = ViewMan::getInstance();
 
   create(570, 420);
   if (Video::getInstance()->getFormat() == Video::PAL)
@@ -52,7 +53,7 @@ VRecordingList::~VRecordingList()
     Message* m = new Message();
     m->to = myParent;
     m->message = Message::CHILD_CLOSE;
-    ViewMan::getInstance()->postMessage(m);
+    viewman->postMessage(m);
   }
 
   // only delete the list if this is not a sub dir window
@@ -280,7 +281,7 @@ void VRecordingList::doDeleteSelected()
     Message* m1 = new Message();
     m1->to = myParent;
     m1->message = Message::REDRAW_DATA;
-    ViewMan::getInstance()->postMessage(m1);
+    viewman->postMessage(m1);
   }
 
   show();
@@ -292,9 +293,9 @@ int VRecordingList::doPlay()
   if (toPlay)
   {
     VVideoRec* vidrec = new VVideoRec(toPlay);
-    ViewMan::getInstance()->add(vidrec);
     vidrec->draw();
-    vidrec->show();
+    viewman->add(vidrec);
+    viewman->updateView(vidrec);
     vidrec->go(0);
     return 1;
   }
@@ -310,9 +311,9 @@ int VRecordingList::doResume()
     ULLONG position = VDR::getInstance()->getResumePoint(toResume->fileName);
 
     VVideoRec* vidrec = new VVideoRec(toResume);
-    ViewMan::getInstance()->add(vidrec);
     vidrec->draw();
-    vidrec->show();
+    viewman->add(vidrec);
+    viewman->updateView(vidrec);
     vidrec->go(position);
     return 1;
   }
@@ -342,7 +343,7 @@ int VRecordingList::handleCommand(int command)
       sl.draw();
 
       doShowingBar();
-      show();
+      viewman->updateView(this);
       return 2;
     }
     case Remote::DF_DOWN:
@@ -352,7 +353,7 @@ int VRecordingList::handleCommand(int command)
       sl.draw();
 
       doShowingBar();
-      show();
+      viewman->updateView(this);
       return 2;
     }
     case Remote::SKIPBACK:
@@ -361,7 +362,7 @@ int VRecordingList::handleCommand(int command)
       sl.draw();
 
       doShowingBar();
-      show();
+      viewman->updateView(this);
       return 2;
     }
     case Remote::SKIPFORWARD:
@@ -370,7 +371,7 @@ int VRecordingList::handleCommand(int command)
       sl.draw();
 
       doShowingBar();
-      show();
+      viewman->updateView(this);
       return 2;
     }
     case Remote::OK:
@@ -386,7 +387,7 @@ int VRecordingList::handleCommand(int command)
         {
           VRecordingList* sub = new VRecordingList(this);
           sub->setDir(curDir);
-          ViewMan::getInstance()->add(sub);
+          viewman->add(sub);
 
           sub->draw();
           sub->show();
@@ -404,7 +405,7 @@ int VRecordingList::handleCommand(int command)
         VRecordingMenu* v = new VRecordingMenu();
         v->setParent(this);
         v->setRecording(current);
-        ViewMan::getInstance()->add(v);
+        viewman->add(v);
         v->draw();
         v->show();
         return 2;
index 817901f0a1e4846f2a3e6ae9a29b156399b35e6d..f3a39d96cd8cfd8659f6a6eb456940aa5ad55962 100644 (file)
@@ -55,6 +55,7 @@ class VRecordingList : public View
   private:
     VRecordingList* myParent;
     Directory* recDir;
+    ViewMan* viewman;
 
     WSelectList sl;
     int dataInvalid;
index 3335ac97a63c0530fab9dfb8a407fa37101ed9ea..23494fce9b400724c4cf64331c5e2da3f7bc1506 100644 (file)
@@ -79,7 +79,7 @@ int VRecordingMenu::handleCommand(int command)
     {
       sl.up();
       sl.draw();
-      show();
+      ViewMan::getInstance()->updateView(this);
       return 2;
     }
     case Remote::DF_DOWN:
@@ -87,7 +87,7 @@ int VRecordingMenu::handleCommand(int command)
     {
       sl.down();
       sl.draw();
-      show();
+      ViewMan::getInstance()->updateView(this);
       return 2;
     }
     case Remote::OK:
@@ -131,10 +131,9 @@ int VRecordingMenu::handleCommand(int command)
           vi->setScreenPos(110, 90);
         }
         vi->create(490, 300);
-
-        ViewMan::getInstance()->add(vi);
         vi->draw();
-        vi->show();
+        ViewMan::getInstance()->add(vi);
+        ViewMan::getInstance()->updateView(vi);
 
         if (summary) delete[] summary;
 
@@ -161,9 +160,9 @@ int VRecordingMenu::handleCommand(int command)
           v->setScreenPos(220, 140);
         }
 
-        ViewMan::getInstance()->add(v);
         v->draw();
-        v->show();
+        ViewMan::getInstance()->add(v);
+        ViewMan::getInstance()->updateView(v);
         return 2;
       }
     }
index 9ade764b9411d59d2a97395154cdbeb1b8ce59ff..d0dc172c41431b25bcf230f9ed08075caa2d902f 100644 (file)
@@ -72,7 +72,7 @@ int VServerSelect::handleCommand(int command)
     {
       sl.up();
       sl.draw();
-      show();
+      ViewMan::getInstance()->updateView(this);
       return 2;
     }
     case Remote::DF_DOWN:
@@ -80,7 +80,7 @@ int VServerSelect::handleCommand(int command)
     {
       sl.down();
       sl.draw();
-      show();
+      ViewMan::getInstance()->updateView(this);
       return 2;
     }
     case Remote::OK:
index 1b87978571ac84fd07499fd68d59659f1a6077e6..082e7f67a6bfdce72fe952acaf79313042eb9d64 100644 (file)
@@ -135,9 +135,9 @@ int VVideoLive::handleCommand(int command)
     case Remote::ZERO ... Remote::NINE:
     {
       VChannelSelect* v = new VChannelSelect(this, command);
-      viewman->add(v);
       v->draw();
-      v->show();
+      viewman->add(v);
+      viewman->updateView(v);
     }
   }
 
@@ -196,7 +196,7 @@ void VVideoLive::processMessage(Message* m)
       VLiveBanner* vlb = VLiveBanner::getInstance(); // guaranteed to be one
       vlb->setChannel((*chanList)[currentChannel]);
       vlb->draw();
-      vlb->show();
+      viewman->updateView(vlb);
     }
   }
   else if (m->message == Message::CHANNEL_DOWN)
@@ -208,7 +208,7 @@ void VVideoLive::processMessage(Message* m)
       VLiveBanner* vlb = VLiveBanner::getInstance(); // guaranteed to be one
       vlb->setChannel((*chanList)[currentChannel]);
       vlb->draw();
-      vlb->show();
+      viewman->updateView(vlb);
     }
   }
   else if (m->message == Message::STREAM_END)
index c6adf7de7ebaa005b209d1402d43df9874825586..b67039e7eb0659a191f0cd2c006a7ad6e019d5d3 100644 (file)
@@ -91,7 +91,7 @@ int VVolume::handleCommand(int command)
     {
       displayVolume = Audio::getInstance()->volumeDown();
       draw();
-      show();
+      ViewMan::getInstance()->updateView(this);
       // handled
       return 2;
     }
@@ -100,7 +100,7 @@ int VVolume::handleCommand(int command)
     {
       displayVolume = Audio::getInstance()->volumeUp();
       draw();
-      show();
+      ViewMan::getInstance()->updateView(this);
       // handled
       return 2;
     }
index cd2ebca6b95a2132d80aa1c8d2c33c8643cc3ca6..d18a0ceb650894d9134b21d243663d6f7cd46e29 100644 (file)
@@ -25,6 +25,7 @@ VWelcome* VWelcome::instance = NULL;
 VWelcome::VWelcome()
 {
   instance = this;
+  viewman = ViewMan::getInstance();
 
   clockRegion.x = 400;
   clockRegion.y = 0;
@@ -110,33 +111,19 @@ void VWelcome::drawClock()
 void VWelcome::timercall(int clientReference)
 {
   drawClock();
-  ViewMan::getInstance()->updateView(this, &clockRegion);
+  viewman->updateView(this, &clockRegion);
 }
 
 int VWelcome::handleCommand(int command)
 {
   switch(command)
   {
-    case Remote::NINE:
-    {
-      VInfo* viewWait = new VInfo();
-      viewWait->create(100, 100);
-      viewWait->setScreenPos(485, 185);
-      viewWait->setTitleBarOn(0);
-      viewWait->setBackgroundColour(Colour::DANGER);
-      viewWait->draw();
-      viewWait->show();
-      ViewMan::getInstance()->add(viewWait);
-
-      return 2;
-    }
-
     case Remote::DF_UP:
     case Remote::UP:
     {
       sl.up();
       sl.draw();
-      show();
+      viewman->updateView(this);
       return 2;
     }
     case Remote::DF_DOWN:
@@ -144,7 +131,7 @@ int VWelcome::handleCommand(int command)
     {
       sl.down();
       sl.draw();
-      show();
+      viewman->updateView(this);
       return 2;
     }
     case Remote::ONE:
@@ -230,9 +217,9 @@ void VWelcome::doChannelsList()
     VChannelList* vchan = new VChannelList(VDR::VIDEO);
     vchan->setList(chanList);
 
-    ViewMan::getInstance()->add(vchan);
     vchan->draw();
-    vchan->show();
+    viewman->add(vchan);
+    viewman->updateView(vchan);
 
 
 //        Message* m = new Message();
@@ -253,16 +240,14 @@ void VWelcome::doRadioList()
     VChannelList* vchan = new VChannelList(VDR::RADIO);
     vchan->setList(chanList);
 
-    ViewMan::getInstance()->add(vchan);
     vchan->draw();
-    vchan->show();
+    viewman->add(vchan);
+    viewman->updateView(vchan);
   }
 }
 
 void VWelcome::doRecordingsList()
 {
-  ViewMan* viewman = ViewMan::getInstance();
-
   VInfo* viewWait = new VInfo();
   viewWait->create(460, 190);
   if (Video::getInstance()->getFormat() == Video::PAL)
@@ -275,9 +260,8 @@ void VWelcome::doRecordingsList()
   }
   viewWait->setOneLiner(tr("Downloading recordings list"));
   viewWait->draw();
-  viewWait->show();
   viewman->add(viewWait);
-
+  viewman->updateView(viewWait);
 
   VDR* vdr = VDR::getInstance();
   Directory* recDir = vdr->getRecordingsList();
@@ -286,11 +270,10 @@ void VWelcome::doRecordingsList()
   {
     VRecordingList* vrec = new VRecordingList(NULL);
     vrec->setDir(recDir);
-
-    ViewMan::getInstance()->add(vrec);
-
     vrec->draw();
-    vrec->show();
+
+    viewman->add(vrec);
+    viewman->updateView(vrec);
   }
 
   Log::getInstance()->log("VWelcome", Log::DEBUG, "possible delay start");
@@ -301,9 +284,9 @@ void VWelcome::doRecordingsList()
 void VWelcome::doOptions()
 {
   VOptions* voptions = new VOptions();
-  ViewMan::getInstance()->add(voptions);
   voptions->draw();
-  voptions->show();
+  viewman->add(voptions);
+  viewman->updateView(voptions);
 }
 
 void VWelcome::processMessage(Message* m)
@@ -313,8 +296,6 @@ void VWelcome::processMessage(Message* m)
     Log::getInstance()->log("VWelcome", Log::DEBUG, "Got redraw lang message");
     setup();
     draw();
-    show(); // careful, this only works properly because the only place
-            // this is called from is voptions and that disappears before
-            // this message is delivered
+    viewman->updateView(this);
   }
 }
index fb788a8efef561742c091960ea84f58be948c6e9..97d0b2c6d98f61f99870e3fdf05892dcf6a614eb 100644 (file)
@@ -58,6 +58,8 @@ class VWelcome : public View, public TimerReceiver
     WSelectList sl;
     WJpeg jpeg;
 
+    ViewMan* viewman;
+
     void doChannelsList();
     void doRadioList();
     void doRecordingsList();