00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <qapplication.h>
00015 #include <qstringlist.h>
00016 #include <qpixmap.h>
00017 #include <unistd.h>
00018 #include <cstdlib>
00019
00020 #include <cmath>
00021
00022 #include <mythtv/mythcontext.h>
00023 #include <mythtv/xmlparse.h>
00024
00025 #include "metadata.h"
00026 #include "videogallery.h"
00027 #include "videoselected.h"
00028 #include "videolist.h"
00029 #include "videoutils.h"
00030 #include "imagecache.h"
00031 #include "parentalcontrols.h"
00032
00033 VideoGallery::VideoGallery(MythMainWindow *lparent, const QString &lname,
00034 VideoList *video_list) :
00035 VideoDialog(DLG_GALLERY, lparent, "gallery", lname, video_list)
00036 {
00037 setFileBrowser(gContext->GetNumSetting("VideoGalleryNoDB", 0));
00038 setFlatList(!gContext->GetNumSetting("mythvideo.db_folder_view", 1));
00039
00040 nCols = gContext->GetNumSetting("VideoGalleryColsPerPage", 4);
00041 nRows = gContext->GetNumSetting("VideoGalleryRowsPerPage", 3);
00042 subtitleOn = gContext->GetNumSetting("VideoGallerySubtitle", 1);
00043
00044 loadWindow(xmldata);
00045 LoadIconWindow();
00046
00047 fetchVideos();
00048
00049 updateBackground();
00050
00051 setNoErase();
00052 }
00053
00054 void VideoGallery::keyPressEvent(QKeyEvent *e)
00055 {
00056 bool handled = false;
00057 QStringList actions;
00058
00059 gContext->GetMainWindow()->TranslateKeyPress("Video", e, actions);
00060 for (unsigned int i = 0; i < actions.size() && !handled; i++)
00061 {
00062 QString action = actions[i];
00063 handled = true;
00064
00065 if (action == "SELECT")
00066 handled = handleSelect();
00067 else if (action == "INFO") {
00068 if (where_we_are->getInt() > kSubFolder)
00069 doMenu(true);
00070 } else if (action == "UP" || action == "DOWN" ||
00071 action == "LEFT" || action == "RIGHT" ||
00072 action == "PAGEUP" || action == "PAGEDOWN" ||
00073 action == "HOME" || action == "END")
00074 moveCursor(action);
00075 else if (action == "INCPARENT")
00076 shiftParental(1);
00077 else if (action == "DECPARENT")
00078 shiftParental(-1);
00079 else if (action == "1" || action == "2" ||
00080 action == "3" || action == "4")
00081 setParentalLevel(ParentalLevel(action.toInt()));
00082 else if (action == "FILTER")
00083 slotDoFilter();
00084 else if (action == "MENU")
00085 doMenu(false);
00086 else if (action == "ESCAPE")
00087 {
00088 GenericTree *lparent = where_we_are->getParent();
00089 if (lparent && lparent != video_tree_root)
00090 {
00091 handled = goBack();
00092 }
00093 else
00094 {
00095 handled = false;
00096 }
00097 }
00098 else
00099 handled = false;
00100 }
00101
00102 if (!handled)
00103 {
00104 gContext->GetMainWindow()->TranslateKeyPress("TV Frontend", e, actions);
00105
00106 for (unsigned int i = 0; i < actions.size() && !handled; i++)
00107 {
00108 QString action = actions[i];
00109 if (action == "PLAYBACK")
00110 {
00111 handled = true;
00112 slotWatchVideo();
00113 }
00114 }
00115 }
00116
00117 if (!handled)
00118 MythDialog::keyPressEvent(e);
00119 }
00120
00121 bool VideoGallery::goBack()
00122 {
00123 bool handled = false;
00124
00125 if (m_parent->IsExitingToMain())
00126 return handled;
00127
00128
00129 GenericTree *lparent = where_we_are->getParent();
00130 if (lparent)
00131 {
00132 if (lparent != video_tree_root)
00133 {
00134
00135 where_we_are = lparent;
00136
00137
00138 positionIcon();
00139
00140 update();
00141 handled = true;
00142 }
00143 }
00144 return handled;
00145 }
00146
00147 void VideoGallery::computeLastRowCol(int list_count)
00148 {
00149 lastRow = QMAX((int)ceilf((float)list_count / nCols) - 1, 0);
00150 lastCol = (list_count % nCols - 1 + nCols) % nCols;
00151 }
00152
00153 void VideoGallery::fetchVideos()
00154 {
00155 VideoDialog::fetchVideos();
00156
00157 video_tree_root = VideoDialog::getVideoTreeRoot();
00158 video_tree_root->setOrderingIndex(kNodeSort);
00159
00160
00161
00162
00163 topRow = currRow = currCol = 0;
00164 lastRow = lastCol = 0;
00165
00166 if (video_tree_root->childCount() > 0)
00167 where_we_are = video_tree_root->getChildAt(0,0);
00168 else
00169 where_we_are = video_tree_root;
00170
00171
00172 if (where_we_are->siblingCount() == 1 && where_we_are->getInt() < 0)
00173 {
00174
00175
00176 GenericTree *upnode = where_we_are->getChildAt(0,0);
00177 if (upnode && upnode->getInt() == kUpFolder)
00178 where_we_are->removeNode(upnode);
00179 if (where_we_are->childCount() > 1)
00180 {
00181 video_tree_root = where_we_are;
00182 where_we_are = where_we_are->getChildAt(0,0);
00183 }
00184
00185 }
00186 int list_count = where_we_are->siblingCount();
00187 computeLastRowCol(list_count);
00188
00189 allowselect = list_count > 0;
00190
00191 update();
00192
00193 if (where_we_are->getInt() >= 0)
00194 curitem = m_video_list->getVideoListMetadata(where_we_are->getInt());
00195 else
00196 curitem = NULL;
00197 }
00198
00199 void VideoGallery::paintEvent(QPaintEvent *e)
00200 {
00201 if (!allowPaint)
00202 return;
00203
00204 QRect r = e->rect();
00205 QPainter p(this);
00206
00207 if (r.intersects(textRect))
00208 updateText(&p);
00209
00210 if (r.intersects(viewRect))
00211 updateView(&p);
00212
00213 if (r.intersects(arrowsRect))
00214 updateArrows(&p);
00215
00216 MythDialog::paintEvent(e);
00217 }
00218
00219 void VideoGallery::updateText(QPainter *p)
00220 {
00221
00222
00223
00224
00225 LayerSet *container = theme->GetSet("text");
00226 if (container)
00227 {
00228 QRect pr = textRect;
00229 QPixmap pix(pr.size());
00230 pix.fill(this, pr.topLeft());
00231 QPainter tmp(&pix);
00232
00233
00234 Metadata *meta =
00235 m_video_list->getVideoListMetadata(where_we_are->getInt());
00236 checkedSetText(container, "text",
00237 meta ? meta->Title() : where_we_are->getString());
00238
00239 container->Draw(&tmp, 0, 0);
00240
00241 tmp.end();
00242
00243 p->drawPixmap(pr.topLeft(), pix);
00244 }
00245 }
00246
00247 void VideoGallery::updateArrows(QPainter *p)
00248 {
00249
00250
00251
00252
00253 QRect pr = arrowsRect;
00254 QPixmap pix(pr.size());
00255 pix.fill(this, pr.topLeft());
00256 QPainter tmp(&pix);
00257
00258 LayerSet* container = theme->GetSet("arrows");
00259 if (container) {
00260
00261 int upArrow = (topRow == 0) ? 0 : 1;
00262 int dnArrow = (topRow + nRows >= (lastRow+1)) ? 0 : 1;
00263
00264 container->Draw(&tmp, 0, upArrow);
00265 container->Draw(&tmp, 1, dnArrow);
00266 }
00267 tmp.end();
00268
00269 p->drawPixmap(pr.topLeft(), pix);
00270 }
00271
00272 void VideoGallery::updateView(QPainter *p)
00273 {
00274
00275
00276
00277
00278 GenericTree *lparent = where_we_are->getParent();
00279 if (!lparent)
00280 return;
00281
00282
00283 QRect pr = viewRect;
00284
00285
00286 QPixmap pix(pr.size());
00287 pix.fill(this, pr.topLeft());
00288 QPainter tmp(&pix);
00289 tmp.setPen(Qt::white);
00290
00291 int list_count = lparent->childCount();
00292
00293 for (int ly = 0, curPos = topRow * nCols;
00294 ly < nRows && curPos < list_count;
00295 ly++)
00296 {
00297 int ypos = ly * (spaceH + thumbH);
00298
00299 for (int lx = 0; lx < nCols && curPos < list_count; lx++)
00300 {
00301 int xpos = lx * (spaceW + thumbW);
00302
00303 GenericTree* curTreePos = lparent->getChildAt(curPos,0);
00304
00305 drawIcon(&tmp, curTreePos, curPos, xpos, ypos);
00306
00307 curPos++;
00308 }
00309 }
00310
00311 tmp.end();
00312 p->drawPixmap(pr.topLeft(), pix);
00313 }
00314
00315 void VideoGallery::updateSingleIcon(QPainter *p, int lx, int ly)
00316 {
00317
00318
00319
00320
00321 if ( (ly < topRow) || (ly >= topRow + nRows) || (lx < 0) || (lx >= nCols) )
00322 return;
00323
00324 GenericTree *lparent = where_we_are->getParent();
00325 if (!lparent)
00326 return;
00327
00328 int curPos = lx + ly*nCols;
00329
00330 GenericTree* curTreePos = lparent->getChildAt(curPos,0);
00331 if (!curTreePos)
00332 return;
00333
00334 int ypos = (ly - topRow) * (spaceH + thumbH);
00335 int xpos = lx * (spaceW + thumbW);
00336
00337
00338 QRect pr(viewRect.left() + xpos, viewRect.top() + ypos, thumbW,
00339 thumbH + spaceH);
00340 QPixmap pix(pr.size());
00341 pix.fill(this, pr.topLeft());
00342 QPainter tmp(&pix);
00343 tmp.setPen(Qt::white);
00344
00345 drawIcon(&tmp, curTreePos, curPos, 0, 0);
00346
00347 tmp.end();
00348 p->drawPixmap(pr.topLeft(), pix);
00349 }
00350
00351 void VideoGallery::drawIcon(QPainter *p, GenericTree* curTreePos, int curPos,
00352 int xpos, int ypos)
00353 {
00354 QString icon_file;
00355 int yoffset = 0;
00356 Metadata *meta = NULL;
00357
00358 if (curTreePos->getInt() < 0)
00359 {
00360 if (curPos == (currRow*nCols+currCol))
00361 p->drawPixmap(xpos, ypos, folderSelPix);
00362 else
00363 p->drawPixmap(xpos, ypos, folderRegPix);
00364
00365 if (curTreePos->getInt() == kSubFolder)
00366 {
00367
00368 int folder_id = curTreePos->getAttribute(kFolderPath);
00369 QString folder_path = m_video_list->getFolderPath(folder_id);
00370
00371 QString filename = QString("%1/folder").arg(folder_path);
00372
00373 QStringList test_files;
00374 test_files.append(filename + ".png");
00375 test_files.append(filename + ".jpg");
00376 test_files.append(filename + ".gif");
00377 for (QStringList::const_iterator tfp = test_files.begin();
00378 tfp != test_files.end(); ++tfp)
00379 {
00380 if (QFile::exists(*tfp))
00381 {
00382 icon_file = *tfp;
00383 break;
00384 }
00385 }
00386 }
00387 else if (curTreePos->getInt() == kUpFolder)
00388 {
00389 icon_file = "mv_gallery_dir_up.png";
00390
00391
00392 if (!ImageCache::getImageCache().hitTest(icon_file))
00393 {
00394 std::auto_ptr<QImage> image(gContext->
00395 LoadScaleImage(icon_file));
00396 if (image.get())
00397 {
00398 QPixmap pm(*image.get());
00399 ImageCache::getImageCache().load(icon_file, &pm);
00400 }
00401 }
00402 }
00403
00404
00405 yoffset = (int)(0.1*thumbH);
00406 }
00407 else
00408 {
00409 if (curPos == (currRow*nCols+currCol))
00410 p->drawPixmap(xpos, ypos, backSelPix);
00411 else
00412 p->drawPixmap(xpos, ypos, backRegPix);
00413
00414
00415 meta = m_video_list->getVideoListMetadata(curTreePos->getInt());
00416
00417 if (meta)
00418 icon_file = meta->CoverFile();
00419 }
00420
00421 int bw = backRegPix.width();
00422 int bh = backRegPix.height();
00423 int sw = (int)(11*wmult);
00424 int sh = (int)(11*hmult);
00425
00426 UITextType *itype = 0;
00427 UITextType *ttype = 0;
00428
00429 LayerSet *container = theme->GetSet("view");
00430
00431 if (container)
00432 {
00433 itype = (UITextType*)container->GetType("icontext");
00434 ttype = (UITextType*)container->GetType("subtext");
00435 }
00436 else
00437 {
00438 VERBOSE(VB_IMPORTANT, QString("Failed to get view Container"));
00439 }
00440
00441 if (icon_file.length() && !isDefaultCoverFile(icon_file))
00442 {
00443 const QPixmap *icon_image = ImageCache::getImageCache().
00444 load(icon_file, int(thumbW - 2 * sw),
00445 int(thumbH - 2 * sh - yoffset),
00446 QImage::ScaleMin);
00447
00448 if (icon_image && !icon_image->isNull())
00449 p->drawPixmap(xpos + sw, ypos + sh + yoffset, *icon_image,
00450 (icon_image->width() - bw) / 2 + sw,
00451 (icon_image->height() - bh + yoffset) / 2 + sh,
00452 bw - 2 * sw, bh - 2 * sh - yoffset);
00453 }
00454 else
00455 {
00456
00457 if (itype)
00458 {
00459 QRect area = itype->DisplayArea();
00460
00461 area.setX(xpos + sw);
00462 area.setY(ypos + sh + yoffset);
00463 area.setWidth(bw-2*sw);
00464 area.setHeight(bh-2*sh-yoffset);
00465 itype->SetDisplayArea(area);
00466 itype->calculateScreenArea();
00467 itype->SetText(meta ? meta->Title() : curTreePos->getString());
00468
00469 for (int i = 0; i < 4; ++i)
00470 itype->Draw(p, i, 0);
00471 }
00472 }
00473
00474
00475 if (ttype && subtitleOn)
00476 {
00477 QRect area = ttype->DisplayArea();
00478
00479 area.setX(xpos + sw);
00480 area.setY(ypos + thumbH);
00481 area.setWidth(bw-2*sw);
00482 area.setHeight(spaceH);
00483 ttype->SetDisplayArea(area);
00484 ttype->calculateScreenArea();
00485 ttype->SetText(meta ? meta->Title() : curTreePos->getString());
00486
00487 for (int i = 0; i < 4; ++i)
00488 ttype->Draw(p, i, 0);
00489 }
00490 }
00491
00492 void VideoGallery::doMenu(bool info)
00493 {
00494 if (createPopup())
00495 {
00496 QButton *focusButton = NULL;
00497
00498 if (info)
00499 {
00500 focusButton = popup->addButton(tr("Watch This Video"), this,
00501 SLOT(slotWatchVideo()));
00502 popup->addButton(tr("View Full Plot"), this, SLOT(slotViewPlot()));
00503 popup->addButton(tr("View Cast"), this, SLOT(slotViewCast()));
00504 popup->addButton(tr("View Details"), this,
00505 SLOT(handleVideoSelect()));
00506
00507 }
00508 else
00509 {
00510 focusButton = popup->addButton(tr("Filter Display"), this,
00511 SLOT(slotDoFilter()));
00512 AddPopupViews();
00513 }
00514
00515 popup->addButton(tr("Cancel"), this, SLOT(slotDoCancel()));
00516
00517 popup->ShowPopup(this, SLOT(slotDoCancel()));
00518
00519 focusButton->setFocus();
00520 }
00521 }
00522
00523 void VideoGallery::LoadIconWindow()
00524 {
00525 const float lmargin = 0.05;
00526
00527
00528
00529
00530
00531 LayerSet *container = theme->GetSet("view");
00532 if (!container) {
00533 VERBOSE(VB_IMPORTANT,
00534 QString("MythVideo: Failed to get view container."));
00535 exit(-1);
00536 }
00537
00538 UIBlackHoleType* bhType = (UIBlackHoleType*)container->GetType("view");
00539 if (!bhType) {
00540 VERBOSE(VB_IMPORTANT, QString("MythVideo: Failed to get view area."));
00541 exit(-1);
00542 }
00543
00544
00545
00546
00547
00548
00549 spaceH = 0;
00550 if (subtitleOn) {
00551 UITextType *ttype = (UITextType*)container->GetType("subtext");
00552 if (ttype) {
00553 QRect area = ttype->DisplayArea();
00554 spaceH = area.height();
00555 }
00556 }
00557
00558
00559 thumbW = (int)floorf((float)(viewRect.width()) /
00560 ((float)nCols * (1 + lmargin) - lmargin));
00561 thumbH = (int)floorf((float)(viewRect.height() - nRows * spaceH) /
00562 ((float)nRows * (1 + lmargin)));
00563 spaceW = (nCols <= 1 ? 0 : (viewRect.width() - (nCols * thumbW)) /
00564 (nCols - 1));
00565 spaceH = (viewRect.height() - (nRows * thumbH)) / nRows;
00566
00567
00568
00569
00570
00571 struct
00572 {
00573 char *filename;
00574 QPixmap *name;
00575 } const backgrounds[4] = {
00576 { "mv_gallery_back_reg.png", &backRegPix },
00577 { "mv_gallery_back_sel.png", &backSelPix },
00578 { "mv_gallery_folder_reg.png", &folderRegPix },
00579 { "mv_gallery_folder_sel.png", &folderSelPix }
00580 };
00581
00582 QImage *img;
00583 for (unsigned int i = 0; i < 4; i++) {
00584 img = gContext->LoadScaleImage(QString(backgrounds[i].filename));
00585 if (!img) {
00586 VERBOSE(VB_IMPORTANT,
00587 QString("Failed to load %1").arg(backgrounds[i].filename));
00588 exit(-1);
00589 }
00590 *(backgrounds[i].name) = QPixmap(img->smoothScale((int)thumbW,
00591 (int)thumbH,
00592 QImage::ScaleFree));
00593 delete img;
00594 }
00595 }
00596
00597 void VideoGallery::exitWin()
00598 {
00599 emit accept();
00600 }
00601
00602 void VideoGallery::moveCursor(const QString& action)
00603 {
00604
00605 int lastTopRow = QMAX(lastRow - nRows + 1, 0);
00606 int prevCol = currCol;
00607 int prevRow = currRow;
00608 int oldRow = topRow;
00609
00610 if (action == "LEFT")
00611 {
00612 if (currCol > 0) {
00613 currCol--;
00614 } else {
00615 if (currRow > 0) {
00616 if (topRow == currRow)
00617 topRow--;
00618 currRow--;
00619 currCol = nCols - 1;
00620 } else {
00621
00622 topRow = lastTopRow;
00623 currRow = lastRow;
00624 currCol = lastCol;
00625 }
00626 }
00627 }
00628 else if (action == "RIGHT")
00629 {
00630 if (currRow < lastRow) {
00631 if (currCol < nCols - 1) {
00632 currCol++;
00633 } else {
00634 if (topRow + nRows - 1 == currRow)
00635 topRow++;
00636 currRow++;
00637 currCol = 0;
00638 }
00639 } else {
00640 if (currCol < lastCol) {
00641 currCol++;
00642 } else {
00643
00644 topRow = 0;
00645 currRow = 0;
00646 currCol = 0;
00647 }
00648 }
00649 }
00650 else if (action == "UP")
00651 {
00652 if (currRow > 0) {
00653 if (topRow == currRow)
00654 topRow--;
00655 currRow--;
00656 } else {
00657
00658 topRow = lastTopRow;
00659 currRow = lastRow;
00660 currCol = QMIN(currCol, lastCol);
00661 }
00662 }
00663 else if (action == "DOWN")
00664 {
00665 if (currRow < lastRow) {
00666 if (topRow + nRows - 1 == currRow)
00667 topRow++;
00668 currRow++;
00669 if (currRow == lastRow)
00670 currCol = QMIN(currCol, lastCol);
00671 } else {
00672
00673 topRow = 0;
00674 currRow = 0;
00675 }
00676 }
00677 else if (action == "PAGEUP")
00678 {
00679
00680 if (topRow >= nRows) {
00681 topRow -= nRows;
00682 currRow -= nRows;
00683 } else if (topRow > 0) {
00684 unsigned int scrollrows = topRow;
00685 topRow -= scrollrows;
00686 currRow -= scrollrows;
00687 } else if (currRow > 0 || currCol > 0) {
00688 currRow = 0;
00689 currCol = 0;
00690 } else if (lastTopRow > 0) {
00691
00692 topRow = lastTopRow;
00693 currRow = lastRow;
00694 currCol = QMIN(currCol, lastCol);
00695 } else {
00696
00697 return;
00698 }
00699 }
00700 else if (action == "PAGEDOWN")
00701 {
00702
00703 if (topRow <= lastTopRow - nRows) {
00704 topRow += nRows;
00705 currRow += nRows;
00706 if (currRow == lastRow)
00707 currCol = QMIN(currCol, lastCol);
00708 } else if (topRow < lastTopRow) {
00709 unsigned int scrollrows = lastTopRow - topRow;
00710 topRow += scrollrows;
00711 currRow += scrollrows;
00712 if (currRow == lastRow)
00713 currCol = QMIN(currCol, lastCol);
00714 } else if (currRow < lastRow || currCol < lastCol) {
00715 currRow = lastRow;
00716 currCol = lastCol;
00717 } else if (topRow > 0) {
00718
00719 topRow = 0;
00720 currRow = 0;
00721 } else {
00722
00723 return;
00724 }
00725 }
00726 else if (action == "HOME")
00727 {
00728 topRow = 0;
00729 currRow = 0;
00730 currCol = 0;
00731 }
00732 else if (action == "END")
00733 {
00734 topRow = lastTopRow;
00735 currRow = lastRow;
00736 currCol = lastCol;
00737 }
00738 else
00739 return;
00740
00741 GenericTree *lparent = where_we_are->getParent();
00742 if (lparent)
00743 where_we_are = lparent->getChildAt(currRow * nCols + currCol, 0);
00744
00745 curitem = m_video_list->getVideoListMetadata(where_we_are->getInt());
00746
00747 if (topRow != oldRow)
00748 {
00749 update(viewRect);
00750 update(textRect);
00751 update(arrowsRect);
00752 }
00753 else
00754 {
00755 QPainter p(this);
00756 updateSingleIcon(&p,prevCol,prevRow);
00757 updateSingleIcon(&p,currCol,currRow);
00758 updateText(&p);
00759 }
00760 }
00761
00762 void VideoGallery::slotChangeView()
00763 {
00764
00765
00766
00767
00768 cancelPopup();
00769 setFileBrowser(!isFileBrowser);
00770 setFlatList(!isFileBrowser);
00771
00772 fetchVideos();
00773 }
00774
00775 void VideoGallery::positionIcon()
00776 {
00777
00778 int inData = where_we_are->getPosition(0);
00779 currRow = inData / nCols;
00780 currCol = inData % nCols;
00781
00782
00783 computeLastRowCol(where_we_are->siblingCount());
00784 topRow = QMIN(currRow, QMAX(lastRow - nRows + 1, 0));
00785 }
00786
00787 void VideoGallery::handleDirSelect()
00788 {
00789
00790 int list_count = where_we_are->childCount();
00791 if (list_count > 0)
00792 {
00793 topRow = currRow = currCol = 0;
00794
00795 where_we_are = where_we_are->getChildAt(0,0);
00796
00797 computeLastRowCol(list_count);
00798
00799 allowselect = true;
00800 }
00801 else
00802 {
00803 allowselect = false;
00804 }
00805 }
00806
00807 void VideoGallery::handleUpDirSelect()
00808 {
00809 GenericTree *lparent = where_we_are->getParent();
00810 if (lparent)
00811 {
00812 if (lparent != video_tree_root)
00813 {
00814
00815 where_we_are = lparent;
00816
00817
00818 positionIcon();
00819
00820 allowselect = (bool)(where_we_are->siblingCount() > 0);
00821 }
00822 }
00823 }
00824
00825 void VideoGallery::handleVideoSelect()
00826 {
00827 cancelPopup();
00828
00829 VideoSelected *selected = new VideoSelected(m_video_list,
00830 gContext->GetMainWindow(),
00831 "video selected",
00832 where_we_are->getInt());
00833 qApp->unlock();
00834 selected->exec();
00835 qApp->lock();
00836 delete selected;
00837 }
00838
00839 bool VideoGallery::handleSelect()
00840 {
00841 bool handled = true;
00842
00843 if (allowselect)
00844 {
00845 switch (where_we_are->getInt())
00846 {
00847 case kSubFolder:
00848 handleDirSelect();
00849 break;
00850 case kUpFolder:
00851 handleUpDirSelect();
00852 break;
00853 default:
00854 handleVideoSelect();
00855 };
00856
00857 update();
00858 }
00859
00860 return handled;
00861 }
00862
00863 void VideoGallery::parseContainer(QDomElement &element)
00864 {
00865 QRect area;
00866 QString container_name;
00867 int context;
00868 theme->parseContainer(element, container_name, context, area);
00869
00870 container_name = container_name.lower();
00871 if (container_name == "text")
00872 textRect = area;
00873 else if (container_name == "view")
00874 viewRect = area;
00875 else if (container_name == "arrows")
00876 arrowsRect = area;
00877 }